Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom Soap Header (org.apache.axis.message.SOAPHeaderElement)  RSS feed

 
Caden Whitaker
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used eclipse's built in wsdl-to-code generator to build out my java classes. Unfortunatley it doesn't look like it added the custom soap header.

This is the header:



This is the code I put in:



On a high level, does that look correct? I wasn't sure about the SOAPHeaderElement constructor as I'm not sure what to put in as the namespace
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Caden Whitaker wrote:I wasn't sure about the SOAPHeaderElement constructor as I'm not sure what to put in as the namespace

That is the correct namespace according to your example but as far as I can tell you will still need a
header.addNamespaceDeclaration("", "http://www.domain.com/data/");
to declare the default namespace for the header (and its child elements).

You can use Apache TCPMon (Tutorial) or java.net tcpmon to capture/view the HTTP/SOAP request/response pairs and determine if you are achieving the desired effect.

Ronald Bourret's XML Namespaces FAQ
James Clark: XML Namespaces
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!