cancel
Showing results for 
Search instead for 
Did you mean: 

add custom parameters to the soap header at receiver soap adapter

Former Member
0 Kudos

Hi,

I am using AddSOAPHeaderBean to include custom fields to the soap header. I have a requirement where I need to add attribute to the element as below,

<async expectReply="false" xmlns="http://schema.store"/>

here 'async' is element and 'expectReply' is attribute.

Can anybody let me know how to add attributes to the elements using AddSOAPHeaderBean.

Regards,

Rajesh

Accepted Solutions (1)

Accepted Solutions (1)

vadimklimov
Active Contributor
0 Kudos

Hi Rajesh,

Adapter module AddSOAPHeaderBean is used to add header elements, but not attributes for header elements.

If it is possible to slightly modify your requirement and set the element "async" as a nested header element, then this can be achieved as per example provided in Praveen's blog , case #2. The idea is to add custom header element and assign it a value, that contains declaration of nested elements within it. In this way, you can flexibly assign any relevant content including elements, attributes and values for them.

If an option above is not suitable, then you may want to consider usage of SOAP-Axis (and setting custom SOAP headers with attributes using corresponding Axis handler) instead of plain SOAP adapter.

Regards,

Vadim

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Vadim/Nissar/Mark,

Thanks for quick reply.

I have configured SOAP Axis as below,

and the output is as below,

I am almost close to my requirement but, there are addition attributes which are automatically getting added which i dont require.

soapenv:mustUnderstand="0" xmlns:ns1="http://www.solutions.crr.com/ROMS-1_2"

Any idea how to exclude the above addtional things added to the element.

Thanks,

Rajesh

nisarkhan_n
Active Contributor
0 Kudos

Hi Rajesh

my view is it should add attribute also, follow blog given by vadim, if we want to add any custom header there should not be any restriction on is it element or attribute.

try and let us know.

regards

Nisar

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Nisar,

To see if the AddSOAPHeaderBean supports this feature, it would have to be decompiled and the java code analyzed based on the steps mentioned here:

Not everyone has access to Telnet though. To save time, you can use SOAP Axis as suggested or a simple xslt mapping + Do Not Use SOAP Envelope in the receiver cc would work too.

Regards,

Mark

nisarkhan_n
Active Contributor
0 Kudos

Hi Mark,

if you see AddSOAPHeaderBean in the blog, it will add any element, my view is that it will also add element with attribute, it might not come as

<async expectReply="false" xmlns="http://schema.store"/>  in header


but till come with its own header element


<customheader>

<async expectReply="false" xmlns="http://schema.store"/>

</customheader>

on other hand SOAP AXIS should also work quicker and gives lot of flexibility.

regards

Nisar


vadimklimov
Active Contributor
0 Kudos

Hi Nisar, hi Nark,

Actually, I've already looked into implementation of AddSOAPHeaderBean before writing my previous reply. I have never used this module to add attributes, only to add header elements, so my first thought was, probably, there is some hidden module parameter or some way to instruct the module to insert attributes, but when I looked into module logic, I saw the module handles elements, their namespaces and values, but found nothing that would explicitly handle attributes. For your reference, below is an extract of the module logic, piece of code highlighted in red is responsible for retrieving module parameters and constructing custom headers based on module parameterization:

Regards,

Vadim

nisarkhan_n
Active Contributor
0 Kudos

Hi Vadim,

Point taken...thanks

regards

Nisar

Former Member
0 Kudos

Hi Vadim,

Thanks for quick reply.

I have configured SOAP Axis as below,

and the output is as below,

I am almost close to my requirement but, there are additional attribute which is automatically getting added and  i don not require.

soapenv:mustUnderstand="0"

Any idea how to remove the above attribute added to the element automatically.,

Thanks,

Rajesh