I have defined a service as below in my wsdd file.

<service name="MyService" provider="java:RPC" style="wrapped" use="literal">
        <parameter name="className" value=" com.ext.portlet.mr.service.xbreeze.MyServiceSoap"/>
        <operation xmlns:operNS="urn:myservice.service.mr.portlet.ext.com" xmlns:rtns=" http://www.w3.org/2001/XMLSchema" name="addUser" qname="operNS:addUser" returnQName="operNS:addUserReturn" returnType="rtns:string" soapAction="">
            <parameter xmlns:tns="http://www.w3.org/2001/XMLSchema" qname="domainUserId" type="tns:string"></parameter>
            <parameter inHeader="true" xmlns:tns=" http://www.w3.org/2001/XMLSchema" qname="password" type="tns:string"></parameter>
        </operation>
        <parameter name="allowedMethods" value="addUser"/>
    </service>


I have defined the parameter "password" to be in soap header and not in body.

Since i do not expect the header parameter in my Service class so i defined the service class as

public class MyServiceSoap {
     public static String addUser(String domainUserId)
            throws RemoteException {
        return domainUserId;
    }
}

If i deploy this i and try and view the wsdl i get axis error. Instead if I define it as below there is no error.

public class MyServiceSoap {
     public static String addUser(String domainUserId, String password)
            throws RemoteException {
        return domainUserId;
    }
}

My requirement is that this header parameter need not be declared in the method call as i want it be a similar to what i have coded in the impl class

please let me know if i am doing it wrong.

wsdl is also attached.

-jai
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://localhost:8080/services/MyService"; xmlns:apachesoap="http://xml.apache.org/xml-soap"; xmlns:impl="http://localhost:8080/services/MyService"; xmlns:intf="http://localhost:8080/services/MyService"; xmlns:tns1="urn:myservice.service.mr.portlet.ext.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
<!--WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->
 <wsdl:types>
  <schema elementFormDefault="qualified" targetNamespace="http://localhost:8080/services/MyService"; xmlns="http://www.w3.org/2001/XMLSchema";>
   <element name="password" type="xsd:string"/>
  </schema>
  <schema elementFormDefault="qualified" targetNamespace="urn:myservice.service.mr.portlet.ext.com" xmlns="http://www.w3.org/2001/XMLSchema";>
   <element name="addUser">
    <complexType>
     <sequence>
      <element name="domainUserId" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="addUserResponse">
    <complexType>
     <sequence>
      <element name="addUserReturn" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
  </schema>
 </wsdl:types>

   <wsdl:message name="addUserRequest">

      <wsdl:part element="impl:password" name="password"/>

      <wsdl:part element="tns1:addUser" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="addUserResponse">

      <wsdl:part element="tns1:addUserResponse" name="parameters"/>

   </wsdl:message>

   <wsdl:portType name="MyServiceSoap">

      <wsdl:operation name="addUser">

         <wsdl:input message="impl:addUserRequest" name="addUserRequest"/>

         <wsdl:output message="impl:addUserResponse" name="addUserResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="MyServiceSoapBinding" type="impl:MyServiceSoap">

      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="addUser">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="addUserRequest">

            <wsdlsoap:body parts="parameters" use="literal"/>

            <wsdlsoap:header message="impl:addUserRequest" namespace="http://localhost:8080/services/MyService"; part="password" use="literal">

            </wsdlsoap:header>

         </wsdl:input>

         <wsdl:output name="addUserResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="MyServiceSoapService">

      <wsdl:port binding="impl:MyServiceSoapBinding" name="MyService">

         <wsdlsoap:address location="http://localhost:8080/services/MyService"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to