function Login() { debugger; var LoginInfo = JSON.stringify({ "strAccountName": "#####", "strPassword": "######", "strDeviceId": "###############" }); var strUriGet = "https://service.domain.com/OneView/dev/OneviewClient.svc/Login"; $.ajax({ type: "POST", url: strUriGet, data: LoginInfo, contentType: "application/json; charset=utf-8", dataType: "json", async: false, processData: true, success: function (data, status, jqXHR) { debugger; alert("success..." + data); }, error: function (xhr, status, exception) { debugger; alert(xhr.responseText); } }); }
上面的方法我打电话来登录服务,我能够使用HttpClient.PostJsonAsAsync消耗服务,但我无法使用jquery ajax调用消耗服务,我接收状态代码200但响应为空。 服务托管在具有https(具有有效证书)的子域中,我的wcf服务是安静的。我已将安全模式设置为“Transport”。