Kerala Microsoft Users Group

How to get list of an available web services on specified url

Latest post 10-12-2008 11:18 PM by vbmade2000. 4 replies.
  • 10-11-2008 12:27 PM

    How to get list of an available web services on specified url

    Hello Everyone

     

    Pls help me in this topic.

     

    Can anyone tell me How to get List of All the WebServices available on specific url and show in ListBox ?

     

    I want to do this task on runtime when i click Load Button.

    Filed under: , , , ,
    • Post Points: 25
  • 10-11-2008 11:15 PM In reply to

    Re: How to get list of an available web services on specified url

    WSDL is the source for getting information about web services. The below code is add all operations of a web service into a ListBox.

                HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create( "http://localhost/service/service1.asmx?WSDL" );
                //To DO : You should provide Crdential information here
                HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse();

                XPathDocument xpathDocument = new XPathDocument( webResponse.GetResponseStream() );
                XPathNavigator xpathNavigator = xpathDocument.CreateNavigator();

                XmlNamespaceManager xmlNamespaceManager = new XmlNamespaceManager( new NameTable() );
                xmlNamespaceManager.AddNamespace( "wsdl", "http://schemas.xmlsoap.org/wsdl/" );

                foreach( XPathNavigator node in xpathNavigator.Select( "//wsdl:message/@name", xmlNamespaceManager ) )
                {
                    listBox1.Items.Add(node.Value);
                }

    • Post Points: 5
  • 10-12-2008 9:43 PM In reply to

    Re: How to get list of an available web services on specified url

    Thnx for help Sir.

     

    The code works fine.

     

    This code lists al the procedures of given web service.

     

    How can i use them at runtime ?

     

    Generally web service can be referenced by Project-> Add Web Reference -> by Enetring URL ofw web service.

     

    Can i do this complete procedure at runtime in code ?

     

     

     

    Filed under: , ,
    • Post Points: 25
  • 10-12-2008 10:27 PM In reply to

    Re: How to get list of an available web services on specified url

    • Post Points: 25
  • 10-12-2008 11:18 PM In reply to

    Re: How to get list of an available web services on specified url

    Thnx sir the link u sent has solution of my problem.

    Filed under: , ,
    • Post Points: 5
Page 1 of 1 (5 items) | RSS