axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TMG <...@nc.rr.com>
Subject Re: Using Headers Client Side
Date Mon, 31 Jan 2005 19:15:10 GMT
Mike,

Without seeing the wsdl, I can only speculate as to how it was 
implemented.  That said, normally the first argument is the header 
object with the stub, and the generated code moves it to the proper 
place in the soap messages.

For example, using a stub:
   MyLocatorServiceLocator locator = new MyLocatorServiceLocator();
   MyLocator service = locator.getMyLocator();
   "Some Result Type" result = service."someMethod"(firstArg, secondArg);

The firstArg would be the header, and secondArg would be the body.

Tom Gordon

note: I could tell you exactly how it would work if you posted your wsdl.

M Litherland wrote:

> Hi all,
>
> I'm new to Axis and I am trying to create a SOAP client to communicate 
> with a vendor.  They have supplied me with the WSDL and I ran 
> WSDL2Java against it to create my stubs.  There are custom headers, so 
> I specified the '-a' option for WSDL2Java to produce a stub for the 
> custom header as well.
>
> My problem is that I don't know what to do with this custom header.  I 
> can create the object and populate it as need be, but how do I tell my 
> code to use that header?  The code is very simple - essentially these 
> three lines:
>
> MySoapLocator msl = new MySoapLocator();
> MySoap ms = msl.getMySoap(new java.net.URL(URL));
> ms.send(message);
>
> I would expect to be able to do something like this:
>
> ms.setHeader(myHeaderObject);
>
> Before I perform the send.  I have a feeling I am just thinking about 
> the problem in the wrong way.  Is there anybody on the list willing to 
> enlighten me?
>
> Thanks a bunch,
> Mike
>


Mime
View raw message