on 11-03-2011 7:13 AM
Hi
I have Proxy Soap SYNC Scenario.
The request structure has 10 fields. For different combinations of the Source fields, the WEBSERVICE returns two kinds of responses.
Both are of different structures.
Please let me know how can I map both the responses back to the Same outbound message type belonging to the proxy.
Regards,
Yashwanth
Hello,
Please let me know how can I map both the responses back to the Same outbound message type belonging to the proxy.
Design your Proxy response message in a way that looks like this
Root
ResponseMessage1 0..1
ResponseMessageDetails1
ResponseMessage2 0..1
ResponseMessageDetails2
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
the outbound message type has fields for both the types of messages. But the problem is that the RESPONSE message is failing as there two structures coming in different cases.
i have configured one of the structure and it is running fine.
I am not getting how to incorpoate the second response structure in to the existing one.
I tried this :
I created an Intermediate messate type with both the message structures. Wrote a java map to remove the soap envelope and transform th incoming RESPONSE into the intermediate structure.
Then defined the message mapping from this intermediate structure to outbound structure.
I guess the java code is not working.
Below mentioned is the JAVA mapping code .
It is still not working.
-
String inData = sb.toString();
StringBuffer finalDoc = new StringBuffer();
String in1 = inData.replaceAll("<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">", " ");
in1 = in1.replaceAll("<soap:Body>", "");
in1 = in1.replaceAll("</soap:Body>", "");
in1 = in1.replaceAll("<soap:Fault>", "");
in1 = in1.replaceAll("</soap:Fault>", "");
in1 = in1.replaceAll("<soap:Envelope>", "");
in1 = in1.replaceAll("</soap:Envelope>", "");
int startidx = in1.indexOf("<Discovery_Result xmlns=\"https://www6.AustinTetra.com/AIT/WebServices\">");
int lastidx = in1.indexOf("</Discovery_Result>");
if ( startidx > -1){
finalDoc.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
finalDoc.append("<ns0:MT_Discovery_Intermediate_Response xmlns:ns0=\"http://applied.com/I1089/3rdPartyCreditInterface_To_Equifax\">");
finalDoc.append(in1.substring(startidx,(lastidx + 19)));
finalDoc.append("</ns0:MT_Discovery_Intermediate_Response>");
}else {
finalDoc.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
finalDoc.append("<ns0:MT_Discovery_Intermediate_Response xmlns:ns0=\"http://applied.com/I1089/3rdPartyCreditInterface_To_Equifax\">");
finalDoc.append(in1);
finalDoc.append("</ns0:MT_Discovery_Intermediate_Response>");
}
out.write(finalDoc.toString().trim().getBytes());
out.close();
-
Edited by: YashwanthSVK on Nov 3, 2011 2:06 PM
Hello,
When you test the Operation Mapping by loading the Output SOAP Envelope, what is the error that you are getting?
I would still go for this approach
Root
ResponseMessage1 0..1
ResponseMessageDetails1
ResponseMessage2 0..1
ResponseMessageDetails2
Now, after you remove the SOAP Envelope, just do an append to the RootMessage and it will be okay since either occurrence is 0..1. Also this can be omitted
finalDoc.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
Hope this helps,
Mark
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.