Search code examples
c#web-servicesxsdwsdl

Web service in C#


Previously I used web services sample from console application, but I don't have much knowledge in that in terms of understanding in xsd and wsdl.

I would like to consume the complex web service to understand xsd and wsdl.

When goggling found some sample free web services, they have provided wsdl file, and service url. I am able to add the web reference in C#, but not understanding how and which method to call, could any body can provide sample code to consume?

  • Service URL: http://www.webservicex.com/globalweather.asmx?WSDL
  • Web method : GetWeatherResponse

When I add the service reference from the application I am able to see the these classes.

  input1, input2, input3, input4, 
  output1, output2, output3, output4,
  ArticleType, ArticlePtServiceClient, ArticlePTservicechannel

but I'm not able to view GetWeatherResponse()

From the wsdl file can i get to know from which class object we can call the web method?

Theoretical understanding is we can find the web method based on the wsdl. Eagerly awaiting positive responses. Expecting sample code to call this web method from the web service.As well as requesting you to some references to better understand complex type xsd's.

Thanks in advance.


Solution

  • After lot of R&D understand littele things regarding Web service and WCF.

    The only solution is We have to create stub to test in local environment.

    Createing stub :

    SVCUTIL

    still need to learn more, more questions are there in mind. will update here for our reference.