日期:2014-05-20  浏览次数:20913 次

FORM验证的WEB服务页面,无法使用POST方式执行其中的函数...
<authentication   mode= "Forms ">
<forms   name= ".ASPXFORMSAUTH "  
loginUrl= "SignInService.asmx "  
cookieless= "UseCookies "  
timeout= "40 ">
</forms>
</authentication>
<authorization>
<deny   users= "? "/>
</authorization>

web.config中配置form验证如上


在SignInService.asmx中有个默认的HelloWorld函数
执行返回的字符串HelloWorld

该函数使用SOAP方式调用没有任何问题
当使用POST方式时如下
POST   /WebService/ClientUser/SignInService.asmx/HelloWorld
返回的是页面跳转信息   请问该问题如何解决
开发环境C#2005

------解决方案--------------------
<authentication mode= "Forms ">
<forms name= ".ASPXUSERDEMO " loginUrl= "SignInService.asmx " protection= "All " timeout= "30 "/>
</authentication>
<authorization>
<deny users= "? "/>
</authorization>
试试

------解决方案--------------------
默认情况下,webservice是不支持get/post调用的,主要是为了安全考虑..

你是否设置让它支持post调用呢?

在web.config中这样来设置:

<?xml version= "1.0 "?>
<configuration xmlns= "http://schemas.microsoft.com/.NetConfiguration/v2.0 ">
<system.web>
<compilation defaultLanguage= "c# " debug= "true "/>

<webServices>
<protocols>
<add name= "HttpGet "/>
<add name= "HttpPost "/>
</protocols>
</webServices>


</system.web>
</configuration>

即加上这么一段:
<webServices>
<protocols>
<add name= "HttpGet "/>
<add name= "HttpPost "/>
</protocols>
</webServices>

仅供参考...

------解决方案--------------------
顶一下 了
------解决方案--------------------
当使用POST方式时如下
POST /WebService/ClientUser/SignInService.asmx/HelloWorld
返回的是页面跳转信息

不太明白,你的返回是什么意思
------解决方案--------------------