2013-02-25 151 views
2

生成WSDL定义故障错误我使用WSDL代的问题在2010年德尔福我写了一个例子,复制生成的WSDL文件:SOAP:到2010年德尔福

<?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元素没有名称属性。在我看来,这个属性在WSDL定义中是必需的。这是Delphi中的一个bug吗?还是有什么方法可以使WSDL在其他语言中工作?

回答

0

Delphi 2010生成的WSDL使用RPC编码的SOAP风格(请参阅NetBeans 7.0 and JAX-RPC Web Services)。

如果在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) 
+0

您的帮助十分感谢。 – elwoodj 2013-02-25 18:09:55