Wednesday, September 26, 2012

WSDL File with mutliple end points (one URL for one Operation)


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://maths.lenin.com" xmlns:intf="http://maths.lenin.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://maths.lenin.com">
      <wsdl:types>
            <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://maths.lenin.com">
                  <element name="add">
                        <complexType>
                              <sequence>
                                    <element name="numA" type="xsd:double"/>
                                    <element name="numB" type="xsd:double"/>
                              </sequence>
                        </complexType>
                  </element>
                  <element name="addResponse">
                        <complexType>
                              <sequence>
                                    <element name="addReturn" type="xsd:double"/>
                              </sequence>
                        </complexType>
                  </element>
                  <element name="sub">
                        <complexType>
                              <sequence>
                                    <element name="numA" type="xsd:double"/>
                                    <element name="numB" type="xsd:double"/>
                              </sequence>
                        </complexType>
                  </element>
                  <element name="subResponse">
                        <complexType>
                              <sequence>
                                    <element name="subReturn" type="xsd:double"/>
                              </sequence>
                        </complexType>
                  </element>
            </schema>
      </wsdl:types>

      <wsdl:message name="addResponse">
            <wsdl:part element="impl:addResponse" name="parameters">
            </wsdl:part>
      </wsdl:message>

      <wsdl:message name="subResponse">
            <wsdl:part element="impl:subResponse" name="parameters">
            </wsdl:part>
      </wsdl:message>

      <wsdl:message name="subRequest">
            <wsdl:part element="impl:sub" name="parameters">
            </wsdl:part>
      </wsdl:message>

      <wsdl:message name="addRequest">
            <wsdl:part element="impl:add" name="parameters">
            </wsdl:part>
      </wsdl:message>

      <wsdl:portType name="LNNCaculatorAddition">
            <wsdl:operation name="add">
                  <wsdl:input message="impl:addRequest" name="addRequest">
                  </wsdl:input>
                  <wsdl:output message="impl:addResponse" name="addResponse">
                  </wsdl:output>
            </wsdl:operation>
      </wsdl:portType>

      <wsdl:portType name="LNNCaculatorSubtraction">
            <wsdl:operation name="sub">
                  <wsdl:input message="impl:subRequest" name="subRequest">
                  </wsdl:input>
                  <wsdl:output message="impl:subResponse" name="subResponse">
                  </wsdl:output>
            </wsdl:operation>
      </wsdl:portType>
     
      <wsdl:binding name="LNNCalculatorAdditionSoapBinding" type="impl:LNNCaculatorAddition">

            <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

            <wsdl:operation name="add">

                  <wsdlsoap:operation soapAction=""/>

                  <wsdl:input name="addRequest">
                        <wsdlsoap:body use="literal"/>
                  </wsdl:input>

                  <wsdl:output name="addResponse">
                        <wsdlsoap:body use="literal"/>
                  </wsdl:output>
            </wsdl:operation>
      </wsdl:binding>
     
      <wsdl:binding name="LNNCalculatorSubtractionSoapBinding" type="impl:LNNCaculatorSubtraction">

            <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

            <wsdl:operation name="sub">

                  <wsdlsoap:operation soapAction=""/>

                  <wsdl:input name="subRequest">
                        <wsdlsoap:body use="literal"/>
                  </wsdl:input>

                  <wsdl:output name="subResponse">
                        <wsdlsoap:body use="literal"/>
                  </wsdl:output>

            </wsdl:operation>
      </wsdl:binding>
     
      <wsdl:service name="LNNCalculatorService">

            <wsdl:port binding="impl:LNNCalculatorAdditionSoapBinding" name="LNNCaculatorAddition">

                  <wsdlsoap:address location="http://localhost:8080/zero/services/LNNCaculatorAddition"/>

            </wsdl:port>
           
            <wsdl:port binding="impl:LNNCalculatorSubtractionSoapBinding" name="LNNCaculatorSubtraction">

                  <wsdlsoap:address location="http://localhost:8080/zero/services/LNNCaculatorSubtraction"/>

            </wsdl:port>

      </wsdl:service>

</wsdl:definitions>

No comments:

Post a Comment