将rpc转换为文档-没有类型映射到带有命名空间的名称



我正在将此WSDL文件从RPC/Literal转换为Document/Literal。我是全新的使用WSDL,我得到它的窍门,但这个错误让我感到困惑,尝试了几个其他的解决方案在这里看到,但没有一个解决问题。

错误:每次我尝试使用WSDL2Java生成骨架和存根时,都会得到错误。没有类型映射到名称空间为urn:Approver的名称proptype。

请帮

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="ApproverDefinitions" targetNamespace="urn:Approver"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:app="urn:Approver"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<types>
<schema elementFormDefault="qualified" targetNamespace="urn:Approver"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="proposal" type="app:propType"/>
<element name="rate" type="xsd:float"/>
<complexType name="propType">
<sequence>
<element name="name" type="xsd:string"/>
<element name="address" type="xsd:string"/>
<element name="amount" type="xsd:float"/>
</sequence>
</complexType>

</schema>
</types>
<message name="proposalMessage">
<!-- need three parts for name, address, and amount values 
use appropriate datatypes (e.g. xsd:string)-->
<part name="parameters" element="app:proptype"/>
</message>
<message name="rateMessage">
<!-- need one part for rate value, again use appropriate data type -->
<part name="parameters" element="app:rate"/>
</message>

<portType name="loanPort">
<operation name="approveOperation">
<input message="app:proposalMessage"/>
<output message="app:rateMessage"/>
<!-- include input and output messages defined above -->
</operation>
</portType>
<binding name="loanBinding" type="app:loanPort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="approveOperation">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal" namespace="urn:Approver"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="literal" namespace="urn:Approver"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="ApproverService">
<port name="ApproverLoan" binding="app:loanBinding">
<soap:address location="http://127.0.0.1:8080/axis2/services/ApproverService"/>
</port>
</service>
</definitions>

<part>标记的element属性需要XML元素(即用<xsd:element>定义的东西),您提供了XML类型(即用<xsd:complexType<xsd:simpleType>定义的东西)。将其替换为:

<part name="parameters" element="app:proposal" />

最新更新