我在 Delphi 2010 中生成 WSDL 时遇到问题。我写了一个示例并复制了生成的 WSDL 文件:
<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="IHalloWeltIntfservice" targetNamespace="http://www.micos.de/namespace/" xmlns:tns="http://www.micos.de/namespace/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns1="http://www.borland.com/namespaces/Types" xmlns:ns2="urn:XSTypen" xmlns:ns3="urn:uHalloWeltIntf">
<types>
<xs:schema targetNamespace="urn:uHalloWeltIntf" xmlns="urn:uHalloWeltIntf">
<xs:complexType name="EHalloWelt">
<xs:sequence>
<xs:element name="KundenId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</types>
<message name="HoleHalloWeltAlsXML2Request">
<part name="InstitutionId" type="xs:int"/>
<part name="KundenId" type="xs:int"/>
</message>
<message name="HoleHalloWeltAlsXML2Response">
<part name="return" type="xs:string"/>
</message>
<message name="HoleHalloWeltAlsXML2fault0">
<part name="EHalloWelt" type="ns3:EHalloWelt"/>
</message>
<portType name="IHalloWeltIntf">
<operation name="HoleHalloWeltAlsXML">
<input message="tns:HoleHalloWeltAlsXML2Request"/>
<output message="tns:HoleHalloWeltAlsXML2Response"/>
<fault name="EKeineVitalwerteVorhanden" message="tns:HoleHalloWeltAlsXML2fault0"/>
</operation>
</portType>
<binding name="IHalloWeltIntfbinding" type="tns:IHalloWeltIntf">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="HoleHalloWeltAlsXML">
<soap:operation soapAction="urn:uHalloWeltIntf-IHalloWeltIntf#HoleHalloWeltAlsXML" style="rpc"/>
<input>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:uHalloWeltIntf-IHalloWeltIntf"/>
</input>
<output>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:uHalloWeltIntf-IHalloWeltIntf"/>
</output>
<fault>
<soap:fault use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:uHalloWeltIntf-IHalloWeltIntf"></soap:fault>
</fault>
</operation>
</binding>
<service name="IHalloWeltIntfservice">
<port name="IHalloWeltIntfPort" binding="tns:IHalloWeltIntfbinding">
<soap:address location="http://localhost:1024/soap/IHalloWeltIntf"/>
</port>
</service>
</definitions>
起初该文件看起来不错,但如果我尝试将其导入 NetBeans,ant wscompile 目标会告诉我绑定块中缺少属性。soap:fault 元素没有 name 属性。在我看来,该属性在 WSDL 定义中是必需的。这是 Delphi 中的错误还是有任何方法可以使 WSDL 在其他语言中工作?