[ScriptMethod(UseHttpGet = true)] attribute for Web Methods
i have many method sin web service , methods decorated with
[scriptmethod(usehttpget = true)]
attribte. read msdn article attribute , says can use method if set true.
so, if set attribute true, can call web service follows?
http://<mywebservice>.asmx/<methodname>?param1=value1¶m2=value2
in way beneficial? how make difference web service call make program consume that. kindly let me know example.
thanks,
k.v.n.pavan
so, if set attribute true, can call web service follows? yes, do.
http://<mywebservice>.asmx/<methodname>?param1=value1¶m2=value2
can consume via jquery using post if prefer too:
var params = '{}'; $.ajax({ type: "post", url: "usercontrolsservice.asmx/getusercontrol", data: params, contenttype: "application/json; charset=utf-8", datatype: "json", success: function(msg, status) { $("#resposta").html(msg.d); }, error: function(xhr, msg, e) { alert(msg); } });
in way beneficial? benefical can consume using ajax, , other techologies based on http, without using soap envelope. more information search restful services.
how make difference web service call make program consume that.
if intending consume via .net web reference totally transparent you. but, mentioned below have other ways consume using "get".
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment