TSoapService class
TSoapService processes SOAP requests for a PRADO application. TSoapService requires PHP SOAP extension to be loaded.
TSoapService manages a set of SOAP providers. Each SOAP provider is a class that implements a set of SOAP methods which are exposed to SOAP clients for remote invocation. TSoapService generates WSDL automatically for the SOAP providers by default.
To use TSoapService, configure it in the application specification like following:
- <services>
- <service id="soap" class="System.Web.Services.TSoapService">
- <soap id="stockquote" provider="MyStockQuote" />
- </service>
- </services>
The above example specifies a single SOAP provider named "stockquote" whose class is "MyStockQuote". A SOAP client can then obtain the WSDL for this provider via the following URL:
- http://hostname/path/to/index.php?soap=stockquote.wsdl
The WSDL for the provider class "MyStockQuote" is generated based on special comment tags in the class. In particular, if a class method's comment contains the keyword "@soapmethod", it is considered to be a SOAP method and will be exposed to SOAP clients. For example,
- class MyStockQuote {
- / **
- * @param string $symbol the stock symbol
- * @return float the stock price
- * @soapmethod
- * /
- public function getQuote($symbol) {...}
- }
With the above SOAP provider, a typical SOAP client may call the method "getQuote" remotely like the following:
- $client=new SoapClient("http://hostname/path/to/index.php?soap=stockquote.wsdl");
- echo $client->getQuote("ibm");
Each <soap> element in the application specification actually configures the properties of a SOAP server which defaults to TSoapServer. Therefore, any writable property of TSoapServer may appear as an attribute in the <soap> element. For example, the "provider" attribute refers to the TSoapServer::setProvider property of TSoapServer. The following configuration specifies that the SOAP server is persistent within the user session (that means a MyStockQuote object will be stored in session)
- <services>
- <service id="soap" class="System.Web.Services.TSoapService">
- <soap id="stockquote" provider="MyStockQuote" SessionPersistent="true" />
- </service>
- </services>
You may also use your own SOAP server class by specifying the "class" attribute of <soap>.
Located in /Web/Services/TSoapService.php (line 85)
TComponent | --TApplicationComponent | --TService | --TSoapService
Constructor.
Sets default service ID to 'soap'.
Constructs a URL with specified page path and GET parameters.
Creates the requested SOAP server.
The SOAP server is initialized with the property values specified in the configuration.
Initializes this module.
This method is required by the IModule interface.
Resolves the request parameter.
It identifies the server ID and whether the request is for WSDL.
Runs the service.
If the service parameter ends with '.wsdl', it will serve a WSDL file for the specified soap server. Otherwise, it will handle the soap request using the specified server.
Inherited From TService
TService::getEnabled()
TService::getID()
TService::init()
TService::run()
TService::setEnabled()
TService::setID()
Inherited From TApplicationComponent
TApplicationComponent::getApplication()
TApplicationComponent::getRequest()
TApplicationComponent::getResponse()
TApplicationComponent::getService()
TApplicationComponent::getSession()
TApplicationComponent::getUser()
TApplicationComponent::publishAsset()
TApplicationComponent::publishFilePath()
Inherited From TComponent
TComponent::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__get()
TComponent::__set()
Documentation generated on Mon, 21 Apr 2008 11:36:14 -0400 by phpDocumentor 1.3.0RC4