Showing posts with label assume. Show all posts
Showing posts with label assume. Show all posts

Wednesday, March 21, 2012

Trying to call ASP.NET AJAX WebService JavaScript

Hi,

I am trying to call the generated webservice generated javascript from a non-asp.net application. Is this possible? I would assume one would include http://www.website.net/Service.asmx/js javascript in the not asp.net application, and then make the functions calls. Would this work without a ScriptManager object?

thanks!

-sanjay

Well, you can.

However, you are the one that should make the calls instead of the ScriptManager generated javascript (ScriptResource.axd script page) .



hello.

well, i recommend that you download the js client library and add it to the page (you'll need the main js file: Microsoftajax.js file). you can get it from here the download section of the asp.net ajax site.

after adding references to the js file, you can get a proxy by using the <script> element with the path you 've set up (notice that this will only work if the web site that is hosting the web services is configured to use the asp.net ajax on the server side).


I would add the reference to "Microsoftajax.js" in the non-ASP.net app? One thing I forgot, the application calling the asp.net webservice JS proxy is in a different domain. I am not sure what affect this might have, if any.

thanks!


hello.

1. yes, you shoudl download the library and simply add the js file to your site and then add a script element on your page

2. well, not good :( the client platform has several classes the concept of executor: a "low" level class that will be responsible for making the call. when you get a web service proxy, it'll use an executor to make the call. currently, the only executor available uses the xmlhttprequest to perform the call, which means that you won't be able to do cross-domain calls. if the remote web service returns json (like for example, the yahoo services), you should be abel to leverage the script element to make a call and get the js inserted on the page.