?
Solved

PHP and Soap

Posted on 2016-10-25
3
Medium Priority
?
85 Views
Last Modified: 2016-11-21
Trying to figure out what I don't know and what to ask a vendor.

Trying to consume a private web service.  I have been given a sample request xml file, sample response xml and a wsdl.  Given the private nature of this service I can't provide the sample files.  I know, difficult to help if one can't see specifics.  

General web search shows example of soap client but not sure I understand how to apply.  I have an instance of a new soap client but not sure what to do next.
0
Comment
Question by:SpyderDesigns
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 41859495
First thing to do is ask the publisher of the web service if they have a RESTful interface.  If so, use that instead of SOAP.  If not, ask the publisher of the web service if they have PHP examples.  If so, follow those examples.  If not, look for a different problem to solve.

Some of my colleagues say SOAP is the devil.  I don't go quite that far, but I know from experience that the internet is littered with the rotting husks of failed SOAP projects.  In contrast, I've never met anyone who could not immediately understand and use a REST API.

SOAP, more SOAP, SOAP compared to REST, SOAP after understanding REST, REST
0
 

Author Comment

by:SpyderDesigns
ID: 41860459
Agreed on REST preference.  If I were in a windows environment, I would fire up visual studio and this would probably be an easier.  Thanks
0
 
LVL 27

Expert Comment

by:skullnobrains
ID: 41861997
rest is obviously easier.

with soap, you can use functions such as http://php.net/manual/fr/soapclient.getfunctions.php which will list the available functions and gettypes which will give an idea regarding their parameters... if the doc you have is insufficient printing those 2 arrays and reading through the wsdl usually gives a good hint regarding how to use the api

then you use http://php.net/manual/fr/soapclient.call.php pretty much in the same way you'd use call_user_function() in order to call a local function
1

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

777 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