【发布时间】:2015-02-05 06:33:13
【问题描述】:
我已经创建了asmx服务,如何通过“URL”调用它?
这是我的代码:
[WebMethod]
public string start(string id, string name)
{
string newname = name;
return newname;
}
这是我当前的网址:
url = "http://localhost:XXXXX/WebService.asmx/start?id=" +id+ "&name="+name;
这是我的“Web.config”:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5">
</compilation>
<httpRuntime maxRequestLength="1000000"/>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
<system.webServer>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
【问题讨论】:
标签: c# asp.net web-services rest