get和post方式调用websevice

在<system.web>节点中添加
<webServices>
<protocols>
<add name= "HttpPost " />
<add name= "HttpGet " />
</protocols>
</webServices>

然后就可以用 http://www.test.com/TestService.asmx/[方法名]?[参数]=[参数值]

调用webservice了。

也可以

<form id="form1" method="get" action="http://www.test.com/TestService.asmx/GetFromatString">
<input type="text" name="str" size="50">
<input type="submit" class="button" value="调用">
</form>

<form id="form1" method="post" action="http://www.test.com/TestService.asmx/GetFromatString">
<input type="text" name="str" size="50" >
<input type="submit" class="button" value="调用">
</form>



注意:WebService Get调用不安全,所以MS默认是不启用的

你可能感兴趣的:(post)