将 rpc 转换为文档 - 没有类型映射到具有命名空间的名称
Converting rpc to Document - No type was mapped to the name with namespace
我正在将此 WSDL 文件从 RPC/Literal 转换为 Document/Literal。我是使用 WSDL 的新手,我已经掌握了它的窍门,但这个错误让我感到困惑,尝试了这里看到的其他几个解决方案,但 none 解决了这个问题。
错误:
每次我尝试使用 WSDL2Java 生成 Skelton 和 Stubs 时,我都会收到错误 No type was mapped 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>
<part>
标签的 element
属性需要一个 XML 元素(即用 <xsd:element>
定义的东西),您提供了一个 XML 类型(即用 <xsd:complexType
或 <xsd:simpleType>
定义的东西)。将其替换为:
<part name="parameters" element="app:proposal" />
我正在将此 WSDL 文件从 RPC/Literal 转换为 Document/Literal。我是使用 WSDL 的新手,我已经掌握了它的窍门,但这个错误让我感到困惑,尝试了这里看到的其他几个解决方案,但 none 解决了这个问题。
错误: 每次我尝试使用 WSDL2Java 生成 Skelton 和 Stubs 时,我都会收到错误 No type was mapped 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>
<part>
标签的 element
属性需要一个 XML 元素(即用 <xsd:element>
定义的东西),您提供了一个 XML 类型(即用 <xsd:complexType
或 <xsd:simpleType>
定义的东西)。将其替换为:
<part name="parameters" element="app:proposal" />