Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Building a test web service

Status
Not open for further replies.

madlarry

Programmer
Dec 6, 2000
117
GB
Hi,

I have been given a WSDL file for a web service. I'll be developing the code to communicate with the web service off-site, so I can't directly test it with the actual web service.
I want to reverse engineer a test web service from the WSDL.
I've run the WSDL.exe with the /server switch to create a class, removed the 'abstract' keyword from the class definition and operation, and added some code into the the operation to get some data from a database. This should replicate what the web service will return.

So, I have the .cs file - what should I do now to turn it into a web service that I can call from a client?

I'm sure there is an easy answer, but I've not got much experience with C# and VS2008, so I'm not sure.

I've tried to google this, and search the forums, but without success.

Many thanks
 
I think what you are looking for is a testing framework and a mocking framework.

Testing frameworks:
nunit
mbunit
xunit
mstest

Mocking frameworks:
rhino.mocks
moq
typemock

depending on how your code is structured will determine which mocking framwork you can use. Either that your modify you code to use any of the mocking frameworks.

There is an abundance of advice on the topic of testing. google any one (or combination of) of these terms:
unit testing
[any framework mentioned above]
automated testing
TDD
Test Driven Development

In my experience there isn't much information about unit testing on TT. most .net developers here either don't know about it, use it, or simply don't talk about it.

each one of the frameworks above has forums dedicated to it, most on Google groups.

using a mocking framework can be tricky and comes with a learning curve. unit testing frameworks are pretty straight forward.

Testing the GUI (or in this case an actual web service call) is the most complicated (and slowest) type of test. The reason GUI is difficult to test is because it's designed for a human to use, not a computer. formatting. layout, etc. all this can be difficult to a computer to validate.

A web service is really just slow to test because you need IIS and a the browser. It's more than just a file or two to test, it's most of the application stack.

To test the web based portion look into WatiN and Selenium these frameworks can auto load a browser/webpage and test for existing elements. there are also javascript testing frameworks. this portion of web testing is still a mystery to me I usually put the core logic under automated testing and test the GUI manually.

Hope this begins to point you in the right direction.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top