这可能是一个愚蠢的问题,但这里有
我有一个需要用户登录的 phonegap 应用程序。用户存在于我的 umbraco 安装中。我正在尝试使用此网络服务 /umbraco/webservices/api/MemberService.asmx?op=UserAuthenticates
这是我 phonegap 应用程序中的 javascript
var wsUrl = "http://188.228.44.69/umbraco/webservices/api/MemberService.asmx?op=UserAuthenticates";
var soapRequest = 'POST /umbraco/webservices/api/MemberService.asmx HTTP/1.1 \
Host: 188.228.44.69 \
Content-Type: text/xml; charset=utf-8 \
Content-Length: length \
SOAPAction: "http://umbraco.org/webservices/UserAuthenticates" \
<?xml version="1.0" encoding="utf-8"?> \
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> \
<soap:Body> \
<UserAuthenticates xmlns="http://umbraco.org/webservices/"> \
<username>'+user+'</username> \
<password>'+password+'</password> \
</UserAuthenticates>\
</soap:Body>\
</soap:Envelope>';
$.ajax({
type: "POST",
url: wsUrl,
contentType: "text/xml",
dataType: "xml",
data: soapRequest,
success: function (msg) {
console.log(msg.LoginResult);
},
error: function (msg) {
console.log("nay "+msg);
}
});
但是当我运行代码时,我得到“OPTIONS MemberService.asmx?op=UserAuthenticates - 405 Method Not Allowed”
有谁知道如何解决这一问题?
我在带有 iis 7 的 windows server 2008 上运行 umbraco