Solved

Creating mock WebService server from WSDL.exe output

Posted on 2013-05-23
1
776 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
Comment Utility
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

Highfive Gives IT Their Time Back

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

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 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

16 Experts available now in Live!

Get 1:1 Help Now