.NET/ASP.NET Interview Question - What is WSDL?

 Posted by ArticlesMaint on 4/20/2011 | Category: ASP.NET Interview questions | Views: 3040


WSDL(Web Services Description Language) is an XML-based language which describes the Web services,Method name,Function name and Input Output parameter.


To see how WSDL look like, just go to Visual Studio create a webservice and run .asmx file you will see the output like below diagram and when you click on service description then the WSDL will be seen.



 

 <?xml version="1.0" encoding="utf-8" ?> 
- <wsdl:definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
targetNamespace="http://tempuri.org/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
- <s:element name="HelloWorld">
  <s:complexType />  
</s:element>
- <s:element name="HelloWorldResponse">
- <s:complexType>
- <s:sequence>
  <s:element minOccurs="0" maxOccurs="1" name="HelloWorldResult" type="s:string" />

  </s:sequence>
  </s:complexType> 
</s:element>
  </s:schema> 
</wsdl:types>
+ <wsdl:message name="HelloWorldSoapIn"> 
<wsdl:part name="parameters" element="tns:HelloWorld" />  
</wsdl:message>
- <wsdl:message
name="HelloWorldSoapOut">
  <wsdl:part name="parameters"
element="tns:HelloWorldResponse" />
  </wsdl:message>
<wsdl:portType name="WebService1Soap">
- <wsdl:operation
name="HelloWorld">
  <wsdl:input message="tns:HelloWorldSoapIn"/>
  <wsdl:output message="tns:HelloWorldSoapOut" />

  </wsdl:operation>
  </wsdl:portType>


Regards,




Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response