0

Hi,

I want to retrieve the full WSDL file content, i.e. the XML content preferably as a string. The input will be the URL of the WSDL. If anyone has got any idea then please do reply.

-
Thanks
Ambar

4
Contributors
4
Replies
7
Views
7 Years
Discussion Span
Last Post by pitic
1

I don't know why you'd do this, but here is a method to read an entire WSDL document into a string:

using System.IO;
using System.Net;

namespace GetWsdlAsString
{
   class CGetWsdlAsString
   {
      static void Main(string[] args)
      {
         WebClient wc = new WebClient();
         StreamReader fileIn = new StreamReader(
            wc.OpenRead("http://presentedbymiller.com/smsservice.asmx?WSDL"));

         string strWsdlData = fileIn.ReadToEnd();
         fileIn.Close();
      }
   }
}
Comments
Good suggestion.
0

Thanks a lot. It's working like a charm.

I don't know why you'd do this, but here is a method to read an entire WSDL document into a string:

I will tell you why. I have a WSDL url (as you already know), a webserivce url, one function name of the webservice which is being called by some app. So I am searching for the particular function name in the wsdl and then getting the parameter names. I don't know if there is any other easier ways to do it.
Thanks again. :)

-
Ambar

0

It doesn't retrieve the wsdl itself it just retrieve the xxx.asmx....why? and how can I retrieve the wsdl content iteself?

0

Why don't you just add the wsdl as a web reference to your project? This way it will automatically create all the necessary code so you can access any method in that web service.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.