org.apache.axis.message.SOAPHeaderElement implements the SOAPHeaderElement
interface you mentioned.  This stuff all seems to have drastically changed
since the beta1 so if you are picking up nightly builds you will notice
this change.  So basically now you just need to create a new
SOAPHeaderElement and then call addHeader on SOAPEnvelope and pass it the
element.

Casey Swenson
[EMAIL PROTECTED]



                                                                                       
                                                
                      Andrew Vardeman                                                  
                                                
                      <andrewv@iastate.        To:       [EMAIL PROTECTED]      
                                                
                      edu>                     cc:                                     
                                                
                                               Subject:  RE: How do I add stuff to the 
headers                                         
                      04/23/2002 04:40                                                 
                                                
                      PM                                                               
                                                
                      Please respond to                                                
                                                
                      axis-user                                                        
                                                
                                                                                       
                                                
                                                                                       
                                                



Howdy.

I'm confused--all I see in the Axis (beta) Javadoc under
"SOAPHeaderElement" is an interface
(javax.xml.soap.SOAPHeaderElement).  How are you instantiating one?

Andrew


At 06:03 PM 4/22/2002 -0400, you wrote:
>Adam �
>
>Yes, you are correct:
>
>call.addHeader(new SOAPHeaderElement(namespace,"conversationId",value));
>
>Note, the header defined is a complex type, so you have to next
><conversationId> inside <StartHeader>, then add <StartHeader> to the
>Call object.
>
>For instance:
>
>         // <StartHeader xmlns="http://openuri.org/soap/conversation/";>
>         SOAPHeaderElement oEl = null;
>
>
>try {
>oEl = new
>SOAPHeaderElement("http://openuri.org/soap/conversation/","StartHeader";,
>null);
>oEl.addChildElement(new SOAPHeaderElement(null,"conversationID","151"));
>oEl.addChildElement(new
>SOAPHeaderElement(null,"defaultCallbackLocation","http://localhost:8081/
>axis/services/StateHeader"));
>       }
>         catch (javax.xml.soap.SOAPException e) {
>               e.printStackTrace();
>               throw new java.rmi.RemoteException();
>       }
>         call.addHeader(oEl);
>
>
>If you get the Axis/BEA conversation glue working, I'd love to see the
>sample code posted.....  I had issues getting it to work because Axis
>appends a default namespace, and BEA expects no namespace prefix.
>
>Is there any way to turn off the namespace prefixing when Axis generates
>XML???
>
>/Chris
>
>-----Original Message-----
>From: Adam Greene [mailto:[EMAIL PROTECTED]]
>Sent: Monday, April 22, 2002 5:59 PM
>To: [EMAIL PROTECTED]
>Subject: How do I add stuff to the headers
>
>I need to be able to add a value to the SOAP header called
>conversationID, so that I can get BEA to work with Apache AXIS, but I
>cannot figure out how to do that.  What must I do, I figure it has
>something to do with the addHeader method on the Call.








Reply via email to