system system.base system.caching system.caching.dependencies system.collections system.console system.db system.db.ar system.db.schema system.db.schema.mssql system.db.schema.mysql system.db.schema.oci system.db.schema.pgsql system.db.schema.sqlite system.i18n system.i18n.gettext system.logging system.utils system.validators system.web system.web.actions system.web.auth system.web.filters system.web.helpers system.web.renderers system.web.services system.web.widgets system.web.widgets.captcha system.web.widgets.pagers

CWebServiceAction

system.web.services
继承 class CWebServiceAction » CAction » CComponent
实现 IAction
可用自 1.0
版本 $Id$
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.

公共属性

隐藏继承的属性

属性类型描述被定义在
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

公共方法

隐藏继承的方法

方法描述被定义在
__call() Calls the named method which is not a class method. CComponent
__construct() Constructor. CAction
__get() Returns a property value, an event handler list or a behavior based on its name. CComponent
__isset() Checks if a property value is null. CComponent
__set() Sets value of a component property. CComponent
__unset() Sets a component property to be null. CComponent
asa() Returns the named behavior object. CComponent
attachBehavior() Attaches a behavior to this component. CComponent
attachBehaviors() Attaches a list of behaviors to the component. CComponent
attachEventHandler() Attaches an event handler to an event. CComponent
canGetProperty() Determines whether a property can be read. CComponent
canSetProperty() Determines whether a property can be set. CComponent
detachBehavior() Detaches a behavior from the component. CComponent
detachBehaviors() Detaches all behaviors from the component. CComponent
detachEventHandler() Detaches an existing event handler. CComponent
disableBehavior() Disables an attached behavior. CComponent
disableBehaviors() Disables all behaviors attached to this component. CComponent
enableBehavior() Enables an attached behavior. CComponent
enableBehaviors() Enables all behaviors attached to this component. CComponent
getController() CAction
getEventHandlers() Returns the list of attached event handlers for an event. CComponent
getId() CAction
getService() Returns the Web service instance currently being used. CWebServiceAction
hasEvent() Determines whether an event is defined. CComponent
hasEventHandler() Checks whether the named event has attached handlers. CComponent
hasProperty() Determines whether a property is defined. CComponent
raiseEvent() Raises an event. CComponent
run() Runs the action. CWebServiceAction

受保护的方法

隐藏继承的方法

方法描述被定义在
createWebService() Creates a CWebService instance. CWebServiceAction

属性详情

classMap 属性
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.

provider 属性
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).

service 属性 只读

Returns the Web service instance currently being used.

serviceOptions 属性
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.

serviceUrl 属性
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.

serviceVar 属性
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'.

wsdlUrl 属性
public string $wsdlUrl;

the URL for WSDL. Defaults to null, meaning the URL for this action is used to serve WSDL document.

方法详情

createWebService() 方法
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.

getService() 方法
public CWebService getService()
{return} CWebService the Web service instance

Returns the Web service instance currently being used.

run() 方法
public void run()

Runs the action. If the GET parameter serviceVar exists, the action handle the remote method invocation. If not, the action will serve WSDL content;