CWebService
包 | system.web.services |
---|---|
继承 | class CWebService » CComponent |
可用自 | 1.0 |
版本 | $Id$ |
PHP SOAP extension is required.
CWebService makes use of CWsdlGenerator and can generate the WSDL on-the-fly without requiring you to write complex WSDL.
To generate the WSDL based on doc comment blocks in the service provider class, call generateWsdl or renderWsdl. To process the web service requests, call run.
公共属性
属性 | 类型 | 描述 | 被定义在 |
---|---|---|---|
actor | string | actor of the SOAP service. | CWebService |
cacheID | string | the ID of the cache application component that is used to cache the generated WSDL. | CWebService |
classMap | array | a list of classes that are declared as complex types in WSDL. | CWebService |
encoding | string | encoding of the Web service. | CWebService |
methodName | string | the currently requested method name. | CWebService |
persistence | integer | the persistence mode of the SOAP server. | CWebService |
provider | string|object | the web service provider class or object. | CWebService |
serviceUrl | string | the URL for the Web service. | CWebService |
soapVersion | string | SOAP version (e. | CWebService |
wsdlCacheDuration | integer | number of seconds that the generated WSDL can remain valid in cache. | CWebService |
wsdlUrl | string | the URL for WSDL. | CWebService |
公共方法
方法 | 描述 | 被定义在 |
---|---|---|
__call() | Calls the named method which is not a class method. | CComponent |
__construct() | Constructor. | CWebService |
__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 |
generateWsdl() | Generates the WSDL as defined by the provider. | CWebService |
getEventHandlers() | Returns the list of attached event handlers for an event. | CComponent |
getMethodName() | CWebService | |
handleError() | The PHP error handler. | CWebService |
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 |
renderWsdl() | Generates and displays the WSDL as defined by the provider. | CWebService |
run() | Handles the web service request. | CWebService |
属性详情
actor of the SOAP service. Defaults to null, meaning not set.
the ID of the cache application component that is used to cache the generated WSDL. Defaults to 'cache' which refers to the primary cache application component. Set this property to false if you want to disable caching WSDL.
a list of 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.
encoding of the Web service. Defaults to 'UTF-8'.
the currently requested method name. Empty if no method is being requested.
options for creating SoapServer instance
the persistence mode of the SOAP server.
the web service provider class or object. If specified as a class name, it can be a path alias.
the URL for the Web service. This is required by generateWsdl() and renderWsdl().
SOAP version (e.g. '1.1' or '1.2'). Defaults to null, meaning not set.
number of seconds that the generated WSDL can remain valid in cache. Defaults to 0, meaning no caching.
the URL for WSDL. This is required by run().
方法详情
public void __construct(mixed $provider, string $wsdlUrl, string $serviceUrl)
| ||
$provider | mixed | the web service provider class name or object |
$wsdlUrl | string | the URL for WSDL. This is required by run(). |
$serviceUrl | string | the URL for the Web service. This is required by generateWsdl() and renderWsdl(). |
Constructor.
public string generateWsdl()
| ||
{return} | string | the generated WSDL |
Generates the WSDL as defined by the provider. The cached version may be used if the WSDL is found valid in cache.
public string getMethodName()
| ||
{return} | string | the currently requested method name. Empty if no method is being requested. |
protected array getOptions()
| ||
{return} | array | options for creating SoapServer instance |
public void handleError(CErrorEvent $event)
| ||
$event | CErrorEvent | the PHP error event |
The PHP error handler.
public void renderWsdl()
|
Generates and displays the WSDL as defined by the provider.
参见
public void run()
|
Handles the web service request.