編集私は以下の例から始めましたが、今は次のとおりです:
- W3C仕様の例を試しました。別のエラーを修正した後 (バインディングが別の
StockQuoteSoapBinding
場所で呼び出されたStockQuoteBinding
)、同じ問題が発生します。 - モノジェネレーター
wsdl
を試して、それが原因かどうかを確認wsimport
しました。同等のエラーが発生します。
したがって、SOAP についての誇大宣伝にもかかわらず、実際には機能していないように思えます。少なくとも、宣伝されているほどではありません。これらのジェネレーターを介して最も見つけやすい wsdl の例を誰も実行していないとは信じられません。
元の質問
次の wsdl で wsimport が失敗します。
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="OrdersService"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:os="http://example/schema/OrdersService"
xmlns:tns="http://example/ns/OrdersService"
targetNamespace="http://example/ns/OrdersService"
>
<wsdl:types>
<xsd:schema
targetNamespace="http://example/schema/OrdersService">
<xsd:element name="o:GetOrders">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="criteria" type="string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="os:GetOrdersResponse">
<xsd:complexType>
<xsd:all>
<xsd:element name="orders" type="string"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="GetOrdersRequest">
<wsdl:part name="parameters" element="os:GetOrders"/>
</wsdl:message>
<wsdl:message name="GetOrdersResponse">
<wsdl:part name="parameters" element="os:GetOrdersResponse"/>
</wsdl:message>
<wsdl:portType name="GetOrdersPortType">
<wsdl:operation name="GetOrders">
<wsdl:input message="tns:GetOrdersRequest"/>
<wsdl:output message="tns:GetOrdersResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="GetOrdersBinding" type="tns:GetOrdersPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetOrders">
<soap:operation soapAction=""/>
<wsdl:input><soap:body use="literal"/></wsdl:input>
<wsdl:output><soap:body use="literal"/></wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="OrdersService">
<wsdl:port name="GetOrdersPort" binding="tns:GetOrdersBinding">
<soap:address location="http://localhost:8080/svc/OrdersService/GetOrders"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
と:
parsing WSDL...
[ERROR] Schema descriptor {http://example/schema/OrdersService}GetOrders in message part "parameters" is not defined and could not be bound to Java. Perhaps the schema descriptor {http://example/schema/OrdersService}GetOrders is not defined in the schema imported/included in the WSDL. You can either add such imports/includes or run wsimport and provide the schema location using -b switch.
line 35 of file:test.wsdl