diff --git a/reference/sca/functions/SCA-getService.xml b/reference/sca/functions/SCA-getService.xml index 1d2d60bae5..1935008cde 100644 --- a/reference/sca/functions/SCA-getService.xml +++ b/reference/sca/functions/SCA-getService.xml @@ -1,5 +1,5 @@ - + @@ -17,12 +17,22 @@ string target + + string + binding + + + array + config + &warn.experimental.func; - Examine the target and initialise and return a proxy of the appropriate sort. If the target is for a local PHP component the returned proxy will be an SCA_LocalProxy. If the - target is for a WSDL file, the returned proxy will be a SCA_SoapProxy. + Examine the target and initialise and return a proxy of the appropriate + sort. If the target is for a local PHP component the returned proxy will be an + SCA_LocalProxy. If the target is for a WSDL file, the returned proxy will be a + SCA_SoapProxy. @@ -34,8 +44,37 @@ target - An absolute or relative path to the PHP component, or to the WSDL file. A relative path, if specified, is resolved relative to the location of the script issuing the - getService call, and not against the include_path or current working directory. + An absolute or relative path to the target service or service + description (e.g. a URL to a json-rpc service description, a PHP + component, a WSDL file, and so on.). A relative path, if specified, + is resolved relative to the location of the script issuing the + getService call, and not against the include_path + or current working directory. + + + + + binding + + + The binding (i.e. protocol) to use to communicate with the service + (e.g binding.jsonrpc for a json-rpc service). Note, some service types + can be deduced from the target parameter (e.g. if the target parameter + ends in .wsdl then SCA will assume binding.soap). Any binding which + can be specified in an annotation can be specified here. For example + 'binding.soap' is equivalent to the '@binding.soap' annotation. + + + + + config + + + Any additional configuration prioperties for the binding (e.g. + array('location' => 'http://example.org')). Any binding configuration + which can be specified in an annotation can be specified here. For + example, 'location' is equivalent to the '@location' annotation to + configure the location of a target soap service. @@ -83,36 +122,29 @@ --> - + @@ -85,7 +85,7 @@ include "SCA/SCA.php"; * Calculate a stock price for a given ticker symbol in a given currency. * * @service - * @binding.ws + * @binding.soap */ class ConvertedStockQuote { @@ -101,7 +101,7 @@ class ConvertedStockQuote { * The stock quote service to use. * * @reference - * @binding.wsdl ../StockQuote/StockQuote.wsdl + * @binding.soap ../StockQuote/StockQuote.wsdl */ public $stock_quote; @@ -354,9 +354,9 @@ class ConvertedStockQuote { The @binding annotation has two forms @binding.php and - @@binding.ws, and indicates that the proxy is either for a local + @binding.soap, and indicates that the proxy is either for a local component or for a Web service respectively. For both @binding.php - and @binding.ws, the annotation gives a target URI. + and @binding.soap, the annotation gives a target URI. @@ -426,7 +426,7 @@ class ConvertedStockQuote { * The stock quote service to use. * * @reference - * @binding.wsdl ../StockQuote/StockQuote.wsdl + * @binding.soap ../StockQuote/StockQuote.wsdl */ public $stock_quote; ?> @@ -585,7 +585,7 @@ $rate = $exchange_rate->getRate($currency); service component, so that it can be easily deployed and exposed as a Web service. To provide SCA with the information it needs to generate the WSDL, it is necessary to add the annotation - @binding.ws under the @service annotation and to specify the + @binding.soap under the @service annotation and to specify the parameters and return values of the methods using the @param and @return annotations. These annotations will be read when WSDL is generated, and the order and types of the parameters determine the @@ -624,7 +624,7 @@ include "SCA/SCA.php"; * Scaffold implementation for a remote StockQuote Web service. * * @service - * @binding.ws + * @binding.soap * */ class StockQuote { @@ -745,7 +745,7 @@ class StockQuote { SCA components that expose a Web service interface (i.e. have - an @binding.ws annotation) will return their WSDL definition in + an @binding.soap annotation) will return their WSDL definition in response to an HTTP request with a get parameter of "wsdl". The usual way to obtain this is with "?wsdl" on the end of a URL. The example below uses @@ -783,7 +783,7 @@ $service = SCA::getService('service.wsdl'); Understanding how the WSDL is generated SCA for PHP generates WSDL for components which contain an - @binding.ws annotation after the @service annotation. To + @binding.soap annotation after the @service annotation. To generate WSDL, the SCA runtime reflects on the component and examines the @param and @return annotations for each public method, as well as any @types annotations within the component. The @@ -1035,7 +1035,7 @@ include 'SCA/SCA.php'; * Manage the portfolio for a customer. * * @service - * @binding.ws + * @binding.soap * * @types http://www.example.org/Portfolio PortfolioTypes.xsd * @@ -1167,7 +1167,7 @@ $address_book; getService is called with the target of a WSDL file, a SOAP proxy is returned. A SOAP proxy is also injected into the instance variables of a component that are defined with an - @reference and an @binding.ws anotations. When the script or + @reference and an @binding.soap anotations. When the script or component makes calls on the SOAP proxy, they are formed into Web service SOAP requests and passed on to the target component, with the help of the PHP Soap extension.