I’ve been looking for an example of a 1.1 web service getting called using jQuery. I’d like to call a web service and pass a few parameters to it.
Can someone point me in the right direction?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Without more details on the web service, the generic answer is ‘use an AJAX call‘. The example below sends data in a JSON format, and retrieves JSON data back.
There are some peculiarities sometimes on sending the data, if you need to send data.
UPDATE: Given John Saunder’s post, I thought I’d expand on the last sentence. ASP.NET v1.1 accepts (by default) HTTP GET, HTTP POST or HTTP SOAP. What one particular web service is set to accept basically dictates how the whole AJAX request must be sent to the web service. Using jQuery, you are mainly going to go to HTTP GET or HTTP POST. (Unless you get fancy and set
processData: false. You then create and send your SOAP-formatted (XML) data and set content-type totext/xml, but I’ve never done this, so I am unsure of the details.)