即使允许显式动词,POST wcf Service.svc调用也会失败

时间:2010-12-09 16:21:04

标签: wcf iis-6

我有一个.net CF代理,它发出如下命令:

POST http://192.168.0.172:8080/MIS.WOService/Service.svc HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: http://tempuri.org/IWOService/LogIntoServer
Content-Length: 276
Connection: Keep-Alive
Expect: 100-continue
Host: 192.168.0.172:8080

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><LogIntoServer       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/"><emp_pin>55555</emp_pin></LogIntoServer></s:Body></s:Envelope>

当服务器返回时,调用总是失败:

HTTP/1.1 404 Not Found
Date: Thu, 09 Dec 2010 16:07:14 GMT
Server: Microsoft-IIS/6.0
X-AspNet-Version: 4.0.30319
Cache-Control: private
Content-Length: 0

但是,如果在小提琴手中我将POST改为GET则可以......

我有网站的配置允许svc扩展名上的所有谓词,并且取消选中“验证文件存在”。

是否有人知道IIS 6可能导致此行为的原因?

当我检查IIS日志时,它会显示:

#Date: 2010-12-09 16:24:34
#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-    username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status 
2010-12-09 16:24:34 W3SVC1793831887 192.168.0.172 POST /MIS.WOService/Service.svc - 8080 - 192.168.200.67 - 404 0 0
2010-12-09 16:25:14 W3SVC1793831887 192.168.0.172 POST /MIS.WOService/Service.svc - 8080 - 192.168.200.67 - 404 0 0
2010-12-09 16:25:27 W3SVC1793831887 192.168.0.172 POST /MIS.WOService/Service.svc - 8080 - 192.168.200.67 - 404 0 0
2010-12-09 16:25:48 W3SVC1793831887 192.168.0.172 GET /MIS.WOService/Service.svc - 8080 - 192.168.200.67 - 200 0 0
2010-12-09 16:27:16 W3SVC1793831887 192.168.0.172 POST /MIS.WOService/Service.svc - 8080 - 192.168.200.67 - 404 0 0

显然我需要将名称作为url:

http://192.168.0.172:8080/MIS.WOService/Service.svc/basic

然后服务器开始允许svc接收soap消息......

由于 格雷格

1 个答案:

答案 0 :(得分:0)

我在小提琴手里看到了wcfTestClient发送的请求......

http://192.168.0.172:8080/MIS.WOService/Service.svc/basic

然后服务器开始允许svc接收soap消息......