I'm trying to POST a SOAP request on a service not under my control.
Since it's cross domain, I need to use a proxy.
I am only using Postman for now.
When I call the service directly, the response is good. But when I add https://myserver:3344/proxy.js? before my service url in postman. The service return me "Server was unable to process request. ---> Root element is missing." meaning that my xml I sent is not good anymore.
Can I have some help with SOAP request using the default proxy coming with WebApp Builder?
Is it supported?
Thanks.
Solved! Go to Solution.
Instead of using the proxy in WAB to handle the cross domain problem, I passed in a service that handle CORS and all is fine now: https://cors-anywhere.herokuapp.com/
I'll setup a cors-anywhere on my client's server but at least I know that works with this one.
Francis,
I have never seen anyone (including myself) able to get a SOAP request through the JS API.
You mean in WAB?
Because I have another application that uses the 3.16 JS API and it works just fine.
Francis,
Well if you were able to do it using the JS API then you should be able to do it using WAB. Can you share your code for how you did a SOAP call successfully?
Pretty straightforward I guess:
var xhr = new XMLHttpRequest();
xhr.open('POST',esri.config.defaults.io.proxyUrl + '?' + this.somumWebURL,true);var soapRequest = (
'<?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:Body>' +
.....................
'</soap:Body>' +
'</soap:Envelope>'
);xhr.onreadystatechange = dojo.hitch(this,function() {
if (xhr.readyState == 4 && xhr.status == 200) {
this.loadSOAPResponse(xhr.responseXML);
} else {
this.setErrorMessage(xhr.status);
}
});xhr.setRequestHeader('Content-Type', 'text/xml; charset=utf8');
xhr.send(soapRequest);
The problem really is the proxy.js included with WAB.
I'm currently trying to find how it process my xml. I'll return with my findings.
Francis,
OK, I thought you meant you were using esriRequest on a SOAP web service.
Francis are you trying to access a CAMA system?
It's a system that automates sms and calls in a city.
I see, I trying to look into accessing out CAMA system from a WAB application and i am not sure how to do i thought maybe you were trying to do that.
CC,
I access CAMA Data but I developed a RESTfull web service to do that, since SOAP is difficult to consume in JS.