Accessing Webservice thru Http-Get

M

magister pips

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...
 
J

John Saunders [MVP]

magister pips said:

Did you write the parameter names wrong also, because I don't see a "cId" or
"bID" here.
 
A

Andrew Brook

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


magister pips said:
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";
}



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/MyServi...ice/MyService.asmx?op=UpdateCandidate&cId=913...

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...
 
M

magister pips

Yes I have

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




return "done";
}
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=80......
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...- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top