java通过axis2调用PBwebserver出错(加急)

云端月空 发布于 2010/11/22 15:04
阅读 1K+
收藏 1

我用wsdl2java把wsdl文件生成java代码怎么出错

C:\>WSDL2Java -uri c:\n_extendcomponent.wsdl   -a
Using AXIS2_HOME:   C:\Program Files\Apache Software Foundation\axis2-1.5
Using JAVA_HOME:    C:\Program Files\Java\jre6
Retrieving document at 'c:\n_extendcomponent.wsdl'.
[ERROR] Part 'fault' of fault message '{http://ExtendCompnoentPB115}PBUserExcept
ion' must be defined with 'element=QName' and not 'type=QName'
[ERROR] Part 'fault' of fault message '{http://ExtendCompnoentPB115}PBUserExcept
ion' must be defined with 'element=QName' and not 'type=QName'
org.apache.axis2.AxisFault: Part 'fault' of fault message '{http://ExtendCompnoe
ntPB115}PBUserException' must be defined with 'element=QName' and not 'type=QNam
e'
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.addQNameRefer
ence(WSDL11ToAxisServiceBuilder.java:1246)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateBindi
ng(WSDL11ToAxisServiceBuilder.java:777)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
int(WSDL11ToAxisServiceBuilder.java:537)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
ints(WSDL11ToAxisServiceBuilder.java:488)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:362)
        at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateA

wsdl文件如下

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://ExtendCompnoentPB115" xmlns:impl="http://ExtendCompnoentPB115" xmlns:intf="http://ExtendCompnoentPB115" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns2="http://CORBA.omg.org" xmlns:tns1="http://CTS" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<!--WSDL created by Apache Axis version: 1.2
Built on Aug 08, 2006 (12:25:53 PDT)-->
 <wsdl:types>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://CORBA.omg.org">
   <import namespace="http://CTS"/>
   <import namespace="http://ExtendCompnoentPB115"/>
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType abstract="true" name="UserException">
    <sequence/>
   </complexType>
  </schema>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://CTS">
   <import namespace="http://ExtendCompnoentPB115"/>
   <import namespace="http://CORBA.omg.org"/>
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="PBUserException">
    <complexContent>
     <extension base="tns2:UserException">
      <sequence>
       <element name="message" nillable="true" type="xsd:string"/>
      </sequence>
     </extension>
    </complexContent>
   </complexType>
  </schema>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ExtendCompnoentPB115">
   <import namespace="http://CTS"/>
   <import namespace="http://CORBA.omg.org"/>
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="ArrayOf_xsd_string">
    <complexContent>
     <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
     </restriction>
    </complexContent>
   </complexType>
  </schema>
 </wsdl:types>

   <wsdl:message name="of_sendsvrsmsResponse">

      <wsdl:part name="of_sendsvrsmsReturn" type="xsd:short"/>

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

   </wsdl:message>

   <wsdl:message name="of_sendsvrsmsRequest">

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

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

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

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

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

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

   </wsdl:message>

   <wsdl:message name="PBUserException">

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

   </wsdl:message>

   <wsdl:message name="of_getsmsparmRequest">

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

   </wsdl:message>

   <wsdl:message name="of_getsmsparmResponse">

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

   </wsdl:message>

   <wsdl:portType name="n_extendcomponent">

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

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

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

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

      </wsdl:operation>

      <wsdl:operation name="of_sendsvrsms" parameterOrder="in0 in1 in2 in3 in4 in5">

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

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

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

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="n_extendcomponent" type="impl:n_extendcomponent">

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

      <wsdl:operation name="of_getsmsparm">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="of_getsmsparmRequest">

            <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ExtendCompnoentPB115"/>

         </wsdl:input>

         <wsdl:output name="of_getsmsparmResponse">

            <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ExtendCompnoentPB115"/>

         </wsdl:output>

         <wsdl:fault name="PBUserException">

            <wsdlsoap:fault name="PBUserException" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ExtendCompnoentPB115"/>

         </wsdl:fault>

      </wsdl:operation>

      <wsdl:operation name="of_sendsvrsms">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="of_sendsvrsmsRequest">

            <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ExtendCompnoentPB115"/>

         </wsdl:input>

         <wsdl:output name="of_sendsvrsmsResponse">

            <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ExtendCompnoentPB115"/>

         </wsdl:output>

         <wsdl:fault name="PBUserException">

            <wsdlsoap:fault name="PBUserException" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ExtendCompnoentPB115"/>

         </wsdl:fault>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="n_extendcomponentService">

      <wsdl:port name="n_extendcomponent" binding="impl:n_extendcomponent">

         <wsdlsoap:address location="http://192.168.2.29:8080/ws/services/n_extendcomponent"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>

 

 

 

 

加载中
0
稻草鸟人
稻草鸟人
这个问题解决了么?
返回顶部
顶部