Wednesday, March 28, 2012

Atlas Web Service Call

Maybe I am missing something, more than likely. Basically all I am trying to do is call a web service located other than my local machine. So when I add the scriptreference and point the path to a ASMX file inside my project it works fine. However when I point to a ASMX file located on a server somewhere else it says that the Namespace is undefined when I try to make the call. Below is the code..

WORKS
<atlas:ScriptManagerrunat="server"ID="scriptManager">
<Services>
<atlas:ServiceReferencePath="SomeService.asmx"/>
</Services>
</atlas:ScriptManager
DOESN'T WORK
<atlas:ScriptManagerrunat="server"ID="scriptManager">
<Services>
<atlas:ServiceReferencePath="http://demo.somedomain.us/WebServices/SomeService.asmx"/>
</Services>
</atlas:ScriptManager
Web Service Call Script
<scripttype="text/javascript"language="JavaScript">
function OnbuttonGo_click()
{
//Call script proxy passing the input element data
requestWSCall = CP.WSCall.SomeCall(
document.getElementById('AccountNumber').value,//params
document.getElementById('PinCode').value,//params
document.getElementById('NP1').value,//params
document.getElementById('NP2').value,//params
"Windows Gadget",//params
OnComplete,//Complete event
OnTimeout//Timeout event
);
returnfalse;
}

function OnComplete(result)
{
alert(result);
}

function OnTimeout(result)
{
alert("Timed out");
}
</script>

Any ideas? Let me know I am kind of stuck right now trying to figure out whether I will have to place this web application inside the same folder as the web service or can call it remotely. Let me know if I need to show you more of the code.

Thanks!

JoeWeb

Hi Joe,

Can you check fiddler and see if your pages are generating something like a request tohttp://demo.somedomain.us/WebServices/SomeService.asmx/js and if you are getting a response with the proxy? Most likely there's something bad happening with this request... Hopefully it'll be obvious if you look at fiddler,

Hope that helps,
-Hao


Since you are trying to access the web service across domains, it will not work. You have to use a bridge.

Actually in this case, if its atlas to atlas, the iframe executor should work for cross domain atlas -> atlas web services calls, assuming its enabled and configured properly...

But in general for non atlas cross domain web service calls, you would have to use a bridge...

Hope that helps,
-Hao


Hey guys thanks for the quick responses. Yeah actually it basically is inside the same domain. We just have a Web Services box set up and a Web Server set up. So when I need to talk to the Web Services box I had thought about implementing the iframe idea. I hate to have to set up a bridge to talk to a Web Service that is still inside our network just on a separate box. However, given the suggestions I have enough to work with now to accomplish the problem.

Thanks again!
JoeWeb

No comments:

Post a Comment