on 12-11-2014 10:09 AM
Hi Experts,
I am trying to develop a java mapping to access the SOAP envelope of the target message to place the source message values dynamically in the SOAP header.
First of all i want to conform is it possible to perform above task?
If it is possible then, how it can be done?
Any help from your end is really appreciable.Thank you very much in advance.
Regards,
Avinash.
We can access a few fixed elements of input SOAP envelope. Link. Only one element in output SOAP evelope. Link.
But if input to PI is SOAP message, I think, we can try below solution.
Please check this blog, How to Read SOAP Header Information. Read comments at the end of blog.
As a POC, create a SOAP -> PI -> File scenario. Make sure sender channel and service interface are as defined according to blog (MT can be any 1-2 elements). Do not select any operational mapping in interface determination (this will be pass-through scenario).
Get the WSDL link from sender agreement and test the scenario from SOAPUI. You should be able to see entire SOAP message (with envelope) in target folder.
If above POC is successful. You can create Java Mapping to handle entire SOAP message, even SOAP header (after all SOAP is an XML).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghu,
Thanks for your suggestion it was really helpfull.
But i have worked with the How to Read SOAP Header Information using that i am able to do asynchronous scenario from SOAP to File but it is not working for Synchronous scenario.
I haven't tried the java yet i will check it once and reply you back.
Regards,
Avinash
Avinash,
It's good to know that POC (SOAP -> PI -> File) worked. You are able to see entire SOAP message (SOAP Envelope in it Header and Body) in target file.
Is your scenario
SOAP <-> PI <-> SOAP?
For synchronous scenario. You know, we need request message mapping and response message mapping. As you can see, SOAP Envelope has multiple namespaces, so you cannot use Graphical Mapping (it is difficult). Use Java Mapping.
First solve request and then response. Develop Java request message mapping, do not select response message mapping in Interface determination (let response be pass-through, for now). Test the synchronous scenario using SOAPUI, check payload at each step.
If it is fine then develop Java response message mapping. Test using SOAPUI.
Hi Raghu,
Thank for your response .
Yes for me SOAP to File worked i am getting whole SOAP body along with header in payload
but for SOAP to SOAP synchronous scenario i am getting error in SOAP UI it is not accepting SOAP message it is accepting only XML message and getting response in XML message in SOAP UI.
Is there any java mapping or java functionality to access the SOAP envolope or any other process.
Regards,
Avinash
Sync scenario.
Sender (1st SOAP message) -> PI -> (2nd SOAP message) Receiver
Sender (4th SOAP message) <- PI <- (3rd SOAP message) Receiver
Getting '2nd SOAP message' and '3rd SOAP message' for sync scenario: -
Create a new SOAPUI project 'FirstProject'. Directly connect to Receiver using SOAPUI (using receiver WSDL) and get '2nd SOAP message' (left side of SOAPUI) and '3rd SOAP message' (right side of SOAPUI).
Paste both '2nd and 3rd SOAP messages' in the discussion (I will have a look and guide you).
Hi Avinash,
Another alternative is to do via XSL mapping. You can do it easily like this thread explains:
Also, you can develop your XSL without install anything in your laptop, you can test via online XSLT Transformation - Online Toolz
Hope this helps.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Diptee,
As you said i am able to add the value to soap header using the AddSOAPHeaderBean module in sender adapter but here i am able to add the value statically only but i want the value to be added dynamically.
For performing this i am thinking to use the custom bean to access the payload value dynamically and send the value as input to AddSOAPHeaderBean module can this be done?
Regards,
Avinash
Hello Avinash,
Yes, it is possible with Java mapping. Refer to the blog for details
BR,
Diptee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.