Stella L.: keine Rückgabe bei SOAP

Beitrag lesen

Hallo Christian

Welchen SOAP-Typ muss ich bei der Methode setText zurückgeben?

Bei void natürlich gar nichts - also return einfach weglassen. Gut, ich kenne Zend_Soap jetzt nicht und weiß nicht was für ein WSDL es generiert und wie es den Rückgabewert einer Funktion genau behandelt, aber return '' gibt Dir einen Leerstring zurück, was garantiert falsch ist. Ich würd's daher mal ohne return probieren.

die return Angabe hatte ich am Anfang weggelassen, danach hatte ich "return void" probiert. Bei beiden Varianten kommt der selbe Fehler.

Zend_Soap_Client meckert nicht rum.

Wenn ich kein return angebe, sieht das generierte wsdl Dokument wie folgt aus

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://example.com/public/wsdl.php" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="HelloWorld" targetNamespace="http://example.com/public/wsdl.php">  
<portType name="HelloWorldPort">  
<operation name="setText">  
<input message="tns:setTextRequest"/>  
<output message="tns:setTextResponse"/>  
</operation>  
<operation name="helloWorld">  
<input message="tns:helloWorldRequest"/>  
<output message="tns:helloWorldResponse"/>  
</operation>  
<operation name="getFruits">  
<input message="tns:getFruitsRequest"/>  
<output message="tns:getFruitsResponse"/>  
</operation>  
</portType>  
<binding name="HelloWorldBinding" type="tns:HelloWorldPort">  
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>  
<operation name="setText">  
<soap:operation soapAction="http://example.com/public/wsdl.php#setText"/>  
<input>  
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>  
</input>  
<output>  
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>  
</output>  
</operation>  
<operation name="helloWorld">  
<soap:operation soapAction="http://example.com/public/wsdl.php#helloWorld"/>  
<input>  
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>  
</input>  
<output>  
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>  
</output>  
</operation>  
<operation name="getFruits">  
<soap:operation soapAction="http://example.com/public/wsdl.php#getFruits"/>  
<input>  
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>  
</input>  
<output>  
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>  
</output>  
</operation>  
</binding>  
<service name="HelloWorldService">  
<port name="HelloWorldPort" binding="tns:HelloWorldBinding">  
<soap:address location="http://example.com/public/wsdl.php"/>  
</port>  
</service>  
<message name="setTextRequest">  
<part name="text" type="xsd:string"/>  
</message>  
<message name="helloWorldRequest"/>  
<message name="helloWorldResponse">  
<part name="helloWorldReturn" type="xsd:string"/>  
</message>  
<message name="getFruitsRequest"/>  
<message name="getFruitsResponse">  
<part name="getFruitsReturn" type="soap-enc:Array"/>  
</message>  
</definitions>

Stella