Solved

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

Posted on 2011-02-25
3
352 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
.php tree directory? 5 57
Method for submitting dynamically created rows 20 18
how to avoid redundand ajax calls 5 11
How to count in a table in php 22 19
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

863 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

24 Experts available now in Live!

Get 1:1 Help Now