如何解决将 rpc 转换为文档 - 没有类型映射到具有命名空间的名称
我正在将此 WSDL 文件从 RPC/Literal 转换为 Document/Literal。我是使用 WSDL 的新手,我已经掌握了它的窍门,但这个错误让我感到困惑,尝试了这里看到的其他几个解决方案,但没有一个解决了问题。
错误: 每次尝试使用 WSDL2Java 生成 Skelton 和 Stub 时,都会收到错误 No type was mapping to the name proptype with namespace urn:Approver
请帮忙
<?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>
解决方法
element
标签的 <part>
属性需要 XML 元素(即使用 <xsd:element>
定义的内容),您提供了 XML 类型(即使用 <xsd:complexType
定义的内容或<xsd:simpleType>
)。替换为:
<part name="parameters" element="app:proposal" />
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。