views:

30

answers:

2

I want to run a web service method with parameters and get method return value back using JQuery.

ie.

client :

var result = dosomething(var p1, var p2, var p3 ....);

when do something accesses WebService with

dosomewebservice(int p1,int p2, string p3) { return "something" };
result == "something";
+1  A: 

You can access with jQuery a web service marked with attribute [ScriptService].

Example

Elph
thanks, i will use this example
eugeneK
+1  A: 

First of all, does your web service call need to be asynchronous? And do you want to return XML or JSON.

If you're returning a string, use JSON - much faster over the wire. Even though your serializing/deserializing (which causes overhead), the overhead on the server/client is better than the overhead over the wire.

Calling a JSON-web service using jQuery - look at $.getJSON.

RPM1984
end product will not send data back but, i need to send it in order to test. thanks for info anyways
eugeneK