My webservice is hosted on one domain and my SharePoint site on another domain. I wanted to access my web service methods from client script (in SharePoint). What I am doing is
- Added reference of Web Service to my SharePoint project.
- Added an Application page.
- Created a Web Method in application page.
- This web method further access my web service method.
- From my client script I access my application page's web method.
Is this the right way to access a web service from client script?
Or can we directly access web service without any server side code or adding reference of web service? and having no cross domain issues