SOAP:Delphi 2010生成的WSDL定义中的错误

SOAP:Delphi 2010生成的WSDL定义中的错误,delphi,soap,wsdl,rpc,Delphi,Soap,Wsdl,Rpc,我在Delphi2010中遇到了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/namespa

我在Delphi2010中遇到了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目标会告诉我绑定块中缺少一个attibute。soap:fault元素没有name属性。在我看来,该属性在WSDL定义中是必需的。这是Delphi中的一个bug还是有任何方法可以使WSDL在其他语言中工作?

Delphi 2010生成的WSDL使用RPC编码的SOAP样式(请参阅)

如果手动修复WSDL中的错误,NetBeans 7.2中的SAX-RPC导入程序将生成所需的Java类:

  <fault name="EKeineVitalwerteVorhanden">
    <soap:fault name="EKeineVitalwerteVorhanden" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:uHalloWeltIntf-IHalloWeltIntf"></soap:fault>
  </fault>
ant -f C:\\Users\\... test.wsdl4-client-wscompile
init:
wscompile-init:
test.wsdl4-client-wscompile:
Copying 1 file to C:\Users\...\build\generated-sources\jax-rpc\wsdl
Warnung: Verarbeitung von WS-I-nicht-entsprechendem Vorgang "HoleHalloWeltAlsXML" mit RPC-Stil und SOAP-kodiert
Warnung: R2716/R2726 WSI-BasicProfile Ver. 1.0, Namespace-Attribut unzulässig in doc/lit oder rpc/lit für soapbind:fault: "EKeineVitalwerteVorhanden"
BUILD SUCCESSFUL (total time: 2 seconds)