470,821 Members | 2,104 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,821 developers. It's quick & easy.

web service method calls over http get protocol

SM
Hi,

I have a web service method developed in .Net 1.1 where both http get and
post protocols are enabled.

the problem is that , when i access my web method from ie window like
http://localhost/ws/FindName.asmx/FindName?name="test"&age=30 it returns
results in xml , however , if tried to call the same method in the following
fashion
http://localhost/ws/FindName.asmx/FindName?name="test"&age=
returns an error message right on the ie window with out touching the method.

the error message on the ie window is
Cannot convert n to System.Int32.
Parameter name: type --> Input string was not in a correct format.

I wanted to catch this with in the web method and produce a custom error
message in xml format.

Any help is highly appreciated.

Jun 25 '06 #1
2 2016

In my opinion you shouldn`t do that , as it is standard behavior
a programmer acessing your service can see the error notification in his
response object , if you provide a custom error this might confuse him / her

i guess that the error is thrown by IIS itself before the method is even
called , you can customize these errors but as i said i wouldn`t recomend
it , as it might confuse users of your webservice

regards

Michel Posseth [MCP]

"SM" <SM@discussions.microsoft.com> schreef in bericht
news:1D**********************************@microsof t.com...
Hi,

I have a web service method developed in .Net 1.1 where both http get and
post protocols are enabled.

the problem is that , when i access my web method from ie window like
http://localhost/ws/FindName.asmx/FindName?name="test"&age=30 it returns
results in xml , however , if tried to call the same method in the
following
fashion
http://localhost/ws/FindName.asmx/FindName?name="test"&age=
returns an error message right on the ie window with out touching the
method.

the error message on the ie window is
Cannot convert n to System.Int32.
Parameter name: type --> Input string was not in a correct format.

I wanted to catch this with in the web method and produce a custom error
message in xml format.

Any help is highly appreciated.

Jun 25 '06 #2
It goes without saying that I hate using HTTP GET and POST in web
services but lets assume you have your reasons and try and help you
out.

The only solution I can think of is that you would have to set the age
parameter to a string type which you would then parse yourself and
handle as you wish.

Josh
http://www.thejoyofcode.com/
SM wrote:
Hi,

I have a web service method developed in .Net 1.1 where both http get and
post protocols are enabled.

the problem is that , when i access my web method from ie window like
http://localhost/ws/FindName.asmx/FindName?name="test"&age=30 it returns
results in xml , however , if tried to call the same method in the following
fashion
http://localhost/ws/FindName.asmx/FindName?name="test"&age=
returns an error message right on the ie window with out touching the method.

the error message on the ie window is
Cannot convert n to System.Int32.
Parameter name: type --> Input string was not in a correct format.

I wanted to catch this with in the web method and produce a custom error
message in xml format.

Any help is highly appreciated.


Jun 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by jabailo | last post: by
5 posts views Thread by Marty McDonald | last post: by
23 posts views Thread by Adam Clauss | last post: by
reply views Thread by Dominick Baier | last post: by
2 posts views Thread by Dmitry Markin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.