WSDL service for plain XML instead of SOAP

前端 未结 1 1358
遇见更好的自我
遇见更好的自我 2021-02-04 09:59

Can I have a WSDL which will just use plain XML data and not SOAP?

If so could you please provide me a sample WSDL?

相关标签:
1条回答
  • 2021-02-04 10:51

    Yes, sending plain XML data over HTTP can be described in WSDL. Instead of using <soap:binding> when defining your operation's binding, you would instead use <http:binding>. For example:

    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:example" xmlns:tns="urn:example">
        <types>
            <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:example">
            <element name="content">
                <complexType>
                <sequence>
                    <element name="first" type="string"/>
                    <element name="second" type="integer"/>
                </sequence>
                </complexType>
            </element>
            </schema>
        </types>
    
        <message name="id">
            <part name="id" type="xsd:string"/>
        </message>
    
        <message name="info">
            <part name="info" type="tns:content"/>
        </message>
    
        <portType name="widgetPortType">
            <operation name="getInfo">
            <input message="tns:id"/>
            <output message="tns:info"/>
            </operation>
        </portType>
    
        <binding name="binding" type="tns:widgetPortType">
            <http:binding verb="POST"/>
            <operation name="getInfo">
            <http:operation location="getInfo"/>
            <input>
                <mime:content type="application/x-www-form-urlencoded"/>
            </input>
            <output>
                <mime:mimeXml/>
            </output>
            </operation>
        </binding>
    
        <service name="widgetService">
            <port name="port" binding="tns:binding">
            <http:address location="http://www.example.org/"/>
            </port>
        </service>
    
    </definitions>
    

    You can find additional information about using an HTTP binding here: http://docs.oracle.com/cd/E19182-01/821-0830/cnfg_http-bc-get-processing_r/index.html

    0 讨论(0)
提交回复
热议问题