Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Zend Framework Blog:
Implement a SOAP server with zend-soap
Jan 25, 2017 @ 17:22:58

The Zend Framework blog continues on its series of posts showing how to create various types of web services using various components from the framework itself. In this latest post they show you how to implement a SOAP server with zend-soap, a component specifically designed to "create, serve, and access SOAP applications, and parse and generate WSDL".

zend-soap provides a full-featured SOAP implementation. SOAP is an XML-based web protocol designed to allow describing messages, and, optionally, operations to perform. It's similar to XML-RPC, but with a few key differences: arbitrary data structures may be described [and] multiple operations may be described in a message as well.

The post goes on to talk about why they're show how to use these other service types when they primarily use REST in Apigility. It also covers some of the benefits using the module has over PHP's own SOAP handling. From there it's all about the code: first just creating the server and then populating it with the classes and functions it allows. The remainder of the post is split between two other methods for setting up the server: using it in a MVC application and as middleware in something like Zend Expressive.

tagged: zendframework soap server zendsoap tutorial api wsdl mvc middleware

Link: https://framework.zend.com/blog/2017-01-24-zend-soap-server.html

Benjamin Eberlei:
SOAP and PHP in 2014
Jan 31, 2014 @ 15:44:42

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.

tagged: soap rest comparison wsdl soapserver introduction

Link: http://www.whitewashing.de/2014/01/31/soap_and_php_in_2014.html

PHPMaster.com:
Creating Web Services with PHP and SOAP, Part 2
Feb 28, 2012 @ 16:11:25

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.

tagged: webservice soap tutorial nusoap wsdl definition

Link:

Matthew Turland's Blog:
Splitting PHP Class Files
Jan 25, 2010 @ 19:23:56

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.

tagged: tutorial split class file wsdl

Link:

PHPBuilder.com:
A Look Into Web Services
Oct 09, 2009 @ 16:47:05

New from PHPBuilder.com today there's an article from Curtis Dicken introducing web services, specifically SOAP-based ones, in PHP applications.

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.

tagged: webservice soap introduction uddi wsdl

Link:

Bogdan Albei's Blog:
Quickstart web services with SOAP and Zend Framework
May 24, 2009 @ 02:32:00

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.

tagged: tutorial wsdl soap zendframework quickstart

Link:

Danne Lundqvist's Blog:
SOAP structures in PHP
Nov 04, 2008 @ 15:33:14

Danne Lundqvist is frustrated with the SOAP functionality that comes native with PHP on one very specific subject - its handling of SOAP structures.

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.

tagged: soap structure wsdl inconsistent soapsingleelementarrays soapclient php5

Link:

PHP Web Services Blog:
What is Missing in PHP SOAP Extension?
Jan 24, 2008 @ 17:22:00

On the PHP Web Services blog today, Sami asks "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.

tagged: soap extension native wsdl security binary file transfer

Link:

Tony Bibbs' Blog:
PHP5 SOAP Still Has Ways to Go
May 31, 2007 @ 13:44:00

Tony Bibbs takes 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.

tagged: php5 soap extension generation wsdl php5 soap extension generation wsdl

Link:

Tony Bibbs' Blog:
PHP5 SOAP Still Has Ways to Go
May 31, 2007 @ 13:44:00

Tony Bibbs takes 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.

tagged: php5 soap extension generation wsdl php5 soap extension generation wsdl

Link:


Trending Topics: