CWebServiceAction
CWebServiceAction implements an action that provides Web services.
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.
By default, CWebServiceAction will use the current controller as
the Web service provider. See
CWsdlGenerator on how to declare
methods that can be remotely invoked.
Note, PHP SOAP extension is required for this action.
Public Properties
Hide inherited properties
| Property | Type | Description | Defined By |
| classMap |
array |
a list of PHP classes that are declared as complex types in WSDL. |
CWebServiceAction |
| controller |
CController |
the controller who owns this action. |
CAction |
| id |
string |
id of this action |
CAction |
| provider |
mixed |
the Web service provider object or class name. |
CWebServiceAction |
| service |
CWebService |
Returns the Web service instance currently being used. |
CWebServiceAction |
| serviceOptions |
array |
the initial property values for the CWebService object. |
CWebServiceAction |
| serviceUrl |
string |
the URL for the Web service. |
CWebServiceAction |
| serviceVar |
string |
the name of the GET parameter that differentiates a WSDL request
from a Web service request. |
CWebServiceAction |
| wsdlUrl |
string |
the URL for WSDL. |
CWebServiceAction |
Property Details
public array $classMap;
a list of PHP classes that are declared as complex types in WSDL.
This should be an array with WSDL types as keys and names of PHP classes as values.
A PHP class can also be specified as a path alias.
public mixed $provider;
the Web service provider object or class name.
If specified as a class name, it can be a path alias.
Defaults to null, meaning the current controller is used as the service provider.
If the provider implements the interface IWebServiceProvider,
it will be able to intercept the remote method invocation and perform
additional tasks (e.g. authentication, logging).
Returns the Web service instance currently being used.
public array $serviceOptions;
the initial property values for the CWebService object.
The array keys are property names of CWebService and the array values
are the corresponding property initial values.
public string $serviceUrl;
the URL for the Web service. Defaults to null, meaning
the URL for this action is used to provide Web services.
In this case, a GET parameter named serviceVar will be used to
deteremine whether the current request is for WSDL or Web service.
public string $serviceVar;
the name of the GET parameter that differentiates a WSDL request
from a Web service request. If this GET parameter exists, the request is considered
as a Web service request; otherwise, it is a WSDL request. Defaults to 'ws'.
public string $wsdlUrl;
the URL for WSDL. Defaults to null, meaning
the URL for this action is used to serve WSDL document.
Method Details
protected CWebService createWebService(mixed $provider, string $wsdlUrl, string $serviceUrl)
|
| $provider |
mixed |
the web service provider class name or object |
| $wsdlUrl |
string |
the URL for WSDL. |
| $serviceUrl |
string |
the URL for the Web service. |
| {return} |
CWebService |
the Web service instance |
Creates a CWebService instance.
You may override this method to customize the created instance.
Returns the Web service instance currently being used.
Runs the action.
If the GET parameter serviceVar exists, the action handle the remote method invocation.
If not, the action will serve WSDL content;