XSD 验证中的问题



我在 xsd 评估期间出现以下错误:

错误:src-resolve.4.2:解析组件"ns0:dachExceptionData"时出错。检测到"ns0:dachExceptionData"位于命名空间"http://com.dachser.edi.ext.api.ping.service.PingEdiExtService"中,但此命名空间中的组件不能从架构文档"file:/C:/Users/anujkumar/Downloads/wsdl%20test/pingEdiExtService.wsdl"引用。如果这是不正确的命名空间,也许需要更改"ns0:dachExceptionData"的前缀。如果这是正确的命名空间,则应将适当的"import"标签添加到"file:/C:/Users/anujkumar/Downloads/wsdl%20test/pingEdiExtService.wsdl"中。行号:2 列号:96 文字系统 ID 文件:/C:/Users/anujkumar/Downloads/wsdl%20test/pingEdiExtService.wsdl

WSDL 是:

<wsdl:definitions name="PingEdiExtServiceSoapImplService" targetNamespace="http://com.dachser.edi.ext.api.ping.service.PingEdiExtService"><wsdl:types><xs:schema elementFormDefault="unqualified" targetNamespace="http://com.dachser.edi.ext.api.ping.service.PingEdiExtService" version="1.0"><xs:element name="ping" type="tns:ping"/><xs:element name="pingResponse" type="tns:pingResponse"/><xs:complexType name="ping"><xs:sequence/></xs:complexType><xs:complexType name="pingResponse"><xs:sequence><xs:element minOccurs="0" name="return" type="xs:string"/></xs:sequence></xs:complexType><xs:complexType name="dachExceptionData"><xs:sequence><xs:element minOccurs="0" name="cause" type="xs:string"/><xs:element name="expType" type="xs:int"/><xs:element minOccurs="0" name="message" type="xs:string"/></xs:sequence></xs:complexType></xs:schema><xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://exception.ws.dachser.com"><xsd:element name="DachUncheckedExceptionSoap" nillable="true" type="ns0:dachExceptionData"/></xsd:schema></wsdl:types><wsdl:message name="DachUncheckedExceptionSoap"><wsdl:part element="ns1:DachUncheckedExceptionSoap" name="DachUncheckedExceptionSoap">
</wsdl:part></wsdl:message><wsdl:message name="ping"><wsdl:part element="tns:ping" name="parameters">
</wsdl:part></wsdl:message><wsdl:message name="pingResponse"><wsdl:part element="tns:pingResponse" name="parameters">
</wsdl:part></wsdl:message><wsdl:portType name="PingEdiExtServiceSoapImpl"><wsdl:operation name="ping"><wsdl:input message="tns:ping" name="ping">
</wsdl:input><wsdl:output message="tns:pingResponse" name="pingResponse">
</wsdl:output><wsdl:fault message="tns:DachUncheckedExceptionSoap" name="DachUncheckedExceptionSoap">
</wsdl:fault></wsdl:operation></wsdl:portType><wsdl:binding name="PingEdiExtServiceSoapImplServiceSoapBinding" type="tns:PingEdiExtServiceSoapImpl"><soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation name="ping"><soap:operation soapAction="" style="document"/><wsdl:input name="ping"><soap:body use="literal"/></wsdl:input><wsdl:output name="pingResponse"><soap:body use="literal"/></wsdl:output><wsdl:fault name="DachUncheckedExceptionSoap"><soap:fault name="DachUncheckedExceptionSoap" use="literal"/></wsdl:fault></wsdl:operation></wsdl:binding><wsdl:service name="PingEdiExtServiceSoapImplService"><wsdl:port binding="tns:PingEdiExtServiceSoapImplServiceSoapBinding" name="PingEdiExtServiceSoapImplPort"><soap:address location="https://edi.dachser.com/soap/ext/pingEdiExtService"/></wsdl:port></wsdl:service></wsdl:definitions>

虽然我可以在 https://www.wsdl-analyzer.com/验证这个 wsdl

wsdl 有什么问题?

谢谢

我看到它的主要问题是没有很好地定义某些命名空间。我已经添加了它们( xmlns:tns="http://com.dachser.edi.ext.api.ping.service.PingEdiExtService" xmlns:ns0="http://exception.ws.dachser.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"( 到定义中。

整个 wsdl 具有以下定义:

<wsdl:definitions name="PingEdiExtServiceSoapImplService" targetNamespace="http://com.dachser.edi.ext.api.ping.service.PingEdiExtService"
xmlns:tns="http://com.dachser.edi.ext.api.ping.service.PingEdiExtService" xmlns:ns0="http://exception.ws.dachser.com"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<xs:schema elementFormDefault="unqualified" targetNamespace="http://com.dachser.edi.ext.api.ping.service.PingEdiExtService"
xmlns:tns="http://com.dachser.edi.ext.api.ping.service.PingEdiExtService" version="1.0">
<xs:element name="ping" type="tns:ping"/>
<xs:element name="pingResponse" type="tns:pingResponse"/>
<xs:complexType name="ping">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="pingResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://exception.ws.dachser.com"
xmlns:ns0="http://exception.ws.dachser.com">
<xs:element name="DachUncheckedExceptionSoap" nillable="true" type="ns0:dachExceptionData"/>
<xs:complexType name="dachExceptionData">
<xs:sequence>
<xs:element minOccurs="0" name="cause" type="xs:string"/>
<xs:element name="expType" type="xs:int"/>
<xs:element minOccurs="0" name="message" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="DachUncheckedExceptionSoap">
<wsdl:part name="DachUncheckedExceptionSoap" element="ns0:DachUncheckedExceptionSoap"/>
</wsdl:message>
<wsdl:message name="ping">
<wsdl:part element="tns:ping" name="parameters"/>
</wsdl:message>
<wsdl:message name="pingResponse">
<wsdl:part element="tns:pingResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="PingEdiExtServiceSoapImpl">
<wsdl:operation name="ping">
<wsdl:input message="tns:ping" name="ping"/>
<wsdl:output message="tns:pingResponse" name="pingResponse"/>
<wsdl:fault message="tns:DachUncheckedExceptionSoap" name="DachUncheckedExceptionSoap"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="PingEdiExtServiceSoapImplServiceSoapBinding" type="tns:PingEdiExtServiceSoapImpl">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ping">
<soap:operation soapAction="http://com.dachser.edi.ext.api.ping.service.PingEdiExtService" style="document"/>
<wsdl:input name="ping">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="pingResponse">
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="DachUncheckedExceptionSoap">
<soap:fault name="DachUncheckedExceptionSoap" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="PingEdiExtServiceSoapImplService">
<wsdl:port binding="tns:PingEdiExtServiceSoapImplServiceSoapBinding" name="PingEdiExtServiceSoapImplPort">
<soap:address location="https://edi.dachser.com/soap/ext/pingEdiExtService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

相关内容

  • 没有找到相关文章

最新更新