• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic