Groups | Blog | Home
all groups > asp.net webservices > september 2007 >

asp.net webservices : Accessing Webservice thru Http-Get


magister pips
9/20/2007 3:57:42 AM
there is no example in the webservice description of how to access a
WebService Method with Http-Get with a URL in ASP.NET 2.0

I have tried:

http://localhost/WebService/MyService.asmx/UpdateUser?cId=9130&bID=808101
http://localhost/WebService/MyService.asmx/UpdateCandidate/cId=9130&bID=808101
http://localhost/WebService/MyService.asmx/UpdateCandidate/?cId=9130&bID=808101
http://localhost/WebService/MyService.asmx?op=UpdateCandidate&cId=9130&bID=808101

Always just get:
"Request format is unrecognized for URL unexpectedly ending in " &


The Webservice is simple:

[WebMethod]
public string MyService(int candidateId, string bondID)
{
customer MyCandidate = CustomerMapper.Instance.Get(cId);

......



return "done";
}

In the application web.config I have the following:

<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
<add name="HttpSoap"/>
<add name="Documentation"/>
</protocols>
</webServices>


How do I do this...
magister pips
9/20/2007 4:55:11 AM
Whoops wrote that wrong

http://localhost/WebService/MyService.asmx/UpdateUser?cId=9130&bID=80...
http://localhost/WebService/MyService.asmx/UpdateUser/cId=9130&b...
http://localhost/WebService/MyService.asmx/UpdateUser/?cId=9130&...
http://localhost/WebService/MyService.asmx?op=UpdateUser&cId=913...

[WebMethod]
public string UpdateUser(int candidateId, string bondID)
{
customer MyCustomer = CustomerMapper.Instance.Get(cId);
......

return "done";
}



[quoted text, click to view]

John Saunders [MVP]
9/20/2007 1:20:53 PM
[quoted text, click to view]

Did you write the parameter names wrong also, because I don't see a "cId" or
"bID" here.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Andrew Brook
9/24/2007 3:03:06 PM
I've seen this error message before when the webservice has not been
configured to accept the HTTP GET protocol. Have you tried adding the
following lines into your web.config?

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

These should be placed inside the <system.web> tags.

Andrew


[quoted text, click to view]

magister pips
9/25/2007 6:41:44 AM
Yes I have

[quoted text, click to view]

AddThis Social Bookmark Button