axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "WANG Chi" <Chi.W...@gemalto.com>
Subject RE: a problem when using wsimport to generate stubs from a Axis 1.4 server
Date Tue, 30 Jan 2007 02:58:02 GMT
Hi anne,

Thanks very much for your response. I'm a newbie of JAX-WS, I have changed from rpc/encoding
to rpc/literal, but still some errors, can you help me to solve it. thanks very much. here
is what I did,

I write an interface LogonManager:

public interface LogonManager {

	public String logon(String username, String password) throws DeniedAccessFault, ExpiredAccountFault,
ServiceBreakDownFault;
	
	public boolean logout(String sessionId);
	
	public CategoryBean[] getAccessRights(String sessionId, String[] categoryNames) throws DeniedAccessFault,
ServiceBreakDownFault;
}

public class CategoryBean implements Serializable {
	
	
	private String name;
	
	
	private boolean granted;
	
	
	public boolean isGranted() {
		return granted;
	}
	
	
	public void setGranted(boolean granted) {
		this.granted = granted;
	}
	
	
	public String getName() {
		return name;
	}
	
	
	public void setName(String name) {
		this.name = name;
	}
	
}

then I use JAVA2WSDL to generate the WSDL, here is the ant target
<axis-java2wsdl typemappingversion="1.2" style="RPC" classname="com.gemplus.ota.soap.logon.LogonManager"
location="${logon-url}" bindingname="LogonManagerSoapBinding" namespace="urn:logon.soap.ota.gemplus.com"
output="${wsdl.dir}/logonmanager.wsdl" use="LITERAL">
				<classpath refid="wsdl.classpath" />
</axis-java2wsdl>

in the above config, I use RPC/LITERAL

then I use the WSDL2JAVA to generate the server impl

<axis-wsdl2java typemappingversion="1.2" serverside="true" url="${wsdl.dir}/logonmanager.wsdl"
deployscope="Application" skeletondeploy="true" output="${sources.dir}">
				<mapping namespace="urn:logon.soap.ota.gemplus.com" package="com.gemplus.ota.soap.logon"
/>
</axis-wsdl2java>

then I deployed this service on Tomcat, and use wsimport to generate the stubs, but still
some errors

D:\test\jaxws-ri\bin>wsimport -extension http://localhost:8081/otasoap/services/LogonManager?wsdl

warning: src-resolve: Cannot resolve the name 'tns2:CategoryBean' to a(n) 'type definition'
component.
  line ? of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema2

error: in message "ServiceBreakDownFault", part "fault" must specify a "element" attribute



The following is the generated WSDL, 


<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:logon.soap.ota.gemplus.com" xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="urn:logon.soap.ota.gemplus.com" xmlns:intf="urn:logon.soap.ota.gemplus.com" xmlns:tns1="http://soap.ota.gemplus.com"
xmlns:tns2="http://bean.soap.ota.gemplus.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.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
 <wsdl:types>
  <schema targetNamespace="http://soap.ota.gemplus.com" xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://bean.soap.ota.gemplus.com"/>
   <import namespace="urn:logon.soap.ota.gemplus.com"/>
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="SoapFault">
    <sequence>
     <element name="errorCode" nillable="true" type="xsd:string"/>
     <element name="errorMessage" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <complexType name="ServiceBreakDownFault">
    <complexContent>
     <extension base="tns1:SoapFault">
      <sequence/>
     </extension>
    </complexContent>
   </complexType>
   <complexType name="DeniedAccessFault">
    <complexContent>
     <extension base="tns1:SoapFault">
      <sequence/>
     </extension>
    </complexContent>
   </complexType>
   <complexType name="ExpiredAccountFault">
    <complexContent>
     <extension base="tns1:SoapFault">
      <sequence/>
     </extension>
    </complexContent>
   </complexType>
  </schema>
  <schema targetNamespace="urn:logon.soap.ota.gemplus.com" xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://soap.ota.gemplus.com"/>
   <import namespace="http://bean.soap.ota.gemplus.com"/>
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="ArrayOf_xsd_string">
    <sequence>
     <element maxOccurs="unbounded" minOccurs="0" name="item" type="xsd:string"/>
    </sequence>
   </complexType>
   <complexType name="ArrayOf_tns2_CategoryBean">
    <sequence>
     <element maxOccurs="unbounded" minOccurs="0" name="item" type="tns2:CategoryBean"/>
    </sequence>
   </complexType>
  </schema>
  <schema targetNamespace="http://bean.soap.ota.gemplus.com" xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://soap.ota.gemplus.com"/>
   <import namespace="urn:logon.soap.ota.gemplus.com"/>
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="CategoryBean">
    <sequence>
     <element name="granted" type="xsd:boolean"/>
     <element name="name" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
  </schema>
 </wsdl:types>

   <wsdl:message name="getAccessRightsResponse">

      <wsdl:part name="getAccessRightsReturn" type="impl:ArrayOf_tns2_CategoryBean"/>

   </wsdl:message>

   <wsdl:message name="logoutResponse">

      <wsdl:part name="logoutReturn" type="xsd:boolean"/>

   </wsdl:message>

   <wsdl:message name="getAccessRightsRequest">

      <wsdl:part name="in0" type="xsd:string"/>

      <wsdl:part name="in1" type="impl:ArrayOf_xsd_string"/>

   </wsdl:message>

   <wsdl:message name="DeniedAccessFault">

      <wsdl:part name="fault" type="tns1:DeniedAccessFault"/>

   </wsdl:message>

   <wsdl:message name="logonRequest">

      <wsdl:part name="in0" type="xsd:string"/>

      <wsdl:part name="in1" type="xsd:string"/>

   </wsdl:message>

   <wsdl:message name="ExpiredAccountFault">

      <wsdl:part name="fault" type="tns1:ExpiredAccountFault"/>

   </wsdl:message>

   <wsdl:message name="logonResponse">

      <wsdl:part name="logonReturn" type="xsd:string"/>

   </wsdl:message>

   <wsdl:message name="ServiceBreakDownFault">

      <wsdl:part name="fault" type="tns1:ServiceBreakDownFault"/>

   </wsdl:message>

   <wsdl:message name="logoutRequest">

      <wsdl:part name="in0" type="xsd:string"/>

   </wsdl:message>

   <wsdl:portType name="LogonManager">

      <wsdl:operation name="logout" parameterOrder="in0">

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

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

      </wsdl:operation>

      <wsdl:operation name="logon" parameterOrder="in0 in1">

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

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

         <wsdl:fault message="impl:ServiceBreakDownFault" name="ServiceBreakDownFault"/>

         <wsdl:fault message="impl:DeniedAccessFault" name="DeniedAccessFault"/>

         <wsdl:fault message="impl:ExpiredAccountFault" name="ExpiredAccountFault"/>

      </wsdl:operation>

      <wsdl:operation name="getAccessRights" parameterOrder="in0 in1">

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

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

         <wsdl:fault message="impl:ServiceBreakDownFault" name="ServiceBreakDownFault"/>

         <wsdl:fault message="impl:DeniedAccessFault" name="DeniedAccessFault"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="LogonManagerSoapBinding" type="impl:LogonManager">

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

      <wsdl:operation name="logout">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="logoutRequest">

            <wsdlsoap:body namespace="urn:logon.soap.ota.gemplus.com" use="literal"/>

         </wsdl:input>

         <wsdl:output name="logoutResponse">

            <wsdlsoap:body namespace="urn:logon.soap.ota.gemplus.com" use="literal"/>

         </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="logon">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="logonRequest">

            <wsdlsoap:body namespace="urn:logon.soap.ota.gemplus.com" use="literal"/>

         </wsdl:input>

         <wsdl:output name="logonResponse">

            <wsdlsoap:body namespace="urn:logon.soap.ota.gemplus.com" use="literal"/>

         </wsdl:output>

         <wsdl:fault name="ServiceBreakDownFault">

            <wsdlsoap:fault name="ServiceBreakDownFault" use="literal"/>

         </wsdl:fault>

         <wsdl:fault name="DeniedAccessFault">

            <wsdlsoap:fault name="DeniedAccessFault" use="literal"/>

         </wsdl:fault>

         <wsdl:fault name="ExpiredAccountFault">

            <wsdlsoap:fault name="ExpiredAccountFault" use="literal"/>

         </wsdl:fault>

      </wsdl:operation>

      <wsdl:operation name="getAccessRights">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getAccessRightsRequest">

            <wsdlsoap:body namespace="urn:logon.soap.ota.gemplus.com" use="literal"/>

         </wsdl:input>

         <wsdl:output name="getAccessRightsResponse">

            <wsdlsoap:body namespace="urn:logon.soap.ota.gemplus.com" use="literal"/>

         </wsdl:output>

         <wsdl:fault name="ServiceBreakDownFault">

            <wsdlsoap:fault name="ServiceBreakDownFault" use="literal"/>

         </wsdl:fault>

         <wsdl:fault name="DeniedAccessFault">

            <wsdlsoap:fault name="DeniedAccessFault" use="literal"/>

         </wsdl:fault>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="LogonManagerService">

      <wsdl:port binding="impl:LogonManagerSoapBinding" name="LogonManager">

         <wsdlsoap:address location="http://localhost:8081/otasoap/services/LogonManager"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>



-----Original Message-----
From: Anne Thomas Manes [mailto:atmanes@gmail.com]
Sent: Monday, January 29, 2007 8:52 PM ?
To: axis-user@ws.apache.org
Subject: Re: a problem when using wsimport to generate stubs from a Axis 1.4 server


JAX-WS does not support RPC/encoded.

Anne

On 1/29/07, WANG Chi <Chi.WANG@gemalto.com> wrote:
> Hi all,
>
> I have a web service developed in Axis 1.4, and I want to use JAX-WS as the client, I
use wsimport to generate the stubs ,but the following errors occured, can someone help me?
thank you very much.
>
> D:\open source\jax-ws\jaxws-ri\bin> wsimport -d d:\test\test1 -s d:\test\test2 http://localhost:8081/otasoap/services/LogonManager?wsdl
>
> warning: src-resolve: Cannot resolve the name 'soapenc:Array' to a(n) 'type definition'
component.
>   line ? of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema2
> error: undefined simple or complex type 'soapenc:Array'
>   line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema2
> error: undefined attribute 'soapenc:arrayType'
>   line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema2
> error: undefined simple or complex type 'soapenc:Array'
>   line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema2
> error: undefined attribute 'soapenc:arrayType'
>   line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema2
> error: undefined simple or complex type 'soapenc:string'
>   line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema3
> error: undefined simple or complex type 'soapenc:string'
>   line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema1
> error: undefined simple or complex type 'soapenc:string'
>   line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema1
>
>
> The WSDL got from the Axis server is as following, I use RPC/ENCODING style.
>
>   <?xml version="1.0" encoding="UTF-8" ?>
> - <wsdl:definitions targetNamespace="urn:logon.soap.ota.gemplus.com" xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="urn:logon.soap.ota.gemplus.com" xmlns:intf="urn:logon.soap.ota.gemplus.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="http://soap.ota.gemplus.com" xmlns:tns2="http://bean.soap.ota.gemplus.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.4
> Built on Apr 22, 2006 (06:55:48 PDT)
>   -->
> - <wsdl:types>
> - <schema targetNamespace="http://soap.ota.gemplus.com" xmlns="http://www.w3.org/2001/XMLSchema">
>   <import namespace="http://bean.soap.ota.gemplus.com" />
>   <import namespace="urn:logon.soap.ota.gemplus.com" />
>   <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
> - <complexType name="SoapFault">
> - <sequence>
>   <element name="errorCode" nillable="true" type="soapenc:string" />
>   <element name="errorMessage" nillable="true" type="soapenc:string" />
>   </sequence>
>   </complexType>
> - <complexType name="ServiceBreakDownFault">
> - <complexContent>
> - <extension base="tns1:SoapFault">
>   <sequence />
>   </extension>
>   </complexContent>
>   </complexType>
> - <complexType name="DeniedAccessFault">
> - <complexContent>
> - <extension base="tns1:SoapFault">
>   <sequence />
>   </extension>
>   </complexContent>
>   </complexType>
> - <complexType name="ExpiredAccountFault">
> - <complexContent>
> - <extension base="tns1:SoapFault">
>   <sequence />
>   </extension>
>   </complexContent>
>   </complexType>
>   </schema>
> - <schema targetNamespace="urn:logon.soap.ota.gemplus.com" xmlns="http://www.w3.org/2001/XMLSchema">
>   <import namespace="http://soap.ota.gemplus.com" />
>   <import namespace="http://bean.soap.ota.gemplus.com" />
>   <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
> - <complexType name="ArrayOf_soapenc_string">
> - <complexContent>
> - <restriction base="soapenc:Array">
>   <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" />
>   </restriction>
>   </complexContent>
>   </complexType>
> - <complexType name="ArrayOf_tns2_CategoryBean">
> - <complexContent>
> - <restriction base="soapenc:Array">
>   <attribute ref="soapenc:arrayType" wsdl:arrayType="tns2:CategoryBean[]" />
>   </restriction>
>   </complexContent>
>   </complexType>
>   </schema>
> - <schema targetNamespace="http://bean.soap.ota.gemplus.com" xmlns="http://www.w3.org/2001/XMLSchema">
>   <import namespace="http://soap.ota.gemplus.com" />
>   <import namespace="urn:logon.soap.ota.gemplus.com" />
>   <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
> - <complexType name="CategoryBean">
> - <sequence>
>   <element name="granted" type="xsd:boolean" />
>   <element name="name" nillable="true" type="soapenc:string" />
>   </sequence>
>   </complexType>
>   </schema>
>   </wsdl:types>
> - <wsdl:message name="getAccessRightsResponse">
>   <wsdl:part name="getAccessRightsReturn" type="impl:ArrayOf_tns2_CategoryBean" />
>   </wsdl:message>
> - <wsdl:message name="logoutResponse">
>   <wsdl:part name="logoutReturn" type="xsd:boolean" />
>   </wsdl:message>
> - <wsdl:message name="getAccessRightsRequest">
>   <wsdl:part name="in0" type="soapenc:string" />
>   <wsdl:part name="in1" type="impl:ArrayOf_soapenc_string" />
>   </wsdl:message>
> - <wsdl:message name="DeniedAccessFault">
>   <wsdl:part name="fault" type="tns1:DeniedAccessFault" />
>   </wsdl:message>
> - <wsdl:message name="logonRequest">
>   <wsdl:part name="in0" type="soapenc:string" />
>   <wsdl:part name="in1" type="soapenc:string" />
>   </wsdl:message>
> - <wsdl:message name="ExpiredAccountFault">
>   <wsdl:part name="fault" type="tns1:ExpiredAccountFault" />
>   </wsdl:message>
> - <wsdl:message name="logonResponse">
>   <wsdl:part name="logonReturn" type="soapenc:string" />
>   </wsdl:message>
> - <wsdl:message name="ServiceBreakDownFault">
>   <wsdl:part name="fault" type="tns1:ServiceBreakDownFault" />
>   </wsdl:message>
> - <wsdl:message name="logoutRequest">
>   <wsdl:part name="in0" type="soapenc:string" />
>   </wsdl:message>
> - <wsdl:portType name="LogonManager">
> - <wsdl:operation name="logout" parameterOrder="in0">
>   <wsdl:input message="impl:logoutRequest" name="logoutRequest" />
>   <wsdl:output message="impl:logoutResponse" name="logoutResponse" />
>   </wsdl:operation>
> - <wsdl:operation name="logon" parameterOrder="in0 in1">
>   <wsdl:input message="impl:logonRequest" name="logonRequest" />
>   <wsdl:output message="impl:logonResponse" name="logonResponse" />
>   <wsdl:fault message="impl:ServiceBreakDownFault" name="ServiceBreakDownFault" />
>   <wsdl:fault message="impl:DeniedAccessFault" name="DeniedAccessFault" />
>   <wsdl:fault message="impl:ExpiredAccountFault" name="ExpiredAccountFault" />
>   </wsdl:operation>
> - <wsdl:operation name="getAccessRights" parameterOrder="in0 in1">
>   <wsdl:input message="impl:getAccessRightsRequest" name="getAccessRightsRequest"
/>
>   <wsdl:output message="impl:getAccessRightsResponse" name="getAccessRightsResponse"
/>
>   <wsdl:fault message="impl:ServiceBreakDownFault" name="ServiceBreakDownFault" />
>   <wsdl:fault message="impl:DeniedAccessFault" name="DeniedAccessFault" />
>   </wsdl:operation>
>   </wsdl:portType>
> - <wsdl:binding name="LogonManagerSoapBinding" type="impl:LogonManager">
>   <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
> - <wsdl:operation name="logout">
>   <wsdlsoap:operation soapAction="" />
> - <wsdl:input name="logoutRequest">
>   <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:logon.soap.ota.gemplus.com"
use="encoded" />
>   </wsdl:input>
> - <wsdl:output name="logoutResponse">
>   <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:logon.soap.ota.gemplus.com"
use="encoded" />
>   </wsdl:output>
>   </wsdl:operation>
> - <wsdl:operation name="logon">
>   <wsdlsoap:operation soapAction="" />
> - <wsdl:input name="logonRequest">
>   <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:logon.soap.ota.gemplus.com"
use="encoded" />
>   </wsdl:input>
> - <wsdl:output name="logonResponse">
>   <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:logon.soap.ota.gemplus.com"
use="encoded" />
>   </wsdl:output>
> - <wsdl:fault name="ServiceBreakDownFault">
>   <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="ServiceBreakDownFault"
namespace="urn:logon.soap.ota.gemplus.com" use="encoded" />
>   </wsdl:fault>
> - <wsdl:fault name="DeniedAccessFault">
>   <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="DeniedAccessFault"
namespace="urn:logon.soap.ota.gemplus.com" use="encoded" />
>   </wsdl:fault>
> - <wsdl:fault name="ExpiredAccountFault">
>   <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="ExpiredAccountFault"
namespace="urn:logon.soap.ota.gemplus.com" use="encoded" />
>   </wsdl:fault>
>   </wsdl:operation>
> - <wsdl:operation name="getAccessRights">
>   <wsdlsoap:operation soapAction="" />
> - <wsdl:input name="getAccessRightsRequest">
>   <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:logon.soap.ota.gemplus.com"
use="encoded" />
>   </wsdl:input>
> - <wsdl:output name="getAccessRightsResponse">
>   <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:logon.soap.ota.gemplus.com"
use="encoded" />
>   </wsdl:output>
> - <wsdl:fault name="ServiceBreakDownFault">
>   <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="ServiceBreakDownFault"
namespace="urn:logon.soap.ota.gemplus.com" use="encoded" />
>   </wsdl:fault>
> - <wsdl:fault name="DeniedAccessFault">
>   <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="DeniedAccessFault"
namespace="urn:logon.soap.ota.gemplus.com" use="encoded" />
>   </wsdl:fault>
>   </wsdl:operation>
>   </wsdl:binding>
> - <wsdl:service name="LogonManagerService">
> - <wsdl:port binding="impl:LogonManagerSoapBinding" name="LogonManager">
>   <wsdlsoap:address location="http://localhost:8081/otasoap/services/LogonManager"
/>
>   </wsdl:port>
>   </wsdl:service>
>   </wsdl:definitions>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message