CWebServiceAction
包 | system.web.services |
---|---|
继承 | class CWebServiceAction » CAction » CComponent |
实现 | IAction |
可用自 | 1.0 |
版本 | $Id$ |
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 |
属性详情
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.
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.
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.
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.
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'.
the URL for WSDL. Defaults to null, meaning the URL for this action is used to serve WSDL document.
方法详情
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.
public CWebService getService()
| ||
{return} | CWebService | the Web service instance |
Returns the Web service instance currently being used.
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;