WSDL-> ASMX:无法绑定名称空间

时间:2019-07-04 11:32:08

标签: wsdl asmx

我想从WSDL生成Web服务。我只找到wsdl.exe Error: Unable to import binding '...' from namespace '...',但是没有任何xsd文件。如何生成我的C#文件?

命令行:

"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\wsdl.exe" /serverInterface C:\ServerKOS\wsdl_to_asmx\Unbenannt36.wsdl

错误:

Fehler: Unable to import binding 'abcSoapBinding' from namespace 'http://abc.example.com'.
  - Unable to import operation 'abcAufruf'.
  - The operation binding 'abcAufruf' from namespace 'http://abc.example.com' had invalid syntax.  Missing soap:operation binding.

Unbekannt36.wsdl:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:abc="http://abc.example.com" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" name="abc" targetNamespace="http://abc.example.com">
    <types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://abc.example.com" elementFormDefault="qualified">
            <import namespace="http://www.w3.org/2005/05/xmlmime" schemaLocation="http://www.w3.org/2005/05/xmlmime"/>
            <complexType name="abcParts">
                <sequence>
                    <element name="Number" type="xsd:int"/>
                    <element name="Part" type="xsd:base64Binary" xmime:expectedContentTypes="application/octet-stream"/>
                </sequence>
            </complexType>
            <complexType name="abcAnfrage">
                <sequence>
                    <element name="Version" type="xsd:string"/>
                    <element name="Anwender" type="xsd:string"/>
                    <element name="XMLPart" type="xsd:base64Binary" xmime:expectedContentTypes="text/xml"/>
                    <element name="Parts" type="abc:abcParts" minOccurs="0" maxOccurs="unbounded"/>
                </sequence>
            </complexType>
            <element name="abcInput" type="abc:abcAnfrage"/>
            <element name="abcOutput" type="abc:abcAnfrage"/>
        </schema>
    </types>
    <message name="abcRequest">
        <part name="parameters" element="abc:abcInput"/>
    </message>
    <message name="abcResponse">
        <part name="parameters" element="abc:abcOutput"/>
    </message>
    <portType name="abcPortType">
        <operation name="abcAufruf">
            <input message="abc:abcRequest"/>
            <output message="abc:abcResponse"/>
        </operation>
    </portType>
    <binding name="abcSoapBinding" type="abc:abcPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="abcAufruf">
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>
    <service name="abcService">
        <port name="abcPort" binding="abc:abcSoapBinding">
            <soap:address location="http://localhost:21486"/>
        </port>
    </service>
</definitions>

0 个答案:

没有答案