This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes Create SOAP headers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Create SOAP headers" Watch "Create SOAP headers" New topic
Author

Create SOAP headers

dale con
Ranch Hand

Joined: Apr 15, 2005
Posts: 93
Can someone please show me how to do this ?

Is it along the lines of

SOAPEnvelope envelope = message.getSOAPEnvelope();
SOAPHeaderElement element = envelope.addHeader("myHeaderNAme");

But I don't know how to put stuff into it and take stuff out

Thanks for any help
milan doshi
Ranch Hand

Joined: Nov 03, 2000
Posts: 43
Hi,

I think this will depend upon the tool that you are using.

Assuming that you are using Axis (most commonly used ), when we do wsdl2java of the wsdl, the client stub is ALSO generated (org.apache.axis.client.Stub).

This stub has methods like:

setHeader(SOAPHeaderElement),
setHeader(String,String,Object).


Similarly , there are methods like getHeader(..) etc.

Refer Axis API.

Thanks,
Milan Doshi
dale con
Ranch Hand

Joined: Apr 15, 2005
Posts: 93
Hello, I thinmkl i'm missing soemthing - well i must be think cos i'm not understanding this

i think i'm barking up the wrong tree - surely it can't be this hard !!!

Most of the code i'm writing at the moment is server-side, so i haven't done any of the wsdlxml etc.. files yet

If my client creates a header and goes off to my server-side to do validation stuff, how do i return a string from my server-side to the client header ???

And then when the clinet has a vlaue in the header how to i then take that value and return it to the server-side so it cancheck the value??

what is the best way for my client to talk to my server-side code and visa versa ???

Thanks for any help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Create SOAP headers
 
Similar Threads
WA #1.....word association
What tools do page designers use for JSP?
throwing exceptions
2 or more servlet sharing data
How to identify some english word is number