aspose file tools*
The moose likes Web Services and the fly likes [axis1]how to remove the Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "[axis1]how to remove the "mustUnderstand"&"actor" attributes from the SOAPHeader in the client code?" Watch "[axis1]how to remove the "mustUnderstand"&"actor" attributes from the SOAPHeader in the client code?" New topic
Author

[axis1]how to remove the "mustUnderstand"&"actor" attributes from the SOAPHeader in the client code?

Jacqueline Greiss
Greenhorn

Joined: Nov 30, 2012
Posts: 2
Hi,

I try to add a header in my java client using "SOAPHeaderElement" like below:


SOAPHeaderElement header = new SOAPHeaderElement(
"uri", "headerName");

((Stub)port).setHeader(header);


The issue is that the created "SOAPHeader" has unneeded attributes "mustUnderstand" and "actor" which the schema can't parse. I need to fix this in my client as it's not possible to update the schema...

<soapenv:Header>
<ns1:headerName soapenv:actor="" soapenv:mustUnderstand="0" xmlns:ns1="uri">
...........
</ns1:headerName>
</soapenv:Header>

Thanks!
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 641
not 100% sure but did you try setting it to null in your code or if there is removeHeader method like setHeader in port?


All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Jacqueline Greiss
Greenhorn

Joined: Nov 30, 2012
Posts: 2
Thanks a lot for you reply

I tried but it didn't have any effect at all.

I found another good solution though, I extended SOAPHeaderElement class, and override its outputImpl(SerializationContext context) method, then used document builder to build my XML header element, at the end I call this context.writeDOMElement(elem);

And it works!

Regards.
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 641
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [axis1]how to remove the "mustUnderstand"&"actor" attributes from the SOAPHeader in the client code?