[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Generating the Web Service code from C# class.

Jean-Francois Hamelin

6/11/2004 2:46:00 PM

Hi,

I have a C# class and I have to expose it through a Web Service, but I don't
want to write the Web Service, is there a generator that can produce the
.asmx file based on my .cs file?

Thanks
JF


1 Answer

(Luke Zhang [MS])

6/14/2004 5:19:00 AM

0

Hi Jean,

Not sure if there is wsuch one. Maybe you can search with google or in
www.gotdotnet.com.

Anyway, I don't think it is very difficut to create such a web service. For
example, you can add such a function first:

public MyClass MyClassFactory()
{
...
}

This class will generate a object from your class. Then create a web method
like:

[WebMethod]
public MyClass WebClass()
{
return MyClassFactory();

}

For a web service, we need to create the virtual folder and consider
deployment issues. Therefore, I prefer doing it myself instead of some
third party tools. Do you think so?


Luke