0

There's a web service, for example this http://www.w3schools.com/webservices/tempconvert.asmx

How to invoke its web methods from javascript?

1 Answer 1

1

Due to same origin policy restriction you cannot invoke it with javascript as this web service is not hosted on the domain where your script will be served from. In order to invoke it you will need to setup a server side script on your domain which invokes the service and then send an AJAX request to your script.

Sign up to request clarification or add additional context in comments.

2 Comments

I can put only html page on client side. How can it interact with server?
@Ilya Blokh, this HTML is coming from a web server, isn't it? This web server can run some server side language (PHP, ASP.NET, Java, ...) It is this language that you should use to query the remote web service. As I stated in my answer you cannot use pure HTML and javascript to invoke a remote domain web service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.