Re: [PHP] Creating a WebService-Provider using an existing WSDL via SOAP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11 October 2010 14:47, Kai Meder <k.meder@innobis.de> wrote:
> Hello
>
> after having paused any PHP development in the last 2 years I'm just coming back
> to PHP 5.3. Could somebody clarify what the current state of WebService
> Development with PHP is?
>
> We have a rather complex, generated WSDL-Document fully describing a WebService-
> Interface. What is the PHP-way to create a WebService-Provider for this WSDL-
> document? Are there any Code-Generation Tools to create the WSDL-Defined
> Structures and DataTypes?
>
> Any advice appreciated, thanks!
> Kai

Generating a provider is not something I've done in the past.

Well, not from a WSDL file. Instead, I've created my services, added
docblocks and used Zend Framework's AutoDiscover (with some small
patches) to create my WSDL file.

>From there, I've used sourceforge's wsdl2php [1]  and [2] (again, with
some patches - see RazorsEdgeUK's patches on the sourceforge site) to
create my consumer classes.

But creating the server from the WSDL file ... interesting.

To a degree, it won't be a lot different to the consumer side. The
whole point being that the XML and SOAP conversation is all wrapped up
in the classes.

Currently wsdl2php will create all the complex types as classes and a
SoapClient class with all the methods. The code in the methods will be
to take any parameters and push them through to the SoapClient.

>From a SoapServer perspective, it should be just a case of changing
the SoapClient to SoapServer and amending the code in the methods to
do the real work.

I've helped others make client side code using wsdl files. An example is at [3]

As you can see, the main class is simply routing things to SoapClient.

Which routes to SoapServer (eventually) which could route to a class
with methods of the same name.


The way I've described this is how my soap services look. Sure, you
could get fancy with more routing but it works for me.

Regards,

Richard.

[1] http://www.urdalen.no/wsdl2php/
[2] http://pastebin.com/r1BfRysT
[3] http://pastebin.com/8Gq7gD0X

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux