[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

Re: Multiple WebMethods in a Web Service

Frank Drebin

8/25/2003 7:07:00 PM

Yep - you need to have that Web Method attribute above every method you want
to expose in your web service...


"JP" <jpatel3@hotmail.com> wrote in message
news:052c01c36b3a$5539ea80$a101280a@phx.gbl...
> Hi,
>
> I am trying to created more than one WebMethods in a
> SINGLE WEB SERVICE, but can't figure out how. The one
> method that I have has a <Web Method> tag, if I try the
> other the same way, it just doesn't work and it also makes
> the first method not being reconized.
>
> Somebody....please help....let me know what am I missing
> in order to have more than one Web Method in a Service.
>
> Thanks a lot!
> JP
>
>
>


1 Answer

Frank Drebin

8/26/2003 3:11:00 PM

0

If you create a new WebService (.asmx file) and use this code:

[WebMethod]
public string HelloWorld()
{
return "Hello World";
}

[WebMethod]
public string HelloWorld2()
{
return "Hello World2";
}

That will expose 2 publicly available methods...

"JP" <jpatel3@hotmail.com> wrote in message
news:0ce901c36be1$a89497f0$a601280a@phx.gbl...
> Thanks Frank!
>
> But I had already tried it! May be I missed something,
> I'll try again. Since you have tried it yourself, it must
> work that way....let me know if there are any special tips
> I can use.
>
> JP
>
> >-----Original Message-----
> >Yep - you need to have that Web Method attribute above
> every method you want
> >to expose in your web service...
> >
> >
> >"JP" <jpatel3@hotmail.com> wrote in message
> >news:052c01c36b3a$5539ea80$a101280a@phx.gbl...
> >> Hi,
> >>
> >> I am trying to created more than one WebMethods in a
> >> SINGLE WEB SERVICE, but can't figure out how. The one
> >> method that I have has a <Web Method> tag, if I try the
> >> other the same way, it just doesn't work and it also
> makes
> >> the first method not being reconized.
> >>
> >> Somebody....please help....let me know what am I missing
> >> in order to have more than one Web Method in a Service.
> >>
> >> Thanks a lot!
> >> JP
> >>
> >>
> >>
> >
> >
> >.
> >