Solved

PHP and Soap

Posted on 2016-10-25
3
51 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
3 Comments
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 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 26

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to send multiple emails at the same time in PHP 12 60
hosting images 4 29
paypal ipn url 5 57
ebay api to see some data about my customers 2 30
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

773 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