简体   繁体   中英

YII - Webservice returns WSDL when I request from SOA Client addon

When I post SOAP body to my Yii websevice from SOA client firefox add on, it returns WSDL and not calling the respective method.

How to invoke respective method?

What could be the problem?

See the generated WSDL file : the base URL of the methods exposed by the service is found in the " location " attribute at the file end (eg wsdl:service > wsdl:port > soap:address ).

Sample :

[...]
<wsdl:service name="ServiceProviderService">
<wsdl:port name="ServiceProviderPort" binding="tns:ServiceProviderBinding">
<soap:address location="http://localhost/website/service/soap/ws/1"/>
</wsdl:port>
</wsdl:service>
[...]

The URL provided has " /ws/1 " (or " ?ws=1 ", depending on your application settings) appended to the controller route exposing the Web service.

See CWebServiceAction class reference :

CWebServiceAction serves for two purposes. On the one hand, it displays the WSDL content specifying the Web service APIs. On the other hand, it invokes the requested Web service API. A GET parameter named ws is used to differentiate these two aspects: the existence of the GET parameter indicates performing the latter action.

The GET parameter used is the value of CWebServiceAction::serviceVar property.

So you must append the required GET parameter (eg "ws=1") to the called URL to be able to use your Web method... Or use a "real" SOAP client that will fetch the proper service URL to call a Web method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM