December 11, 2001 - Restrictions in Calling Web Services | WebReference

December 11, 2001 - Restrictions in Calling Web Services

Yehuda Shiran December 10, 2001
Restrictions in Calling Web Services
Tips: December 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

You have probably noticed that there are restrictions in calling Web services. Try copying example.html and webservice.htc to your client machine. You can call the EchoService Web service on (soap.bluestone.com), by clicking one of the two buttons. It works fine.

Now try loading example.html from our server (www.webreference.com) directly to your Web browser. Click on the first button to call the EchoService Web service on (soap.bluestone.com). You will get a script error. It's a result of the fact that the WebService behavior will not work when the page resides on a server (www.webreference.com) and is downloaded to a client machine (your machine), where the page tries to call a service residing on a server in a different domain (soap.bluestone.com) than the first server. This scenario is represented by the diagram below (from Microsoft):

This result is a consequence of the cross-domain restriction built into the browser.