on 02-14-2007 7:52 PM
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 Mathias,
you can use the messageSpecifier attribut to set the payload directly:
http://help.sap.com/saphelp_nw2004s/helpdata/en/9a/945e3026760745a751a85499139c7c/frameset.htm
messageSpecifier.setPayload(payload)
Hope that helps,
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan !
Your answer sound very good and easy ! just one more question...if I "charge" the payload using this function...what should I return via the mandatory expected "return" statement of the implementation function? or should I convert the function from type "[myNamespace].DTmyType_Type" to "void" ? I need it to work as a synchronous function....
Thanks !
Hi Matias.
You can convert the response xml into xsd using a sw like stylus studio and import tht xsd into XI..use it as ur the msg type. This way u can directly send the response from HTTP to XI and then to the file. Try doin it.
Regards,
Akshay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Akshay !
We are using a java proxy to establish the http conection because this is a special http conection not allowed by the default HTTP Adapter (neither the SOAP adapter).
I understand what you say, we have done that, but inside the implementation function of the java proxy (the one in the file terminated in "_PortTypeImpl.java") we should use the "return" java function to return something. We want to "return" the content of the string variable that contains the returned xml formatted data from the http connection.
The question is: how should we return that info FROM the java proxy so we can use the already imported xsd in XI.
Thanks.
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.
Hi Mathias,
I donno the exact code. But wht u can do is create an object of type MT_Response and set this object with the value xmlResponse the one which u get from http. But if they r not compatible, then probably u hv to parse it and then u hv to set it and send it across. I hope this will resolve ur query.
Regards,
Akshay
To achive what you are trying, you need to modify the message type for the message interface from which you generate your Java proxy and have a data type like
<TOP>
<XML_STRUCT></XML_STRUCT>
</TOP>
regenerate the java proxy and then in your impl class set the xml that you recieve using MTResponse.setXML_STRUCT()
Still, you would need to write your parsing logic in the graphical mapping anyways..
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.