1
即时通讯在这个领域的新技术,我正在做一个apprentienship,这个appreintienship的目标,正在制作一个应用程序,从一个运行SOAP的服务器检索数据(不幸),这是我第一次请求开发者'关于服务器内的所有者的一些信息。这个调用不起作用(我肯定在我的代码中写了sh * t),我不知道如何改正它并做出更好的SOAP调用。 下面的代码AngularJS SOAP调用
var myApp = angular.module('myApp', []);
myApp.controller('myCtrl', function($scope,$http) {
var sr =
'<?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:Header>' +
'<AuthHeader xmlns="Logisense_EngageIP">' +
'<Username>admin</Username>' +
'<Password>admin</Password>' +
'</AuthHeader>' +
'</soap:Header>' +
'<soap:Body>' +
'<GetOwnersUsers xmlns="Logisense_EngageIP">' +
'<ownerUsername>string</ownerUsername>' +
'</GetOwnersUsers>' +
'</soap:Body>' +
'</soap:Envelope>';
var soapResponse = null;
function makeSoap(){
$http.post('31.44.16.67/GetOwnersUsers', sr)
.success(function(data) {
soapResponse = data;
$scope.response = soapResponse;
});
}
$scope.callSoap = function(){
$scope.soapRequest = sr;
makeSoap();
};
});
感谢大家对anticipately技巧和提示!
感谢您的回复,所以我需要只写这个来执行肥皂呼叫?或者我需要添加其他的东西,比如我想要执行的肥皂请求? – Wallcraft
在我评论的工作时间内,我做到了这一点,并且我得到了一些令我沮丧的错误,无法跟上这个实习生的步伐。 这里是代码的punlker,你能帮我摆脱这个吗? https://plnkr.co/edit/ThP70IqhwhQumPd686Nw?p=info – Wallcraft
编辑: 最后,我可以与服务器交流,他否认我的所有要求,但至少我可以交流(这是一大进步)。现在的问题是服务器运行SSL,所以我需要验证自己。我该怎么做?我使用了之前链接的角度肥皂库。这是重新编写的代码。 https://plnkr.co/edit/ThP70IqhwhQumPd686Nw?p=info 感谢您的帮助! – Wallcraft