axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Edwardson" <>
Subject Re: Soap Header headaches
Date Tue, 29 Apr 2003 21:52:23 GMT
Thanks Phil, when I get my custom Handler to actually get invoked, this code will be most usefull.
  ----- Original Message ----- 
  From: Phil Bohnenkamp 
  To: '' 
  Sent: Tuesday, April 29, 2003 11:55 PM
  Subject: RE: Soap Header headaches


  Here is a little code that I know works for me, maybe it will help get you started...

      // The add header method needs a DOM Element so make
      // the contents of the cp_soap_header element as a string
      // and make it into an element
      DocumentBuilderFactory factory = 
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document doc = builder.parse(new InputSource(new StringReader(
      SOAPHeaderElement hElement = new SOAPHeaderElement(


  To get the header (this is in a custom handler ...)

      // This is the request so grab the objecy from the header
      Iterator it = msgContext.getMessage().getSOAPPart().

       idHeader = (SOAPHeaderElement);
       try {
       } catch (Exception e) {
              // do something with the exception

  Hope this helps,


  Phillip Bohnenkamp
  Engagement Engineer
  200 W. Monroe St.
  Suite 1400
  Chicago, IL 60606

    -----Original Message-----
    From: Larry Edwardson []
    Sent: Monday, April 28, 2003 5:45 PM
    To: Axis-user
    Subject: Soap Header headaches

    Does anyone have an example of using soap headers, I have been trying for a few days now
to access the headers on the service side with no luck, firstly I tried to gain access to
the MessageContext which comes back as null ? I have also tried writing my own handler but
with no success, I am just about to scream, surely it cant be that hard, all I need to do
is send a username and password and authorise the user.

    Any response will be gladely appreciated.

    Cheers Larry
View raw message