on 04-20-2016 7:44 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.