File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create SOAP headers

 
dale con
Ranch Hand
Posts: 93
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 43
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 93
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic