Learn how to a build a cloud-first strategyRegister Now


Using A WSDL To Get Data?

Posted on 2009-02-13
Medium Priority
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

Dhaest earned 300 total points
ID: 23631123
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

ID: 23631423
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.

Accepted Solution

Imperdonato earned 600 total points
ID: 23631425
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


Assisted Solution

nost2 earned 600 total points
ID: 23631648
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: http://wslite.strikeiron.com/censusinfolite01/CensusInfoLite.asmx?WSDL
This code will call a method of the web service:

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

LVL 53

Assisted Solution

Dhaest earned 300 total points
ID: 23631654
Calling Webservices from ASP.NET: Example Google Web Service

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

810 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