I'm making a request using AngularJs
in Ionic
with a soap method, my response is in XML. After request I have an error in the console; please help me I don't know much about AngularJs
and Ionic
.
<WSTransferOfListOfWSListItem>
<Message/>
<Success>true</Success>
<ProcessTime>748.8048</ProcessTime>
<ReturnObject>
<WSListItem>
<Selected>false</Selected>
<Text>A KWIK FUEL</Text>
<Value>KWIKFUEL</Value>
</WSListItem>
<WSListItem>
<Selected>false</Selected>
<Text>WILSON FARMS</Text>
<Value>WILSON</Value>
</WSListItem>
</ReturnObject>
<ResponseStatus>
<Success>false</Success>
<ProcessTime>0</ProcessTime>
<MessageType>Warning</MessageType>
</ResponseStatus>
</WSTransferOfListOfWSListItem>
I'm getting that console result is [object Object]
, how to solve this issue?
This is my code:
.controller('LoginCtrl', function($scope, $soap) {
$scope.user= {};
$scope.login = function() {
if (typeof $scope.user.username == "undefined") {
alert("Please enter username");
} else if (typeof $scope.user.password == "undefined") {
alert("Please enter password");
} else {
$soap.post("http://abc.asmx","AccountList",
{UserName: $scope.user.username, Password: $scope.user.password, DeviceId: "E3-2A-6A-42-6D-C9-26-4F-10-A9-2C-3E-58-7D-00-2E-89-23-99-DD"})
.then(function(response)
{
$scope.response = response.data;
console.log(response);
});
}
};
})
Thank you