WSDL -> ASMX: невозможно связать пространство имен - PullRequest
0 голосов
/ 04 июля 2019

Я хочу сгенерировать веб-сервис из WSDL.Я обнаружил только wsdl.exe Ошибка: невозможно импортировать привязку '...' из пространства имен '...' , но у меня нет 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>
...