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


<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:s="http://www.w3.org/2001/XMLSchema"; xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:tns="http://www.ahost.se/Permission/Permission2"; xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"; xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; targetNamespace="http://www.ahost.se/Permission/Permission2"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
  <wsdl:types>
    <s:schema targetNamespace="http://www.ahost.se/Permission/Permission2";>
      <s:complexType name="LoginUserData">
        <s:sequence>
          <s:element minOccurs="1" maxOccurs="1" name="SessionId" type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="PersonId" type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="HomeOrganizationUnitId" type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="HomeOrganizationUnitName" type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="HomeDistrictId" type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="Status" type="s:int" />
          <s:element minOccurs="1" maxOccurs="1" name="PersonName" type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="UserName" type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="FirstLogin" type="s:boolean" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="SoapAuthenticationHeader">
        <s:sequence>
          <s:element minOccurs="1" maxOccurs="1" name="user" type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="password" type="s:string" />
        </s:sequence>
      </s:complexType>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="LoginUserSoapIn">
    <wsdl:part name="username" type="s:string" />
    <wsdl:part name="password" type="s:string" />
  </wsdl:message>
  <wsdl:message name="LoginUserSoapOut">
    <wsdl:part name="LoginUserResult" type="tns:LoginUserData" />
  </wsdl:message>
  <wsdl:message name="LoginUserSoapAuthenticationHeader">
    <wsdl:part name="SoapAuthenticationHeader" type="tns:SoapAuthenticationHeader" />
  </wsdl:message>
  <wsdl:message name="GetNewPasswordUserSoapIn">
    <wsdl:part name="username" type="s:string" />
    <wsdl:part name="emailAddress" type="s:string" />
  </wsdl:message>
  <wsdl:message name="GetNewPasswordUserSoapOut" />
  <wsdl:message name="GetNewPasswordUserSoapAuthenticationHeader">
    <wsdl:part name="SoapAuthenticationHeader" type="tns:SoapAuthenticationHeader" />
  </wsdl:message>
  <wsdl:message name="LogoutUserSoapIn">
    <wsdl:part name="username" type="s:string" />
  </wsdl:message>
  <wsdl:message name="LogoutUserSoapOut" />
  <wsdl:message name="LogoutUserSoapAuthenticationHeader">
    <wsdl:part name="SoapAuthenticationHeader" type="tns:SoapAuthenticationHeader" />
  </wsdl:message>
  <wsdl:message name="ChangePasswordSoapIn">
    <wsdl:part name="username" type="s:string" />
    <wsdl:part name="oldPassword" type="s:string" />
    <wsdl:part name="newPassword" type="s:string" />
  </wsdl:message>
  <wsdl:message name="ChangePasswordSoapOut" />
  <wsdl:message name="ChangePasswordSoapAuthenticationHeader">
    <wsdl:part name="SoapAuthenticationHeader" type="tns:SoapAuthenticationHeader" />
  </wsdl:message>
  <wsdl:portType name="Permission2Soap">
    <wsdl:operation name="LoginUser">
      <wsdl:input message="tns:LoginUserSoapIn" />
      <wsdl:output message="tns:LoginUserSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="GetNewPasswordUser">
      <wsdl:input message="tns:GetNewPasswordUserSoapIn" />
      <wsdl:output message="tns:GetNewPasswordUserSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="LogoutUser">
      <wsdl:input message="tns:LogoutUserSoapIn" />
      <wsdl:output message="tns:LogoutUserSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="ChangePassword">
      <wsdl:input message="tns:ChangePasswordSoapIn" />
      <wsdl:output message="tns:ChangePasswordSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="Permission2Soap" type="tns:Permission2Soap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; style="rpc" />
    <wsdl:operation name="LoginUser">
      <soap:operation soapAction="http://www.ahost.se/Permission/Permission2/LoginUser"; style="rpc" />
      <wsdl:input>
        <soap:body use="encoded" namespace="http://www.ahost.se/Permission/Permission2"; encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
        <soap:header message="tns:LoginUserSoapAuthenticationHeader" part="SoapAuthenticationHeader" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="encoded" namespace="http://www.ahost.se/Permission/Permission2"; encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetNewPasswordUser">
      <soap:operation soapAction="http://www.ahost.se/Permission/Permission2/GetNewPasswordUser"; style="rpc" />
      <wsdl:input>
        <soap:body use="encoded" namespace="http://www.ahost.se/Permission/Permission2"; encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
        <soap:header message="tns:GetNewPasswordUserSoapAuthenticationHeader" part="SoapAuthenticationHeader" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="encoded" namespace="http://www.ahost.se/Permission/Permission2"; encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="LogoutUser">
      <soap:operation soapAction="http://www.ahost.se/Permission/Permission2/LogoutUser"; style="rpc" />
      <wsdl:input>
        <soap:body use="encoded" namespace="http://www.ahost.se/Permission/Permission2"; encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
        <soap:header message="tns:LogoutUserSoapAuthenticationHeader" part="SoapAuthenticationHeader" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="encoded" namespace="http://www.ahost.se/Permission/Permission2"; encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="ChangePassword">
      <soap:operation soapAction="http://www.ahost.se/Permission/Permission2/ChangePassword"; style="rpc" />
      <wsdl:input>
        <soap:body use="encoded" namespace="http://www.ahost.se/Permission/Permission2"; encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
        <soap:header message="tns:ChangePasswordSoapAuthenticationHeader" part="SoapAuthenticationHeader" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="encoded" namespace="http://www.ahost.se/Permission/Permission2"; encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="Permission2">
    <wsdl:port name="Permission2Soap" binding="tns:Permission2Soap">
      <soap:address location="http://www.ahost.se/WSAPI/Ver_2/Permission/Permission2.asmx"; />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to