Benjamin Eberlei has a new post today looking at the future of SOAP in PHP for the upcoming year. In his opinion, despite negative comments and harassment the technology gets, it still has the advantage over REST.

These last years REST has gotten all the buzz, everybody seems to be using it and there are lots of talks about REST on conferences. SOAP used to be big for building APIs, but everybody seems to hate it for various reasons. I have used SOAP in several projects over the last 10 years and this blog post is a random collection of information about the state of SOAP in PHP 2014, as a reminder to myself and to others as well. Why care about SOAP in 2014? For server to server (RPC) communication it still has massive time to market and stability benefits over REST.

He points out some things REST lacks like a standard to describe endpoints and a way to automatically generate clients in any language. He then gets into some of the basics of SOAP and PHP's included functionality. He shows some of the configuration options you can use for things like debug output, exceptions and custom exception handlers. He recommends the Zend Frameworks SOAP Autodiscovery for generating WSDLs and the XSD-TO-PHP library to create objects from a well-defined WSDL. He covers the different modes you can use to "talk SOAP" and using the ZendSoapClientLocal to make a request without the need of a web server.

On PHPMaster.com today they've posted the second part of their series looking at creating a SOAP web service with NuSOAP. (Part one is here)

In this article we'll talk about what WSDL files are and how to use them. I'll show you how to quickly build your WSDL files with NuSOAP and incorporate a WSDL file into the SOAP server and client examples from the first part.

He introduces WSDL files, the specially formatted XML definitions that tell SOAP clients what's available on the service and includes some markup as examples. Creating one from scratch ca be a hassle, so it's handy that NuSOAP generates one for you from your server class. He includes sample code to create this generated file and how to create a SOAP client pointed to the PHP script to get the result.

Matthew Turland, in trying to solve a problem from work, needed a way to split out some code into two files to simplify and make it easier to use them individually.

The issue I ran into was due to all the generated PHP classes being housed in a single file. I had to process two WSDL files that had several identical user-defined types in common. As a result, I couldn't simply include the two PHP files generated from them because PHP doesn't allow you to define two classes with the same name.

He used the tokenizer extension to create a simple command-line script that did the splitting for him. This script could potentially be used for splitting out other kinds of files too - "unpacking" them from their combined state. You can download the latest version from Matthew's github account.

Today, whether you realize it or not, websites all around the world use web services to distribute and receive data. In this article we will take a look at what web services are and the basic concepts on how they are implemented and used.

He starts with the basics - XML and how messages are structured, then on to the SOAP format and an example of a simple message sending domain name information to the remote server. He briefly covers WSDL files (the description for the web service's functionality) and UDDI (Universal Description, Discovery and Integration), a structure to provide a directory of SOAP services for developers to choose from.

In this recent post to his blog Bogdan Albei looks at using the Zend Framework to "quickstart" the development of a simple web service.

Web services are software systems designed to support interoperable machine-to-machine interaction over a network. Nowadays if you want to connect external systems, you probably want or have to use web services. What I will discuss here is how to get your own SOAP web service up in minutes.

Bogdan looks at creating a simple controller with actions for displaying a WSDL file and for handling actions that might come in. Sample code is provided as well as example code.

Handling SOAP structures in PHP can sometimes be really annoying. If an interface is defined in the WSDL as returning an array I can't be sure that I will get an array. If there is only one element in the array PHP tries to be clever and turn the wanted array into an object which, too me, isn't really smart. I don't know if this is a problem/limitation on the client side, server side or if it is just me doing something stupid in the wsdl.

He gives an example of the WSDL that was requested and the differing results from a call that returned one Map item verses several (how the objects were returned). In asking for help, it looks like he got some in the comments - an attribute called SOAP_SINGLE_ELEMENT_ARRAYS that can be added to the configuration array when creating the SoapClient object.

On the PHP Web Services blog today, Samiasks "what's missing from PHP's SOAP extension" that needs to be added or corrected.

PHP SOAP extension is good to get started, to play around with. However, it falls much short in meeting the enterprise demands in the SOA era.

He talks about things missing (like binary file features and lots of security features). He also notes something that most PHP developers love about the extension - the WSDL parsing that makes it so easy to simply call a remote service without having to go through the pain of hacking through it yourself.

Tony Bibbstakes a look at an increasingly popular bit of functionality in PHP5, the SOAP extension, and notes that it still has a "ways to go".

In my latest round of web services work in PHP5 I was creating a PHP5 client that interacts with our Java-based ERP. The client needs to be a combination of a couple of WSDL's into one, nice, compact and powerful client. It should be noted this client will be distributed via the State of Iowa PEAR channel so it will undoubted by used by other project in our organization and throughout state government so the result needs to have a lot more fit-and-finish than would be typical.

He mentions his expectations for PHP's usage of the protocol, including the automatic generation of variables/methods/etc to help the developer use the remote application easier.

From the WS02 Oxygen Tank website, there's a new tutorial focused on the use of the PHP SOAP extension in an application:

This article by Samisa Abeysinghe explains the SOAP extension that can be useful in providing and consuming Web services using PHP. He details the classes of extension, two implementation models of Web services, and also lists a 'Hello World with SOAP Extension'.

True to the summary, they start with an introduction to what SOAP is an how the communication with it is performed (via a handy graphic). They move from there on to the different parts of the SOAP connection in PHP - SoapServer, SoapFault, SoapHeader, SoapParams, and the SoapVal classes.

They explain what WSDL is and how to can help and move quickly into their "Hello World" example - a simple SOAP server that returns, what else, "Hello world" to the calling script (providing both the client and server sides of the equation). They include the raw response so you can get an idea of what kind of message is being passed back and forth.

From Netmag.co.uk comes a new tutorial looking at working with SOAP messages and responses with PHP:

This issue, we're going to look at my favourite member of the .net trinity: 'Develop'. When working with Google, we had to use Soap and WSDL, two of the simplest methods of defining a strict API for others to build on. We already used the excellent SoapClient class, but there's an equally excellent SoapServer class that also works with WSDL, and we can combine them to share our content with the world, all thanks to PHP.

They start with a look at a sample WSDL document, briefly explaining what the parts are. Following that there's the simple PHP code allows the built-in PHP SOAP functionality (in PHP5) to create a SOAP server that will output/use that WSDL file when clients connect and a simple client that uses the file to define what it can do.