Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a simple SOAP server using C# in Visual Studio 2010?

I was trying to follow the instructions here but they seem to quickly be getting very specific to Sharepoint, as they go along further. I just want a general tutorial for creating a non-sharepoint SOAP starter projects, and Google is not my friend, at the moment.

It seems that some of the above steps are applicable.

So far I have:

  1. A solution 'WebSite1' created with File -> New Website.
  2. A 'ClassLibrary1' project in C#, with System.Web.Services added to References.
  3. a key02.snk (strongname key file) file node in the classlibrary1.
  4. No code implementing any SOAP server methods yet.
  5. No idea how to add code to the above, and then build and run, and have a soap hello-world type method.

I'd like to implement a simple HelloWorld method that takes at least one parameter. The resulting service could be queried for its WSDL with a url like this:

    http[s]://localhost/myfirstsoapserver/helloWorldMethod1.asmx?WSDL

If my guess above is right, the above Url would be usable by any tool that can import WSDL.

My goal is rapid prototyping and mocking up of various other SOAP interfaces that I need to deal with, and I'm hoping that C#+visualStudio2010+IIS is a reasonably easy way to do that.

like image 611
Warren P Avatar asked Dec 28 '22 11:12

Warren P


1 Answers

First create a new project as a web application: enter image description here

Then add a new item of type web service: enter image description here

like image 125
Felice Pollano Avatar answered Jan 07 '23 13:01

Felice Pollano