Basic SOAP Example for Zend Framework
This app example based on a prior Zend QuickStart tutorial design and
is for those who want an EASY SOAP style example to get a jump start..
Or want a simple client/server project to build your own app engine...
Or want to engineer a cloud-based platform for your own in-house servers...
But this design is original and does NOT follow other SOAP conventions.
The source samples follow the install text. All source should all be
platform independent: Linux, Windows, Mac, or anywhere you can run ZF.
But this test configuration is Windows/WampServer just for reference.
Easy install instructions (or how I use this app anyway):
1) download and install Zend Framework by putting the Zend folder in a
server directory path (mine is wamp\www). I renamed the current lib
folder to 'Zend' just to keep it simple. And the full or minimal
package works here, but only min is needed for this basic example.
2) add either an include path for the \Zend\library... folder as they
indicate, or copy the \Zend\library\Zend folder into the same library
folder with the rest of this app. The include path in this index.php
start-up file should find either one.
This is what I added to my server's php.ini just for reference:
include_path = ".;c:\wamp\www\zend\library"
(not the php.ini in the php directory, if you edit this manually)
3) install this app folder in the server path. (I put it in ..\Zend also).
4) start/re-start your test server.
5) then run a URL something like this in your browser:
http://localhost/Zend/BasicSOAP/index.php
Yes, you can use simpler URL's with server conf changes but that's up to you.
But .htaccess files are not needed with this.
Here is the default directory structure I use:
\wamp\www\Zend\BasicSOAP...
then:
..\application
..\controllers
..\layouts
..\models
..\views
..\data
..\php
..\text
..\xml
..\library (basically empty, where the Zend folder goes if needed)
..\public
..\css
..\SOAP
This works but I might move the shared files and libs to a more common area
later on.
For Linux, remember to install the php cURL lib with apt-get install curl php5-curl
or similar command in terminal (in this case for Debian-based Ubuntu).
Just another simple ZF example here, but hope this helps. Best of luck.
This software provided "AS IS," but is FREE to use and share.
For details see the Creative Commons license.
Download Basic SOAP for Zend Framework here...
Here are some source samples of what is included. The index is in a Zend Framework
design of course with my simpler directory and include changes plus a bit more.
The DEFINEs carry through to the app content. The server URL is set here, but note
this is for demonstration purposes only. Use the included php to set up your own.
And please note this has only the client/server portion of a SOAP re-design implemented
at this time. But you should find it easy to use and enhance (that's the goal here).
The bootstrap file is similar to the Quick Start design but has only what this app needs.
APPLICATION_PATH needed again for the Zend Framework library...
Uses a fat controller design that includes parameter-based example server calls with
a user id and pw security option. XML support is only built into a cURL lib used here
but a future release might add an XML payload for a full ZF SOAP implementation.
The model contains the SOAP client request translated into a cURL object call.
The layout has the static page information: header, footer plus content
as demonstrated in the Quick Start. I customized it from there.
The view page in this example has the user interaction features.
Content combines with the layout gives you a flexible SOAP ZF design.
This should be apparent when you run the example.
I hope that gives you more info about what MVC and Zend Framework can do for you
with simple PHP SOAP routines added. A few sample data files are in the download with
the PHP cURL Lib source, CSS, and the install text at the top of this page.
If Zend with JavaScript AJAX is what you need instead, try the BasicAjax example...
Download Basic SOAP for Zend Framework here.