Synchronous Java Proxy Server template - filling reponse message elements

Hi !
I'm writing a java proxy server for a synchronous interface. I'm somehow new in java...and I don't know how should I create elements for my response message inside the java method used to process the request message.
The response message format is something like this:
<field1>abc</field1>
<field2>
....<field2a>
........<fields2a1>
........</fields2a1>
....</field2a>
....<field2a>
....</field2a>
</field2>
according to the type "DT_Output_Type" type of the public class MyMethod defined in the java template generated by XI repository..
I think I should do something like this:
DT_Output_Type response = new DT_Output_Type();
DT_Output_Type.field2_List field2values = new DT_Output_Type.field2_List();
field2values.setfield2a(0,"1234");
response.setfield1 = "abc";
response.setfield2(field2values);
return response;
But I receive "Error invoking method". If I comment out the code where I assign values to sub-elements, everything works ok.
Thanks !
Matias

Hi Matias,
>><i>DT_Output_Type.field2_List field2values = new DT_Output_Type.field2_List();</i>
This will create instance for field2 only.
Before setting field2a using <i>field2values.setfield2a(0,"1234");</i> you must creat instance of field2a and also for field2a1.
I guess field2a will be an array.
so the order of creating instance and setting values can be ...
1. create instance of field2
2. create instance of field2a array
3. create instance of first array element of field2a
4. create instance of field2a1
5. set value for field2a1
6. set field2a1 in first array element of field2a
repeat steps 3-6 for next elements of field2a
7. set field2a array object (created in step 2) in field2
8. response.setfield2(field2values);
Also,
as mentioned by Amol, set value for filed1 should be
response.setfield1("abc");
Regards,
Uma

Similar Messages

  • Sync Java Proxy Server response in XML

    Hi !
    We've this scenario: File1 <-> XI <-> Java Proxy <-> File2
    Using a BPM, we made a Async/Sync workflow. It works ok. It uses a SYNC Java Proxy Server.
    The problem is that inside the java proxy, we query an http source that returns already XML formated data. We need this data to be mapped from the java proxy response message type to the File2 message type.
    We know that we can parse the XML data inside the java proxy and fill the response message type structures (creating items, and array items for nested records), or directly   code the mapping here.
    But, is there any alternative to pass the received XML from the HTTP directly to XI, and map that XML structure with the File2 message type using graphical mapping ? instead of programming the xml parsing and creating the response structure?
    If we create a message type for the response of the java proxy, as 1 field that contains the whole XML code, then we would not map it....Is there any way to complete or to add  something to the received XML code, to convert it to the XI message format..so XI could interpret it as a true XI message and map it transparently via graphical mapping?
    Thanks,
    Matias

    Hi Akshay !
    That's exactly what I don't know how to do it.
    Inside the java proxy function I have a string variable, let's call it xmlResponse, that contains:
    <customer>
    <name>Matias</name>
    <country>China</country>
    </customer>
    I also have a message type created in XI (let's call it MT_Response), that has the same fields as the above message structure. And my java proxy function is declared something like this:
    public MT_Response.Type myFunction(MT_Request.Type myRequest) {
    String xmlResponse="";
    // http connection code goes here..
    xmlResponse = httpConnection.getResponse();
    return ??????? what ????
    I don't want to parse the xmlResponse variable in order to fill the MT_Response structure. I need a more direct way, because the content of xmlResponse is already XML !
    Thanks.

  • Give me description about JAVA Proxy Runtime and JAVA Proxy Server

    Give me description about JAVA Proxy Runtime and JAVA Proxy Server with some examples.

    Hi,
    Java proxy runtime :
    Using the Java proxy runtime you can receive messages or send messages to the Integration Server.
    This will help you
    http://help.sap.com/saphelp_nw04/helpdata/en/64/7e5e3c754e476ee10000000a11405a/frameset.htm
    Java proxy server :
    The connection to the Integration Server by using the Java proxy runtime.
    This will help you
    http://help.sap.com/saphelp_nw04/helpdata/en/87/5305adc23540b8ac7bce08dbe96bd5/frameset.htm
    Regards
    Agasthuri Doss

  • Open source Java proxy server?!

    Hi,
    I want to use a java proxy server in my application.Can someone suggest me some popular java proxy server with free source code? Also, the proxy should log URL details that the user navigates to.
    Any help is greatly appreciated.
    Thanks
    Aparna

    Hi michael,
    In fact i have downloaded the proxy but running into problems while using it.I am using it on windows platform and when i give some URL in the browser, the request is taken by our RabbIT but after that the browser is asking me for the authentication for a number of times and then show me some error.Why is RabbIT asking me for authentication though i am specifying it in the configuration file?
    Any help is appreciated.
    Aparna

  • Error when deploy Java Proxy Server EAR to PI

    We are trying to deploy our Java Proxy Server EAR to PI using Visual Administrator. However, it gives the following error:
    Deploy of the ear has errors :
    java.rmi.RemoteException: Cannot deploy application sap.com/TestBatch
    Reason: Errors while compiling:
    .... .java:91 illegal escape character
    if (method.equals("U0024descriptor")) { ....
    We have tried to deploy the same EAR to another PI system and it works fine. As a result, we think we might have missed something when installing or configuring this PI but don't have a clue where to start. We have also tried deploying using SDM but also didn't succeed.

    Hi Pikad !
    I understand that it the very same EAR deployed with no hassle in another PI, here it should work ok, but I think you should check the backslash you are using. If you need to use the backslash character, you must use ("
    U0024descriptor") or change the U to \u0024 for the dollar sign.
    Check:
    Regards,
    Matias.

  • Does Java Proxy guarantee the delivery of message?

    Hi All ,
    I would like to know, if java client proxy guarantees the delivery of messages similar to ABAP client proxies.
    I am asking this question with reference to a situation where the XI system is down and the client proxy messages are invoked to the Integration Server.
    Can anyone share more thoughts on this?
    Thanks
    Narendra

    Narendra,
    Refer to the url http://help.sap.com/saphelp_nw04/helpdata/en/e3/c809c2fde0af4098e1ae126d06866c/frameset.htm
    From the menu on the LHS of this page you can navigate down to Acknowledgements
    An acknowledgement can be set which will enable you to confirm that an asynchronous message has been received
    Hope this helps,
    Mike

  • Issue with using Sun Java Proxy Server

    We are trying to access the WebService using the Sun Proxy Server.
    When I access the WebService through proxy ,I find the error message in proxy error log as
    [18/Oct/2005:19:10:40] failure ( 1288): for host 127.0.0.1 trying to POST http://localhost:1080/yodsoap/services/CobrandLogin, service-http reports: HTTP7760: error reading request body (Client closed connection)
    and the access log is as follows:
    POST http://localhost:1080/yodsoap/services/CobrandLogin HTTP/1.1" 400 147
    But when i see the WebServer access log for the same WebService POST /yodsoap/services/CobrandLogin HTTP/1.1" 200 1783 "-" "Axis/1.1RC1"
    This case is happening when the request is compressed for the webservice. and the request headers are as follows:
    POST /yodsoap/services/CobrandLogin HTTP/1.1
    Content-Type: text/xml; charset=utf-8
    Accept: application/soap+xml, application/dime, multipart/related, text/*
    User-Agent: Axis/1.1RC1
    Host: 127.0.0.1
    Cache-Control: no-cache
    Pragma: no-cache
    SOAPAction: "loginCobrand"
    Content-Length: 1412
    Connection: close
    Content-Encoding: gzip
    And the response headers are as follows:
    HTTP/1.1 200 OK
    Server: Resin/3.0.8
    Content-Type: text/xml; charset=utf-8
    Transfer-Encoding: chunked
    Date: Tue, 18 Oct 2005 13:41:50 GMT
    So ,we found out that if we dont use the proxy server,then the WebService is working properly,but if we start using the proxy server,we are encountering HTTP400 error.
    Any ideas will help out to solve this problem..???
    Thankz in advance.
    Regards,
    Somendra

    This is what I see in the error message:
    ProxyFactory initialized in SOAP_CLIENT_MODE
    System property : com.yodlee.soap.client.log4j.config not found. Using the default config resource : com.yodlee.util.soap.log4j
    ProxyFactory initialized in SOAP_CLIENT_MODE
    System property : com.yodlee.soap.client.log4j.config not found. Using the default config resource : com.yodlee.util.soap.log4j
    HTTP Header name and value is HTTP/1.1 400 Bad request
    HTTP Header name and value is Server Sun-Java-System-Web-Proxy-Server/4.0
    HTTP Header name and value is Date Tue, 18 Oct 2005 14:56:21 GMT
    HTTP Header name and value is Connection close
    com.yodlee.core.CoreRemoteException: org.xml.sax.SAXException: Bad envelope tag: HTML
         at com.yodlee.soap.core.login.CobrandLoginSoapClientProxy.loginCobrand(CobrandLoginSoapClientProxy.java:132)
         at SoapClient.main(SoapClient.java:45)
    Caused by: org.xml.sax.SAXException: Bad envelope tag: HTML
         at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:543)
         at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2511)
         at org.apache.axis.client.Call.invoke(Call.java:2481)
         at org.apache.axis.client.Call.invoke(Call.java:2176)
         at org.apache.axis.client.Call.invoke(Call.java:2099)
         at org.apache.axis.client.Call.invoke(Call.java:1622)
         at com.yodlee.soap.core.login.CobrandLoginSoapBindingStub.loginCobrand(CobrandLoginSoapBindingStub.java:225)
         at com.yodlee.soap.core.login.CobrandLoginSoapClientProxy.loginCobrand(CobrandLoginSoapClientProxy.java:119)
         ... 1 more
    Caused by: org.xml.sax.SAXException: Bad envelope tag: HTML
         at org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:107)
         at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:934)
         at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1635)
         at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:634)
         at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
         at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
         at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:230)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
         ... 9 more

  • Hire a java expert for java proxy server.

    hello,
    i need a expert java programmer to hire for a simple java proxy project please contact me if you are intrested please leave me a message for more info.

    http://localhost:7021/sbresource?PROXY/MySample/MyJMSProxyService is the WSDL URL of the proxy.
    Transport is is picked by the client from wsdl.
    As far as the documentation of client generation is there, there is no change.
    But meanwhile I have started working on sending the message directly to queue. JMSProxy is getting called. May be I will first run the proxy this way and then try troubleshooting the java client.
    Regards
    Ashwani

  • Sun Java proxy server 3.6 SP7

    Hi
    When I want to use my proxy for non anonymous FTP server I get an error, because default proxy server ( v.3.6 ) connect as anonymous and login msgbox doesn't appear Why ???
    I can do this with 4.0.2 but this version doesn't work fine ( proxyd proccess consumes about 75% resources ).
    So alternativelly I can use CERN standard for some basic username, but it doesn't work with username like [email protected] and password
    Does anyone know how to fix this ?

    OK
    I have problem when I want to use proxy server for non anonymous ftp sites.
    When I write some URL ftp://ftp.xxx.xx ( non anonymous FTP ) proxy server default connects as anonymous and then server reply :
    The requested item could not be loaded by the proxy.
    Login incorrect.
    I want that proxy server ( like 4.0.2 ) reply login incorrect and internet browser ( not IE ) asks for right user and password
    And about 4.0.2, when I start proxy server ( Solaris 9 SUN E450 ) and receive clients requests one of the proxyd proccess constantly uses a lot of system resources ( ~ 75%, especially kernel and user mode )

  • Alerts for Java Proxy Runtime

    Hi Gurus!!
    I have a problem with a Asynchronous Java Proxy Server.
    When a message is sent from Integration Engine to the Java Proxy, in the SXMB_MONI the status is ok, but if there is a problem on the Java Proxy, I can only see on the Messaging Tool 'http://myserver:myport/MessagingSystem'.
    Is there any alert to inform of problems of excution of Java Proxies?
    Thanks and regards,
    Manuel Míguez.

    If you can see the error in the Adapter engine monitoring, you can create rule in RWB and get an alert mail. If the error is occuring beyond XI AE, you can not trigger an alert.
    VJ

  • Synchronous-Asynchronous Interface with Java Proxy

    Hi Gurus!!
    I have an Interface which begins on SAP with a call to an asynchronous ABAP Proxy . Xi sends the message to Java Proxy Server. This Java Proxy Server calls to a Java Proxy Client that sends the response to SAP through XI. This response is taken on SAP on ABAP Proxy Inbound.
    These arquitechture is a requirement, because the time between the request and the response could be 30 minutes and the user shouldn't be waiting the response synchronously.
    Is there any way to the user could manage the response in the same "thread" that he opened in the request?
    I hope have been clear enough.
    Thanks and regards,
    Manuel Míguez.

    The only possibility I could think of is using correlation. There also you have the limitation of java proxy as it does not support adapter modules. Could you use SOAP for your scenario?
    JMS receiver could use inherent properties to define correlations. But as your case is non-JMS, you have to define it manually. Say, if your receiver system is X, then the request from XI to system X should carry its message ID information. While X created the response message, it should use this message ID as the correlation ID for the response message. This could be achieved using an adapter module.
    I guess you were not looking for such a complex solution.
    Regards,
    Prateek

  • Help - how to create java proxy (sender) in NWDS 7.1

    Hi,
    I am trying to develop a java proxy as sender to send message from WAS to PI.
    I am using NWDS 7.1. Let me explain what I have done so far,
    1. Received proxy classes from PI
    2. Created a EJB Project, imported the proxy classes into EJB project
    3. created a EJB bean, local interface in the EJB project and exposed as webservice
    4. added the ejb to an ear
    5. added reference to the following jar files (external library)
    tcaiiproxy_rt_api.jar
    com.sap.aii.af.sdk.jar
    com.sap.aii.utilxi.server.jar
    com.sap.aii.utilxi.core.jar
    com.sap.aii.proxy.svc_api.jar
    6. able to build and deploy the application
    7. able to open the webservice in wsnavigator
    Error encountered:
    "Server Exception: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/sap/aii/proxy/xiruntime/core/AbstractType "
    Questions:
    1. Which method I should execute / call among all the proxy classes from local bean class to send message to PI?
    2. Is it mandatory to add refernces to the application.xml, ejb-jar.xml and other xmls ?
    3. How can I test / monitor the message being sent to PI interface?
    Thanks and best regards,
    Arun prabhu S

    plz cross chk the references under application-j2eeengine.xml and ejb-jar.xml
    http://wiki.sdn.sap.com/wiki/display/Java/JavaProxyChangesinPI7.1fromPI7.0
    u can chk tis article also:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/508bb504-87cf-2c10-2aaf-f3a5df75e651?quicklink=index&overridelayout=true

  • Java Proxy & NWDS

    Hi friends,
                   I need very simple and clear steps as to what i should do as far as Java proxy is concerned.Steps to do in NWDS,.
    Also am new to Proxies.....          What about the Java code.....I don know Java....
    Can i find relevant code and screen shots with both client and server Java proxies.
    Scenarios with screen shots if possible.
    Please post as soon as possible.....
    Thanks & Regards
    Deepika K

    Hi
    NWDS
    NWDS - NetWeaver Developer Studio - editor, etc used by the developer to code. Developers way to interact with the infrastructure.
    NWDS is just a development environment with all robust development tools.
    It can run j2ee,j2se and sap applications also.
    It is an interface to access NWDI services and applications.
    SAP NetWeaver Developer Studio (NWDS) for more details follow : http://help.sap.com/saphelp_nw2004s/helpdata/en/15/0d4f21c17c8044af4868130e9fea07/frameset.htm
    SAP NetWeaver Java Development Infrastructure (NWDI) for more details follow http://help.sap.com/saphelp_nw2004s/helpdata/en/44/312b1a8bea3ec8e10000000a1553f6/frameset.htm
    JAVA PROXIES
    You can generate Java proxies for J2EE applications on the SAP Web AS. Proxy generation generates J2EE beans and proxy classes for this purpose. The generated beans satisfy the EJB 2.0 standard.
    Java proxy generation is part of the Integration Builder and has the following functions:
    ·        Create an archive (as a Jar or Zip file) by using one or more message interfaces from the same software component version. The archive contains bean and proxy classes.
    ·        Open existing archives to regenerate proxies. Proxy generation knows the original message interfaces for which proxy objects are contained in the archive.
    Selecting Message Interfaces
    You can call Java proxy generation from the design maintenance screen of the Integration Builder in the following ways:
    ·        From the main menu, choose Tools ® Java Proxy Generation.
    ·        From the context menu, choose Java Proxy Generation... for message interfaces in the navigation tree.
    The latter method has the advantage that the selected message interface and the corresponding software component version can be copied directly. You can only generate proxy classes for message interfaces and not for sub objects of message interfaces.
    Java Proxies and SAP Exchange Infrastructure - The Inside Story, Part 1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a068cf2f-0401-0010-2aa9-f5ae4b2096f9
    Java Proxies and SAP Exchange Infrastructure - The Inside Story, Part 2
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f272165e-0401-0010-b4a1-e7eb8903501d
    SAP Exchange Infrastructure 3.0: Java Proxy Runtime 3.0 - J2EE Integration
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30572c6a-d311-2a10-99ab-f646ec3b5b12
    How to Work with Java Proxies
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d06315a6-e66e-2910-039c-ba8bbbd23702
    Java Proxies in XI
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=java+proxy&adv=false&sortby=cm_rnd_rankvalue#
    Java Proxies in XI
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=java+proxy&adv=false&sortby=cm_rnd_rankvalue#
    SAP Network Blog: Pre requisites for Client Java Proxies
    /people/yugapreetha.t/blog/2007/12/03/pre-requisites-for-client-java-proxies
    Java Proxy-
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7d4db211-0d01-0010-1e8e-9b07fc2113ab
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a068cf2f-0401-0010-2aa9-f5ae4b2096f9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f272165e-0401-0010-b4a1-e7eb8903501d
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a068cf2f-0401-0010-2aa9-f5ae4b2096f9
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f272165e-0401-0010-b4a1-e7eb8903501d
    Hope this clears your doubts
    Thanks
    Saiyog

  • Java proxy in PI7.1.....

    Hi All,
    I am having a requirement where i have to develop JAVA proxy in PI 7.1 and for this I am using NWDS 7.1 but the main concern is that i am very new to JAVA proxies. Even though i refer SDN but the blogs and forums mentioned are related to XI3.0/PI7.0.
    I would be very pleased if anybody clear some of my doubts:
    1) Do we require WAS in order to install J2ee based non central adapter engine?If yes how to install it.
    2) How to configure client and server proxies in PI 7.1 using NWDS 7.1?
    3) How to deploy and test java proxies?
    Thanks In Advance.

    Hi,
    You can install the Java proxy runtime on the SAP J2EE Engine Release 6.40 SP5 or higher.
    The messaging system that the Java proxy runtime uses to send messages to the Integration Server must also be installed on the J2EE server.
    To send messages from a J2EE application, the application must be programmed against beans that encapsulate all details about the Java runtime. The following classes are generated:
    u2022 Proxy classes that send or receive messages using the Java proxy runtime.
    u2022 Bean classes as an outer shell that conform to the J2EE standard. The beans call the proxy classes for communication.
    The classes must be deployed on the J2EE server together with their J2EE application
    see this link for the example scenario https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f272165e-0401-0010-b4a1-e7eb8903501d
    Refer this configuration guide:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ac6de690-0201-0010-54ac-8923089dcc97
    Refer these too:
    Java Proxy Inside Story Part I
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a068cf2f-0401-0010-2aa9-f5ae4b2096f9
    Java Proxy Inside Story Part II
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f272165e-0401-0010-b4a1-e7eb8903501d
    Change in PI 7.1
    usr/sap/<SID>/DVEBMGS<nr>/j2ee/cluster/server0/apps (xI 3.0)
    /usr/sap/<SID>/DVEBMGS<nr>/j2ee/cluster/bin/ (PI 7.1)
    Regards
    Zahid Ali

  • What are the pre-requisite for JAVA Proxy communication?

    What are the pre-requisite for JAVA Proxy communication?

    Hi,
    You can install the Java proxy runtime on the SAP J2EE Engine Release 6.40 SP5 or higher.
    The messaging system that the Java proxy runtime uses to send messages to the Integration Server must also be installed on the J2EE server.
    To send messages from a J2EE application, the application must be programmed against beans that encapsulate all details about the Java runtime. The following classes are generated:
    ·        Proxy classes that send or receive messages using the Java proxy runtime.
    ·        Bean classes as an outer shell that conform to the J2EE standard. The beans call the proxy classes for communication.
    The classes must be deployed on the J2EE server together with their J2EE application
    see this link for the example scenario http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f272165e-0401-0010-b4a1-e7eb8903501d

Maybe you are looking for