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