Axis代码生成错误:从WSDL生成Java时发生IWAB0399E错误
我在Eclipse中使用Axis生成web服务客户机。但我犯了这个错误:Axis代码生成错误:从WSDL生成Java时发生IWAB0399E错误,java,web-services,axis,Java,Web Services,Axis,我在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.xmlsoa
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
IWAB0399E从WSDL:Java.io.IOException:生成Java时出错,或在中发现未定义的消息。消息名为'{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>
添加购买记录
获取购买记录
请帮忙 尝试将“tns:”信息添加到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>
添加购买记录
谢谢你的回答,但是WebService服务器不是我的,我想为这个WebService编写一个客户端。我使用了Axis客户端生成器并得到了那个错误。你认为是服务器的错误导致了我的错误吗?可能是,但是soapui工具可以生成一个完整的客户端,我不知道soapui是如何使用Axis或Apache CXF生成客户端的。Axis2呢,我也有同样的问题