Using A WSDL To Get Data?

Posted on 2009-02-13
Last Modified: 2013-12-17
Hey everyone

I have a WSDL file that I am meant to use in order to pull data back to my application.  I have added the reference, and can see the methods that I think I should use... but how exactly do I use them?  I'm not sure how to extract anything from the response method, or even how to send the request.

All help is greatly appreciated
Question by:angus_young_acdc
    LVL 53

    Assisted Solution

    The wsdl is just a description of the webmethods

    WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint. Related concrete endpoints are combined into abstract endpoints (services). WSDL is extensible to allow description of endpoints and their messages regardless of what message formats or network protocols are used to communicate, however, the only bindings described in this document describe how to use WSDL in conjunction with SOAP 1.1, HTTP GET/POST, and MIME.
    LVL 15

    Author Comment

    How can I actually make a call to get data then?  I can only seem to generate an exception about not setting a security header.
    LVL 5

    Accepted Solution

    Suppose the name of the reference that you added is "Ref_WebSvc"
    Also, suppose the WSDL exposes a class named "AdditionHelper", which has a method "int  Add(int a, int b)..."

    The C# code for this will be something like this...

    Hope that helps.

    using Ref_WebSvc;
    public void TestCaller()
        int param1 = 5;
        int param2 = 10;
        Ref_WebSvc.AdditionHelper helper = new Ref_WebSvc.AdditionHelper();
        int retVal = helper.Add(param1, param2);

    Open in new window

    LVL 4

    Assisted Solution

    If you have never tried using a web service before I suggest you write a small test application. Just to get an idea of what web services is about. In Visual Studio, add a web reference to:
    This code will call a method of the web service:

                com.strikeiron.wslite.CensusInfoLite cl = new;
                com.strikeiron.wslite.CensusOutput co = cl.GetCensusInfoForZIPCode("27513");

    LVL 53

    Assisted Solution

    Calling Webservices from ASP.NET: Example Google Web Service

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now