Closed IshaAnjaly closed 8 years ago
Sorry it is not a web service. It is a HttpWebRequest. Please inform if the below code is correct.
$("#btnTestVarian").click(function (event) { debugger; $.get("http://hawaii:3333/invoke/AMAT_iOMS.flows/getSingleOrderBOMFromSAP?SerialNumber=122&SONumber=1212", function (data) { $("#response").html(data); alert("Load was performed."); }); });
Looking at the url you use... http://hawaii:3333/......
my first guess would be you are running into the limitations of Same origin policy
If you followed the instructions about contacting me you already checked that is not the case.... ;)
But still, please read the section on Same Origin Policy and come back at me if that is not casing your problem.....
Best regards
Thank you Remy for the response. I am able to directly access the URL from browser. If I directly give it, I see the XML response on page. But not able to call from Jquery.
Client and the webmethod are in same intranet. Could not identify if its a same origin policy.
Can you please share some article to call HttpWebMethod from the mentioed URL from Jquery?
I am able to call it from C#. NET from code behind. Want to get the data from Jquery.
Thanks Anjaly
I am getting this error
Server Error in '/' Application.
A potentially dangerous Request.Path value was detected from the client (:). Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (:).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (:).] System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +9701768 System.Web.PipelineStepManager.ValidateHelper(HttpContext context) +53
var request = 'http://hawaii:3333/invoke/AMAT_iOMS.flows/getSingleOrderBOMFromSAP?SerialNumber=122&SONumber=1212'; function CallPostService(requestUrl, postData, responseType, callback) { responseType = (responseType) ? responseType : '';
$.ajax({
type: 'POST',
url: encodeURIComponent(requestUrl),// + '&responseType=' + responseType,
dataType: "text",
contentType: 'text/plain;charset=utf-8',
data: null,
success: function (r) {
//callback(r);
document.getElementById('outputDiv').innerHTML = "Success";
},
error: function (e) {
document.getElementById('outputDiv').innerHTML = e.responseText;
}
});
}
still think it is same origin policy..... same intranet is not good enough, same origin policy means both the page you're making the call from and the datasource should be on same protocol (http or https), same server (hawaii) and same port (3333) or else it won't work.... Please use google to learn more about same origin policy and how you can deal with it...
Hi, I have a SAP web service which I need to call from Jquery UI. Here is the webservice link->http://hawaii:3333/invoke/AMAT_iOMS.flows/getSingleOrderBOMFromSAP?SerialNumber=122&SONumber=1212
And here is the method function GetVarianData(){ $.soap({ url: 'http://hawaii:3333/invoke/AMAT_iOMS.flows/', method: 'getSingleOrderBOMFromSAP',
But I am not able to get the data. If try the URL direcrtly in browser, I am getting the XML.
Can you please help here?
Thanks Anjaly