PC Review


Reply
Thread Tools Rate Thread

Calling a method from a Web Service

 
 
Steven Blair
Guest
Posts: n/a
 
      9th Feb 2005
Hi,

I have created a simple webservice which will take a string paramter and
return a string. I can run this from the IDE and select the method I
want, then hit Invoke.

I need to call this method automatically. I am using a book which
indicates using this command in my browser:

http://localhost/WebService1/Service1.asmx/HelloWorld?

would allow me to call the meethod automatically. This howerever,
returns the following error:

http://sedna/WebService1/Service1.asmx/HelloWorld?

Obviously, the next step is to pass a parameter in.

Can anyone help me out?

Regards,

Steven



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Dmitriy Lapshin [C# / .NET MVP]
Guest
Posts: n/a
 
      9th Feb 2005
Hi,

Given you haven't restricted the set of allowed protocols to SOAP in the
Web.config, you should be pretty able to invoke the method given the URL
below.
But the arguments should be submitted through a HTTP POST request. You can
navigate to http://sedna/WebService1/Service1.asmx?op=HelloWorld to review
the request details for various protocols.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Steven Blair" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have created a simple webservice which will take a string paramter and
> return a string. I can run this from the IDE and select the method I
> want, then hit Invoke.
>
> I need to call this method automatically. I am using a book which
> indicates using this command in my browser:
>
> http://localhost/WebService1/Service1.asmx/HelloWorld?
>
> would allow me to call the meethod automatically. This howerever,
> returns the following error:
>
> http://sedna/WebService1/Service1.asmx/HelloWorld?
>
> Obviously, the next step is to pass a parameter in.
>
> Can anyone help me out?
>
> Regards,
>
> Steven
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!


 
Reply With Quote
 
=?Utf-8?B?QW5zaWwgTUNBRA==?=
Guest
Posts: n/a
 
      9th Feb 2005
hi steven,

if you want to invoke the web service through a url you have to pass the
parameter to the web method if it has one .You said that your webmethod has a
string parameter

some thing like this
http://localhost/WebService1/Service...d?dg=microsoft


repace the dg in the above query string with your string parameter name



regards
Ansil
Trivandrum

"Steven Blair" wrote:

> Hi,
>
> I have created a simple webservice which will take a string paramter and
> return a string. I can run this from the IDE and select the method I
> want, then hit Invoke.
>
> I need to call this method automatically. I am using a book which
> indicates using this command in my browser:
>
> http://localhost/WebService1/Service1.asmx/HelloWorld?
>
> would allow me to call the meethod automatically. This howerever,
> returns the following error:
>
> http://sedna/WebService1/Service1.asmx/HelloWorld?
>
> Obviously, the next step is to pass a parameter in.
>
> Can anyone help me out?
>
> Regards,
>
> Steven
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Calling Web Service method and GPRS Korwin Microsoft Dot NET Compact Framework 19 16th Nov 2007 10:05 AM
calling a static method in a windows service? KK Microsoft Dot NET Framework 6 20th Apr 2004 04:46 PM
calling a static method in a windows service? KK Microsoft Dot NET 0 14th Apr 2004 08:09 AM
Calling a static method from within a C# windows service causes the service to hang? Microsoft C# .NET 3 15th Mar 2004 03:03 PM
Calling a DeleteDirectory Method from a Web Service Eric Levin Microsoft C# .NET 0 29th Aug 2003 06:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:20 PM.