Solved

Creating mock WebService server from WSDL.exe output

Posted on 2013-05-23
1
777 Views
Last Modified: 2013-05-29
Hey,

I need to create a mock Web Service that I can use to test my client application.

I have the WSDL from the web service. I have generated .cs code using the wsdl.exe /serverInterface command.

How do I get this going in a new WebService project in Visual Studio?

So far, I have imported the .cs file ("InterfaceWebService.cs"). But now I am not sure how to implement it in the standard Hello World code.

Thanks for any pointers
0
Comment
Question by:mhdi
1 Comment
 
LVL 25

Accepted Solution

by:
apeter earned 500 total points
ID: 39194945
Can't you create a wrapper from the interface you generated and use that ?

class WebServiceClientWrapper
{
       IYourserverInterface _proxy;

    public WebServiceClientWrapper(IYourserverInterface obj)
   {
             proxy = obj;
   }
    public string MethodYouUse()
    {
            _proxy.WebServiceMethodYouUse();
      }
}

//Temporary class which implement the web service methods
Class TempWebSErvice : IYourserverInterface
{
   // implemet all the method
}

//below code can be replaced when you get the actual proxy.

WebServiceClientWrapper proxy = new WebServiceClientWrapper(new TempWebSErvice());
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

863 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

20 Experts available now in Live!

Get 1:1 Help Now