cancel
Showing results for 
Search instead for 
Did you mean: 

Insert SOAP Header custom elements in SOAP Receiver Adapter

arismendila
Explorer
0 Kudos

Hi,

I am trying to insert custom elements in the SOAP Header of a message over SOAP Receiver Adapter.

I am able to insert it using this procedure:

Where first Parameter Name is like "MyElement" and Parameter Value is like "<nso:MySubElement>value</nso:MySubElement>", and namespace is some particular.

Using an UDF in a message mapping I can put in XHeaderName1, of SOAP ASMA, the correct value dynamically. My need is to change/replace the value of the custom element fixed value (red square) with value passed by DynamicConfiguration (blue square).

I think I could use a custom module created in java, but I need to know if there are another alternatives to do it. I was thinking in an alternative using a XSLT mapping or if it's possible using another UDF, java library on UDF or something like that.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

apu_das2
Active Contributor
0 Kudos

Hi Leonardo,

No need to go for custom module. you can easily do it using Java mapping. Use multi mapping in your OM. Complete your Graphical Mapping to create soap body. Then use Java mapping . Use InputStream to take value from the Graphical MM and create complete Soap message in Java mapping including your custom soap envelop.

Follow this url. This one is for sales force integration but you can modify this as per your requirement -

SFDC Integration using PI 7.1 - How to add SOAP Envelope in Java Mapping - Process Integration - SCN...

Thanks,

Apu

arismendila
Explorer
0 Kudos

Hi Apu,

I was trying to avoid to build my own SOAP envelope replacing the standard, but maybe it would be the most appropiate solution.

Thanks,

Leonardo.

arismendila
Explorer
0 Kudos

Hi Apu,

Finally I didn't create a custom module neither java mapping to solve my problem.

I have created a XSLT mapping in order to create the SOAP Envelope, and I have used a payload field to put the token separated by a pipe, then on XSLT mapping have put corresponding values on their fields.

And, because is a synchronous service, I have needed to create another XSLT mapping to remove SOAP Envelope of response message.

I have used a XSLT mapping and not a Java mapping due to the message is really small and just have was used to map a field on header.

Anyway, your proposal solution will help me in other issue.

Thanks a lot.

apu_das2
Active Contributor
0 Kudos

Hi Leonardo,

Its great to hear that your problem is resolved.

Custom SOAP envelop creation using java mapping/XSLT is basically a very old topic in PI. I always prefer java mapping instead for XSLT as XSLT is a bit memory consuming and load the whole structure in memory at the time of processing.

Can you paste some screen shot of your input payload, your mapping and output with request and response message so that it can help others.

Thanks,

Apu

arismendila
Explorer
0 Kudos

I have used XLST mapping due to simply way to create a SOAP Envelope and mainly because payload is too short and not complex.

Next there are screenshots of my sender payload, XSLT mapping and result.

Original payload of sender (name is empty and automatically removed from payload, but message mapping put in again with a trim function):

Message mapping:

Payload transformed by message mapping (over name field concatenate original name content plus token):

Payload transformed by XLST mapping:

Answers (0)