Hi Everybody,
Im facing problem in calling Webservice in ASP.NET ATLAS Page.Im trying to invoke a Webservice which is external to my system , in my application as follows:
<atlas:ScriptManagerID="NamSpacescriptManager"EnableScriptComponents="false"runat="server">
<Services>
<atlas:ServiceReferencePath="SimpleService.asmx"/>
<atlas:ServiceReferencePath="http://www.xmlwebservices.cc/ws/v1/calc/SimpleCalc.asmx"/>
</Services>
</atlas:ScriptManager>
function OnAddServiceClick( )
{
var response = SimpleCalc.Add(3,3,Oncomplete,OnTimeOut,OnError);
returnfalse;
}
in this above case, I went thru the WSDL and found the name of Class as SimpleCalc hence was trying to invoke the method ADD , May i know what is wrong in this ,
Or is it ATLAS doesnt support mechanism to invoke a webservice other than local system.
I would also like to know internally how ATLAS is invoking the Webservices, ie, Proxy classes ., how is it done .,
Thanks & Regards
Lohita
It looks like you might have neglected to instantiate the web proxy object in your Javascript, as in the following manner:
var calcSvc = new SimpleCalc();
var request = calcSvc.Add(...);
Is that something new? Because in the February CTP, I was just calling WebMethods like ..
var request = SimpleCalc.Add(...) and it was working fine. I'm about to try instantiating it now, but
I'm wondering again, if that's new .. or if something stranger is going on.
No, this has not changed, and you don't need to instantiate it.
Calling cross domain services is tricky, as it runs into browser security limitations. If the other server is also running Atlas, the March release has some support to make it work. If not, you should look into the new bridge feature (see Atlas docs and samples for details).
thanks,
David
I was actually wrong in my previous post. Your problem here is that you cannot make a web service call to a domain other than that which your page comes from. In order to do this, you must "bridge" the call through your web server using the new Bridge functionality added to the March CTP.
Hi David,
What do you mean by "If the other server is also running Atlas.." Does it mean the external webservice which we call using bridge feature should also have Microsoft.Web.Atlas.dll in its bin directory?
Thx, Vishant
No, I was referring to the ability to call services on a different server directly from the client. The bridge feature always goes through your Atlas server, and has no restrictions on what other servers it can bridge to.
David
No comments:
Post a Comment