CWebService
| Package |
system.web.services |
| Inheritance |
class CWebService »
CComponent |
| Since |
1.0 |
| Version |
$Id: CWebService.php 1678 2010-01-07 21:02:00Z qiang.xue $ |
CWebService encapsulates SoapServer and provides a WSDL-based web service.
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.
Public Properties
Hide inherited properties
| Property | Type | Description | Defined By |
| 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 |
Property Details
public string $actor;
actor of the SOAP service. Defaults to null, meaning not set.
public string $cacheID;
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.
public array $classMap;
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.
public string $encoding;
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
public integer $persistence;
the persistence mode of the SOAP server.
public string|object $provider;
the web service provider class or object.
If specified as a class name, it can be a path alias.
public string $serviceUrl;
the URL for the Web service. This is required by generateWsdl() and renderWsdl().
public string $soapVersion;
SOAP version (e.g. '1.1' or '1.2'). Defaults to null, meaning not set.
public integer $wsdlCacheDuration;
number of seconds that the generated WSDL can remain valid in cache. Defaults to 0, meaning no caching.
public string $wsdlUrl;
the URL for WSDL. This is required by run().
Method Details
|
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 |
handleError()
The PHP error handler.
Generates and displays the WSDL as defined by the provider.
Handles the web service request.