Message from discussion
Overzealous Errors
MIME-Version: 1.0
Received: by 10.151.108.10 with SMTP id k10mr342120ybm.29.1217920441298; Tue,
05 Aug 2008 00:14:01 -0700 (PDT)
Date: Tue, 5 Aug 2008 00:14:01 -0700 (PDT)
In-Reply-To: <dc0731e4-21d2-4908-b34d-511ed3f08c9f@34g2000hsf.googlegroups.com>
X-IP: 195.212.29.179
References: <dc0731e4-21d2-4908-b34d-511ed3f08c9f@34g2000hsf.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1.14)
Gecko/20080707 Fedora/2.0.0.14-3.oc2 (CK-IBM) Firefox/2.0.0.14,gzip(gfe),gzip(gfe)
Message-ID: <7468ad03-bf40-49f0-b7d3-fe2839301797@79g2000hsk.googlegroups.com>
Subject: Re: Overzealous Errors
From: Graham Charters <gchart...@googlemail.com>
To: phpsoa <phpsoa@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi Adrian,
I think your problem and the one in the link are different. It looks
to me like the problem you are encountering is because you are trying
to use a PHP interface to describe a complex type, which is not
supported in SCA. All complex types must be described using XSD for
SCA to correctly generate the WSDL (see http://uk2.php.net/manual/en/SCA.examples.structures.php).
At least, this is what SCA thinks you're trying to do. When I look at
SplSubject, it does not describe a data structure, because it is made
up of methods. It looks like you're wanting to be passed an
SplSubject (which would need to be a callback Web service), which you
then call. The only way to call another service using SCA is to have
it injected using the @reference annotation (see
http://uk.php.net/manual/en/SCA.examples.proxies.php). SCA does not
not have support for being passed a reference to another Web service
as part of a service method invocation.
I hope this helps.
Regards, Graham.
On 4 Aug, 15:58, Adrian <anol...@gmail.com> wrote:
> Hello all,
>
> I have the following code which produces this error: Fatal error:
> Uncaught SCA_RuntimeException: Namespace defined in @param not found
> in @types annotation: 'subject' thrown in /usr/share/php5/SCA/
> SCA_AnnotationReader.php on line 305
>
> if I comment out line 305 I get a good WSDL file.
>
> This seems to be somehow related tohttp://groups.google.com/group/phpsoa/browse_thread/thread/1a6aeed8a1...
> because I have to move the include to the bottom of the page.
>
> What is the latest status on this issue? Thanks,
> Adrian
>
> <?php
> /**
> * @service
> * @binding.soap
> */
> class WorkloadManager implements SplObserver {
> public static $status;
> /**
> * @param SplSubject $subject subject class to observe
> * @return bool
> */
> public function update(SplSubject $subject) {
> if($subject instanceof SplSubject) {
> $this->status = $subject->status;
> return TRUE;
> }else {
> return FALSE;
> }
> }}
>
> include "SCA/SCA.php";
> ?>
>
> <wsdl:definitions targetNamespace="http://WorkloadManager">
> <wsdl:types>
> <xs:schema targetNamespace="http://WorkloadManager"
> elementFormDefault="qualified">
> <xs:element name="update">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="subject" type=":SplSubject"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="updateResponse">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="updateReturn" type="xs:bool"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> </wsdl:types>
> <wsdl:message name="updateRequest">
> <wsdl:part name="updateRequest" element="tns2:update"/>
> </wsdl:message>
> <wsdl:message name="updateResponse">
> <wsdl:part name="return" element="tns2:updateResponse"/>
> </wsdl:message>
> <wsdl:portType name="WorkloadManagerPortType">
> <wsdl:operation name="update">
> <wsdl:input message="tns2:updateRequest"/>
> <wsdl:output message="tns2:updateResponse"/>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="WorkloadManagerBinding"
> type="tns2:WorkloadManagerPortType">
> <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> style="document"/>
> <wsdl:operation name="update">
> <soap:operation soapAction=""/>
> <wsdl:input>
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="WorkloadManagerService">
> <wsdl:port name="WorkloadManagerPort"
> binding="tns2:WorkloadManagerBinding">
> <soap:address location="http://workhorse.buttermaker.phptest/
> WorkloadManager.php"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
> <!--
> this line identifies this file as WSDL generated by SCA for PHP. Do
> not remove