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

King Foo Blog:
Using Complex Type with Zend_Soap
Sep 23, 2011 @ 13:37:10

New from the King Foo blog there's a tutorial showing how to use complex types in a SOAP request with Zend_Soap, a component of the Zend Framework.

To be able to use complex types with Soap requests, they need to be fully defined in the WSDL file. Zend_Soap can automate this process, if you know how to define those complex types. Let us start without it Zend_Soap's magic and compare it with a fully discovered complex request type afterwards.

In their example, they have a collection of books (objects) that they want to send over to the web service. The code for both the server and client side are included with the WSDL automagically created by the Zend_Soap_Server component. By setting docblock comments on the properties of the Book objects, the SOAP components automatically know what types they are. Their example defines these, and sets up the web service on the other side with a classmap to define where the "tags" information for each book lies.

tagged: zendsoap soap zendframework component autodiscover docblock

Link:

PHPRiot.com:
Zend Framework 101: Zend_Soap
Aug 10, 2009 @ 17:09:27

PHPRiot.com is back with another installment in their "Zend Framework 101" series with a look at the Zend_Soap component to create a SOAP service and client.

In this article I will introduce you to the Zend_Soap component of the Zend Framework. This component allows you to easily create and consume SOAP web services. We will create a simple web service with several methods using Zend_Soap_Server, and consume the service with Zend_Soap_Client.

They start with a brief look at how SOAP works before moving on to the code - creating the SOAP server code followed by the client. Their simple application takes in age information and returns back a simple, formatted string.

tagged: zendsoap tutorial zendframework

Link:

Benjamin Eberlei's Blog:
Using Zend_Soap Server and Autodiscover in a Controller
Mar 23, 2009 @ 17:03:10

Benjamin Eberlei has an example posted to his blog of a use of Zend_Soap_Server and Zend_Soap_AutoDiscover in more of a Model/View/Controller setup.

The following example provides you with a working Soap server inside a Zend_Controller_Action, although I discourage the use of it and would suggest using a dedicated script outside the dispatching process to gain multitudes of performance, which webservices often require.

His setup request two routes to be added - one that points "server" to "serverActioin" and the other that points "wsdl" to "wsdlAction".

tagged: zendsoap mvc example zendsoapserver zendsoapautodiscover

Link:


Trending Topics: