我在Eclipse中使用Axis生成了一个Web服务客户端。但得到了这个错误:
IWAB0399E Error in generating Java from WSDL: java.io.IOException: <input ..>, <output ..> or <fault ..> in <portType> with undefined message found. message name is '{http://schemas.xmlsoap.org/wsdl/}insertPurchaseRequest
WSDL是:
<definitions xmlns:tns="urn:WebServices11" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" name="WebServices11" targetNamespace="urn:WebServices11">
<types>
<xsd:schema xmlns="http://www.w3.org/2000/10/XMLSchema" targetNamespace="urn:WebServices11">
<xsd:element name="insertPurchaseRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="transaction_reference_id" type="xsd:integer"/>
<xsd:element name="amount" type="xsd:float"/>
<xsd:element name="reference_number" type="xsd:string"/>
<xsd:element name="reference_number" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="insertPurchaseResponse">
<xsd:complexType>
<xsd:all>
<xsd:element name="return" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:element name="selectPurchaseRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="transaction_reference_id" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="selectPurchaseResponse">
<xsd:complexType>
<xsd:complexContent>
<xsd:restriction base="soapenc:Array">
<xsd:attribute ref="soapenc:arrayType" arrayType="tns:objPurchase[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
<message name="insertPurchaseRequest">
<part name="transaction_reference_id" type="xsd:integer"/>
<part name="amount" type="xsd:float"/>
<part name="reference_number" type="xsd:string"/>
<part name="reference_number" type="xsd:string"/>
</message>
<message name="insertPurchaseResponse">
<part name="return" type="xsd:string"/>
</message>
<message name="selectPurchaseRequest">
<part name="transaction_reference_id" type="xsd:integer"/>
</message>
<message name="selectPurchaseResponse">
<part name="return" type="tns:objPurchase"/>
</message>
<portType name="WebServices11PortType">
<operation name="insertPurchase">
<documentation>Add the Purchase record</documentation>
<input message="insertPurchaseRequest"/>
<output message="insertPurchaseResponse"/>
</operation>
<operation name="selectPurchase">
<documentation>Get the Purchase record</documentation>
<input message="selectPurchaseRequest"/>
<output message="selectPurchaseResponse"/>
</operation>
</portType>
<binding name="WebServices11SoapBinding" type="tns:WebServices11PortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="insertPurchase">
<soap:operation soapAction="urn:WebServices11InsertPurchaseAction"/>
<input>
<soap:body use="encoded" namespace="urn:WebServices11" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:WebServices11" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="selectPurchase">
<soap:operation soapAction="urn:WebServices11selectPurchaseAction"/>
<input>
<soap:body use="encoded" namespace="urn:WebServices11" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:WebServices11" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="WebServices11Service">
<port name="WebServices11Port" binding="tns:WebServices11SoapBinding">
<soap:address location="http://www.emdad-rayaneh.com/WebService/Soap_WebService_emdadpc2/purchase_server.php"/>
</port>
</service>
</definitions>
请帮忙!
答案 0 :(得分:1)
尝试添加&#39; tns:&#39; info to portType wsdl
你会发现其他错误的东西<portType name="WebServices11PortType">
<operation name="insertPurchase">
<documentation>Add the Purchase record</documentation>
<input message="tns:insertPurchaseRequest"/> << here
<output message="tns:insertPurchaseResponse"/> << here
</operation>
<operation name="selectPurchase">
<documentation>Get the Purchase record</documentation>
<input message="tns:selectPurchaseRequest"/> << here
<output message="tns:selectPurchaseResponse"/> <<here
</operation>
</portType>