Solved

PHP and Soap

Posted on 2016-10-25
3
75 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 110

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 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

Independent Software Vendors: 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 times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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.

705 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