I need to call a web service and pass it xml and authentication data. Here is what i came up with so far:
var xml ="<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>"
+ "<soapenv:Header/>"
+ "<soapenv:Body>"
+ "..."
+ "</soapenv:Body></soapenv:Envelope>";
var config = {
method: "POST",
url: 'http://....wsdl',
data: xml
};
$http(config).
then(function (data, status, xhr) {
$scope.MyID = data;
}, function errorCallback(xhr) {
//print error to console.
console.log(xhr.responseText);
});
I need to figure out how can I pass in username and password. And also the above gives me an error:
XMLHttpRequest cannot load http://....wsdl. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:' is therefore not allowed access.
The strange part is that when I called the service from .NET the same way, there was no issue with access-control-allow-origin