Re: Using complex types with PHP5 SOAP functions?

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

 



Knut Urdalen wrote:
1. Is the way i described the right way to use complex types?

I use classes for that where the classname is the name of the
complexType and public member variables as each element in the sequence
of the complexType. Use the classmap option in SoapClient construct to
map WSDL types to PHP classes. If not a WSDL type is presented in
classmap you'll get an stdClass in return.

How do you use that option and how does it work? I can't find anything on this matter in the PHP-documentation...

The __getTypes method can also help with defining the classes, but i haven't used it.

So i'd appreciate if someone could give me a brief intoduction on how
everything works together, i mean how to use the WSDL to build your app
around it. Which classes do i have to define, and how can i extract them
from the response.

I use wsdl2php (http://wsdl2php.sf.net) to generate my initial PHP code,
I'm rewriting the whole tool at the moment with a lot of interop tests,
but the 0.2 version should do ok as an initial code generator in most
circumstances. I find it easier this way when approaching a new WSDL
file. You'll see right from the code what functionality is available. I
haven't experimented with additional soap headers in __soapCall since
the 0.2 version is using the native proxy solution. The next version
will use both __soapCall and classmap more extensively.

I'll definately take a look at your tool, sounds great. However, we solved most problems. But I doubt it is the best (or intended) method to do this... Right now, almost all data is in multidimensional arrays, even where complextypes should be used. The SOAP-extension maps them correctly to form a valid request XML. However, at some places classes are needed, but not as i described with soapVars, just private or public members.

The response is always a stdObject, due to the lack of fitting classes i guess, but as we only need the response XML to transform it via XSLT, this is not important.

All i can say, is that the SOAP-extension is still VERY EXPERIMENTAL! some things worked better in PHP5.0.3 than 5.0.4, others worked ONLY in 5.0.5... :-/


Regards, Oliver

--
There are only 10 types of people: those who understand binary and those who don't...

--
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