Hi Every body im new to this community,
Im facing problem in calling the webservice from ATLAS Application .
If the WEbservice is in the same solution im able to do it, but when i create a new webservice and try to call in my ATLAS application im not able to do it,
Im getting following Error "
<atlas:ScriptManagerID="NamSpacescriptManager"EnableScriptComponents="false"runat="server">
<Services>
<atlas:ServiceReferencePath="SimpleService.asmx"/>
<atlas:ServiceReference
Path=http://localhost:3505/SimpleCalculator/SimpleCalculator.asmx/>
</Services>
</atlas:ScriptManager>
<scripttype="text/javascript"language="javascript">
function OnAddServiceClick( )
{
var response = SimpleCalculator.Add(3,3,Oncomplete,OnTimeOut,OnError);
returnfalse;
}
</script>
Im getting Error : SimpleCalculator , undefined, can i know what is wrong ...
Regards,
Hi,
The problem is that, a service reference to a web service causes an xmlscript reference in the generated page through a "/js" call to the web service.
If you examineCalling a simple Web Service from an ASPX page quick start sample, when you add
<atlas:ServiceReference Path="SimpleService.asmx" />
to your source, what is rendered as xmlscript is:
<references>
<add src="http://pics.10026.com/?src=SimpleService.asmx/js" />
</references>
Call SimpleService.asmx/js and you will get this piece of javascript:
Type.registerNamespace('Quickstart.Samples'); Quickstart.Samples.SimpleService = new function() { this.path = "http://atlas.asp.net/quickstart/atlas/samples/services/SimpleService.asmx"; var cm=Web.Net.ServiceMethodRequest.createProxyMethod; cm(this,"EchoString","s"); }
So, behind the scenes, Atlas client framework makes a call to the web service, asks the service to describe itself in javascipt and registers a function for you to call later from your code.
But there's no such default "/js" handler in web service world. Instead, Atlas provides necessary handlers in web.config to reply requests for "webservicename.asmx/js". That's why it works when your web service is in the same project with your Atlas GUI project.
If you enable the Atlas handler for .asmx files in your web service project as in your GUI project, it should work fine.
No comments:
Post a Comment