Hi, i’m Luca from Italy… this is my first post
I’m trying to develop an application with soap.
I’ve copied the example in Yii documentation and it works, but if i change the “getPrice” function to “getPricex” or something else, i have an error “method not found”!
Here is my controller:
<?php
class Gc_soapController extends CController
{
public function actions()
{
return array(
'quote'=>array(
'class'=>'CWebServiceAction',
),
);
}
/**
* @param integer
* @return string
* @soap
*/
public function getPricex($prezzo)
{
return 'hello';
}
}
This is the function who calls the method (in another controller):
public function actionSapone() {
$client=new SoapClient('http://reggio-emilia.shoppyday.com/index.php/gc_soap/quote');
echo $client->getPricex(22);
}
and this is the XML generated in "http://reggio-emilia.shoppyday.com/index.php/gc_soap/quote":
<definitions name="Gc_soapController" targetNamespace="urn:Gc_soapControllerwsdl">
−
<wsdl:message name="getPricexRequest">
<wsdl:part name="prezzo" type="xsd:integer"/>
</wsdl:message>
−
<wsdl:message name="getPricexResponse">
<wsdl:part name="return" type="xsd:string"/>
</wsdl:message>
−
<wsdl:portType name="Gc_soapControllerPortType">
−
<wsdl:operation name="getPricex">
<wsdl:documentation/>
<wsdl:input message="tns:getPricexRequest"/>
<wsdl:output message="tns:getPricexResponse"/>
</wsdl:operation>
</wsdl:portType>
−
<wsdl:binding name="Gc_soapControllerBinding" type="tns:Gc_soapControllerPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
−
<wsdl:operation name="getPricex">
<soap:operation soapAction="urn:Gc_soapControllerwsdl#getPricex" style="rpc"/>
−
<wsdl:input>
<soap:body use="encoded" namespace="urn:Gc_soapControllerwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:input>
−
<wsdl:output>
<soap:body use="encoded" namespace="urn:Gc_soapControllerwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
−
<wsdl:service name="Gc_soapControllerService">
−
<wsdl:port name="Gc_soapControllerPort" binding="tns:Gc_soapControllerBinding">
<soap:address location="http://reggio-emilia.shoppyday.com/index.php/gc_soap/quote/ws/1"/>
</wsdl:port>
</wsdl:service>
</definitions>
If i change method name from getPricex to getPrice ALL WORKS perfectly.
Hope someone reply
Thanks