Solved

How do I address a specific function in a web service using AJAX?

Posted on 2011-02-25
3
350 Views
Last Modified: 2012-05-11
Dear Experts!

I am trying to call a SOAP based web service using AJAX.

How do I address a specific function/method in the web service?

And which parameter name should be used for the POST of the SOAP XML?

I do not want to use any js libs.

I expect I should use a parameter for the name of the function/method in the web service, but which name should this parameter have?

The web service is PHP based.

The WS is entirely SOAP based, only using a SOAP request XML message and SOAP reponse XML message.

In anticipation
Thank you

Best regards,
Henrik
0
Comment
Question by:Henrik_Nyholm
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
devlab2012 earned 500 total points
ID: 34980647
you can address a specific as:

http://your_web_service_uri/method_name

see the following link for passing parameters using POST:
http://beradrian.wordpress.com/2007/07/19/passing-post-parameters-with-ajax/

name of parameters should be same as the names used in your web service.
0
 

Author Comment

by:Henrik_Nyholm
ID: 34980840
Dear devlab2012!

Thanks for reply.

Anyway, then how do I make a PHP file accepting '/method_name' as query string?

Thank you,

Henrik
0
 
LVL 13

Expert Comment

by:devlab2012
ID: 34986830
I am not very sure about how it works in PHP, but you can try passing it as a query string variable as follows:

http://mydomain.com/my_web_service.php?MethodName=MyTestMethod

In your php file, you can check the value of MethodName using $_GET["MethodName"] and do the processing accordingly.

Also, check the following link for creating a basic web service in PHP:
http://davidwalsh.name/web-service-php-mysql-xml-json
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

These instructions are based on installing Owncloud on your new raspberry pi connected with a usb HDD. What do you need Part A? A Raspberry Pi, model B. A boot SD card for the Raspberry Pi. A usb HDD An Ethernet cable to connect to the lo…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now