Re: Generating PHP from WSDL
| From: | Richard Quadling | Date: | Wed, 12 May 2010 12:36:55 +0000 |
| Subject: | Re: Generating PHP from WSDL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-305123@lists.php.net to get a copy of this message | ||
On 12 May 2010 11:53, Gary . <php-general@garydjones.name> wrote:
> Let's if anyone can come up with a non-brittle solution to this.
>
> In order to create the framework code for a webservice client I
> have generated it from the server's wsdl. Unfortunately the wsdl
> (which is out of my control) tries to use "extension base=..."
> to say that 'B' "extends"/"inherits from " 'A', and the
> tool I
> use doesn't understand it, with the result that the generated
> code doesn't include that relatonship, and so sending a 'B' to
> the webservice doesn't work because it doesn't also include the
> expected properties of 'A'.
>
> Possible solutions I have thought of are:
>
> * create 'C', inheriting from 'A' and 'B' and send one of those
> instead, but of course php doesn't support multiple-inheritance;
>
> * manually change 'B' so that it does inherit from 'A'. I don't
> like this because if the wsdl changes then that client-side
> code needs to again be changed manually.
>
> * use composition instead. Doesn't seem it will work because the
> marshalling of the objects seems to want to use the properties
> directly (i.e. instead of using getters as it "should" do).
>
> Does anyone have any other ideas?
>
> Are there any generators out there that handle something like:
> <s:complexType name="B">
> <s:complexContent mixed="false">
> <s:extension base="tns:A">
> ...
> </s:complexType>
> and produce nusoap client code?
Can you provide a URL for the wsdl file please?
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling