Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Generating the Web Service code from C# class.

Reply
Thread Tools

Generating the Web Service code from C# class.

 
 
Jean-Francois Hamelin
Guest
Posts: n/a
 
      06-11-2004
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


 
Reply With Quote
 
 
 
 
[MSFT]
Guest
Posts: n/a
 
      06-14-2004
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

 
Reply With Quote
 
 
 
 
Jean-Francois Hamelin
Guest
Posts: n/a
 
      06-16-2004
Thanks for the reply, I was looking more for a complete wrapping of my
class, but I like the idea of using a factory pattern. My concern is I want
to maintain my class and not the web service interface, which I can achieve
by using the factory pattern, here I write the factory only once.

Thanks
JF


"[MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
[MSFT]
Guest
Posts: n/a
 
      06-17-2004
If you have only one or two class, you can just factory code once. If you
need to work with multiple code, I think you can add a parameters to the
Factory class, to specify the class you wan to create. This also require we
change the code for each of class. Anyway, the change is very little.

Luke

 
Reply With Quote
 
Jean-Francois Hamelin
Guest
Posts: n/a
 
      06-17-2004
I will prototype some of your ideas.

Thanks
JF

"[MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If you have only one or two class, you can just factory code once. If you
> need to work with multiple code, I think you can add a parameters to the
> Factory class, to specify the class you wan to create. This also require

we
> change the code for each of class. Anyway, the change is very little.
>
> Luke
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does timer in Web Service Global.asax block my Web Service from processing web-site requests? Leo Violette ASP .Net Web Services 0 04-17-2009 12:39 AM
Generating HTML in a web service Lloyd Sheen ASP .Net 6 07-04-2007 04:24 AM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
Generating a WSDL from a document-oriented Web Service? mygoogleac Java 0 10-12-2004 01:30 PM
Generating a WSDL from document-oriented Web Service mygoogleac Java 0 09-30-2004 12:38 AM



Advertisments