axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Magnus Bergman <magnus.berg...@voiceprovider.com>
Subject send soap:headers with wsdl2java generated code
Date Thu, 22 Jun 2006 13:15:50 GMT
Hi,
I can see that this has been discussed earlier on this list but yet I 
have not found an answer.

Using Axis 1.4.

I'm trying to call a service which is expecting custom soap:headers. I'm 
generating code with wsdl2java from the attached wsdl. If I use the -a 
option with wsdl2java I get the header-type 
SoapAuthenticationHeader.java. I do not know what to do with this class. 
I was expecting that I could pass this object as a parameter to the 
service-method, someway like this:

//create the service
Permission2Soap permissionService =
  new Permission2Locator().getPermission2Soap();
//create the header object
SoapAuthenticationHeader authHeader =
   new SoapAuthenticationHeader();
//set attributes on the header object
authHeader.setUser("aUser");
authHeader.setPassword("xyz");
//call the method, pass on the header object
LoginUserData loginData =
  permissionService.loginUser("john","123", authHeader);

but no such method is generated.

So, how do I use the header-class so Axis will send it as a soap:header 
to the server???

Any help appreciated!
Regards,
Magnus



Mime
View raw message