【发布时间】:2013-12-09 23:41:13
【问题描述】:
我有一个在 VS2012 中开发的 Metro Winapp,我需要使用一个带有 SOAP POST 类型的 WebService,这是我目前拥有的代码,但我无法让它工作:
function webServTest() {
var options = {
url: "http://XXX.XXX.XX.XXX:XXXX/FILESERVERWS/services/FILESERVERWS?wsdl",
type: "post",
data: '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.mycompany.com">' +
' <soapenv:Header/>' +
' <soapenv:Body>' +
' <ws:uploadFileService>' +
' <ws:filebytes>cid:1206873603250</ws:filebytes>' +
' <ws:fpath>?</ws:fpath>'+
' <ws:filename>?</ws:filename>' +
' </ws:uploadFileService>' +
' </soapenv:Body>' +
'</soapenv:Envelope>'
};
WinJS.xhr(options)
.done(
function (request) {
var output = request.responseText;
xhrDiv.innerHTML = window.toStaticHTML(output);
},
function errorfunction(result) {
xhrDiv.innerHTML = result;
xhrDiv.style.backgroundColor = "#FF0000";
},
function progress(result) {
xhrDiv.innerText = "Ready state is " + result.readyState;
xhrDiv.style.backgroundColor = "#0000FF";
});
}
总是得到相同的结果(错误函数),如何让它工作
【问题讨论】:
标签: web-services visual-studio-2012 microsoft-metro winjs soap-client