我遇到的问题是,当我尝试使用此 wsdl 在 netbeans 中创建 Web 服务时,netbeans 说没有定义服务。我对整个 wsdl 事物都是新手,但据我所知,有一个已定义。
wsdl 是:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://discoveryinsurance.com/DicQuoteSvc/AgencyQuote.wsdl" xmlns:ns="http://discoveryinsurance.com/DicQuoteSvc/schemas/DicAcordQuoteRq.xsd" xmlns:na="http://discoveryinsurance.com/DicQuoteSvc/schemas/DicAcordQuoteRs.xsd" targetNamespace="http://discoveryinsurance.com/DicQuoteSvc/AgencyQuote.wsdl">
<wsdl:import namespace="http://discoveryinsurance.com/DicQuoteSvc/schemas/" location="DicAcordQuoteRq.xsd"/>
<wsdl:import namespace="http://discoveryinsurance.com/DicQuoteSvc/schemas/" location="DicAcordQuoteRs.xsd"/>
<wsdl:types>
<xs:schema targetNamespace="http://discoveryinsurance.com/DicQuoteSvc/schemas/" elementFormDefault="qualified"/>
</wsdl:types>
<wsdl:message name="NewMessageRequest">
<wsdl:part name="parameter" element="ns:ACORD"/>
</wsdl:message>
<wsdl:message name="NewMessageResponse">
<wsdl:part name="parameter" element="na:ACORD"/>
</wsdl:message>
<wsdl:portType name="QuotePortType">
<wsdl:operation name="RequestQuote">
<wsdl:input message="tns:NewMessageRequest"/>
<wsdl:output message="tns:NewMessageResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="QuoteBinding" type="tns:QuotePortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="RequestQuote">
<soap:operation soapAction="http://discoveryinsurance.com/DicQuoteSvc/AgencyQuote" style="rpc"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AgencyQuote">
<wsdl:port name="QuotePortType" binding="tns:QuoteBinding">
<soap:address location="http://discoveryinsurance.com/DicQuoteSvc/"/>
</wsdl:port>
</wsdl:service>
XMLSpy 说 wsdl 是有效的,但是当我尝试从中创建 Web 服务时它失败了。任何帮助将不胜感激,甚至是建设性的批评。
编辑
从我得到的命令行中使用 wsimport 。
[错误] Invalid wsdl:operation "RequestQuote": its a rpc-literal operation, message part must refer to a schema type declaration line 16 of file:/D:/projects/DICACORD/QuoteRq2.wsdl
这是否意味着即使导入了两个 xsd,我仍然必须在 wsdl 中定义类型?
更新 2
请求的架构->。 馅饼的架构
添加
有人看到 xsd 导入和/或它们的使用方式有什么问题吗?