Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programming against WSDL without access to actual webservice

I'm going to use C# to read data from a few webservices. I've done that many times before, but those times I've had direct access to the webservices from my development machine.

In this project I've just been sent a .wsdl file, and a couple of .xsd files for the webservice they have in their local intranet.

I've seen that I can use "Add Web Reference", and point directly to the .wsdl file, so that a C# class is created.

But how can I really test it? I'd like to return some dummy data that I can visualize while I develop. Any tips for this situation?

like image 322
Frode Lillerud Avatar asked Sep 18 '09 06:09

Frode Lillerud


People also ask

Do all Web services have a WSDL?

WSDL file documents in a machine readable (XML) format what the methods (and args for methods) offered by a web service. You do not need a WSDL file if you know what the methods and args are - though WSDL is very good to have as a means of making the web service public interface more 'contractified', if you will.


2 Answers

Mock Webservice

From the above source, a .cs file can be generated by opening a Visual Studio Command Prompt and running something like the following:

wsdl /language:CS /namespace:Your.Namespace.Here /out:Directory\To\Save\To\ /protocol:SOAP /serverinterface finally-your-wsdl-file-here.wsdl

like image 111
Henrik Avatar answered Nov 10 '22 14:11

Henrik


You can also try SOAP UI for mocking up service with ease. (Free web service testing tool)

Check:

http://www.soapui.org/gettingstarted/mocking.html

like image 29
shivaspk Avatar answered Nov 10 '22 13:11

shivaspk