Hi Everyone,
I am trying to use Ajax to submit an XML Web Service request and receive a response XML. While it works perfectly when I submit these requests directly from the XXXX, YYYY, ZZZZ servers on the intranet. The request gets stuck at .open if I connect from any other server ABCD. However, if I use the url(asmx) to check the connection from a browser on ABCD, I am able to see the list of available web method and the corresponding wsdl file. Not sure why its not letting me submit requests through AJAX.
Apologies if my language is very amateurish as I am not much aware of this stuff. I am not even using localhost or anything in the url.
Please help. I have attached the full HTML file for reference.
Thanks in advance.
Best Regards,
Sriram
var url = document.getElementById("GWSInstance").getAttribute("value");
var mthd = document.getElementById("WebMethod").getAttribute("value");
//Set target node
objXMLHttpRequest.open("POST", url, true);
objXMLHttpRequest.setRequestHeader("Content-Type", "text/xml");
//Set web method to consume
objXMLHttpRequest.setRequestHeader("SOAPAction",mthd);
The corresponding <select> elements in the HTML file are as follows:
<label>Instance:</label>
<select id = 'GWSInstance'>
<option value = 'http://XXXX/GwsIS/IntegrationService.asmx'>http://XXXX/GwsIS/IntegrationService.asmx</option>
<option value = 'http://YYYY/GwsIS138002320/IntegrationService.asmx'>http://YYYY/GwsIS138002320/IntegrationService.asmx</option>
<option value = 'http://ZZZZ/GwsIS/IntegrationService.asmx'>http://ZZZZ/GwsIS/IntegrationService.asmx</option>
</select>
<label>Web Method:</label>
<select id = 'WebMethod'>
<option value = 'http://rebusis.com/webservices/gcs/IntegrationService/ProcessNA'>ProcessNA</option>
<option value = 'http://rebusis.com/webservices/gcs/IntegrationService/ProcessUW'>ProcessUW</option>
<option value = 'http://rebusis.com/webservices/gcs/IntegrationService/ProcessClaim'>ProcessClaim</option>
<option value = 'http://rebusis.com/webservices/gcs/IntegrationService/ProcessAccounts'>ProcessAccounts</option>
</select>