Solved

PHP and Soap

Posted on 2016-10-25
3
29 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 108

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 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…

759 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

23 Experts available now in Live!

Get 1:1 Help Now