Thursday 22 October 2015

WSDL format for document style

consultants.xsd

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.consultants.com/it"
xmlns:tns="http://www.consultants.com/it" elementFormDefault="qualified">

<include schemaLocation="mobile.xsd"/>
    <!-- instantiating the complex element -->
    <!-- 
    this is global elements 
    global elements  are those elements which acts root element for XML instance doc............
    public String uploadConsutant(Consultant consultantRequest)
    -->
    <element name="consultantRequest" type="tns:Consultant"/>
    <element name="sresponse" type="string"/>
     
      <!-- 
      public AllConsultants" findAllConsultants()
       -->
     <element name="voidinput" type="tns:voidInput"/>
     <element name="AllConsultantsResponse" type="tns:AllConsultants"/>
     
     <element name="ConsultantFaultMessage" type="tns:ConsultantFaultMessage"/>
    
    <complexType name="voidInput">
           <sequence>
           </sequence>
    </complexType>
       
      <!-- This is only definition -->  
    <complexType name="AllConsultants">
    <sequence>
    <element name="consultant" type="tns:Consultant" minOccurs="0" maxOccurs="unbounded">
    <annotation>
<documentation>Consultant recored can be zero or more than zero</documentation>
</annotation>
</element>
    </sequence>
    </complexType>
    

    <!-- Defining complex element -->
<complexType name="Consultant">
<sequence>
<element name="name" type="string" maxOccurs="1" minOccurs="1"/>
   <element name="email" type="string" maxOccurs="2" minOccurs="1"/>
element name="mobile" type="tns:Mobile" maxOccurs="1" minOccurs="1"/>
 <element name="age" type="int" maxOccurs="1" minOccurs="1"/>
     <element name="address" type="string" maxOccurs="1" minOccurs="0"/>
    <element name="gender" type="tns:Gender" maxOccurs="1" minOccurs="0"/>
    <element name="designation" type="string" maxOccurs="1" minOccurs="1" default="software engineer"/>
     <element name="photo" type="base64Binary" maxOccurs="1" minOccurs="0"/>
</sequence>
<attribute name="eid" type="string" use="optional"/>
</complexType>

employee-consultants.wsdl

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.consultants.com/it" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="synergisticit-consultants"
targetNamespace="http://www.consultants.com/it">
<wsdl:types>
<xsd:schema>
<xsd:import namespace="http://www.consultants.com/it"
schemaLocation="consultants.xsd" />
</xsd:schema>
</wsdl:types>
<!-- consultantRequest pconsultant; -->
<wsdl:message name="wconsultantRequest">
<wsdl:part name="pconsultant" element="tns:consultantRequest" />
</wsdl:message>
<wsdl:message name="wconsultantResponse">
<wsdl:part name="presponse" element="tns:sresponse" />
</wsdl:message>

<wsdl:message name="wvoidRequest">
<wsdl:part name="voidInput" element="tns:voidinput" />
</wsdl:message>

<wsdl:message name="wallConsultantsResponse">
<wsdl:part name="presponse" element="tns:AllConsultantsResponse" />
</wsdl:message>


   <wsdl:message name="ConsultantFaultMessageException">
<wsdl:part name="tempFault" element="tns:ConsultantFaultMessage" />
</wsdl:message>


<wsdl:binding name="ConsultantWebServiceBinding" type="tns:ConsultantWebService">
<wsdl:documentation>
http://schemas.xmlsoap.org/soap/http- this fix for http protocol
</wsdl:documentation>
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="uploadConsultant">
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>


No comments:

Post a Comment