Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > How I get my WebService to handle url encoded parameters

Reply
Thread Tools

How I get my WebService to handle url encoded parameters

 
 
Bob the coder
Guest
Posts: n/a
 
      11-25-2003
I have a webservice like so:

[WebMethod]
public string EnterTheNumber(int number)
{ return "Incorrect! Try again!"; }

'Accessing XML Web Services from a Browser' in the .NET
Framework Developer's Guide describes how
'http://servername/vdir/webservicename.asmx/Methodname?
parameter=value'
should work.

But if I try:
'http://localhost/WebService1/Service1.asmx/EnterTheNumber?
number=5'
I get an 'Request format is unrecognized' exception.

Bob, the coder
 
Reply With Quote
 
 
 
 
Chris Marchal[MSFT]
Guest
Posts: n/a
 
      11-26-2003
The default for ASP.NET in the 1.0 Framework was to have all request
methods (SOAP, POST and GET) enabled by default. In the 1.1 Framework the
GET method is disabled. To enable it for this particular web service, add
the following to the web.config under the system.web node:

<webServices>
<protocols>
<add name="HttpGet"/>
</protocols>
</webServices>

This can be confirmed when debugging the service as the debug test pages
will now include the GET method in its examples.

Chris Marchal
Microsoft UK Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
 
Bob the Coder
Guest
Posts: n/a
 
      11-27-2003
Thanks Chris,

I found the details in 'Configuration Options for XML Web
Services Created Using ASP.NET' in MSDN. I had overlooked
the changes since 1.0.

Bob, the Coder

>-----Original Message-----
>The default for ASP.NET in the 1.0 Framework was to have

all request
>methods (SOAP, POST and GET) enabled by default. In the

1.1 Framework the
>GET method is disabled. To enable it for this particular

web service, add
>the following to the web.config under the system.web node:
>
><webServices>
> <protocols>
> <add name="HttpGet"/>
> </protocols>
></webServices>
>
>This can be confirmed when debugging the service as the

debug test pages
>will now include the GET method in its examples.
>
>Chris Marchal
>Microsoft UK Developer Support
>This posting is provided "AS IS" with no warranties, and

confers no rights.
>
>.
>

 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Ahhh.. URL wants to get encoded. Does Java wanna? =?iso-8859-1?B?RnJhbudvaXM=?= Java 11 11-06-2007 09:32 PM
how to handle with the worng url parameters? moshe ASP General 3 05-24-2005 05:49 PM
Consume RPC/Encoded webservice from ASP.NET double,integers,boolean problem Pokkie ASP .Net Web Services 1 05-06-2005 04:54 PM
redirect URL's, return URL's, and URL Parameters Jon paugh ASP .Net 1 07-10-2004 05:29 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57