Предопределенные классы
Most of the interface to SCA is through the annotations within
SCA components so there are few public classes and methods. The only
SCA classes that scripts or components can call are the SCA class
itself, and the proxy classes SCA_LocalProxy and SCA_SoapProxy.
SCA
Much of the work of the SCA class is performed when the file
SCA.php is included within an SCA component. However, a PHP script
may include
SCA.php and call the
getService() method on the SCA class in order
to obtain a proxy for a service. A component will not need to do this as
proxies are obtained instead by defining an instance variable with
the @reference annotation.
Components that need to create an SDO to return to a caller will
need a data factory to call. For this purpose the SCA class supports
the
createDataObject() method, which will
create an SDO according to the model defined by the component's
@types annotations. The arguments to
createDataObject() are the same as those to
SDO's XML Data Access Service.
SCA_LocalProxy
When
getService() is called with the target of a
local PHP component, a local proxy is returned. A local proxy is also
injected into the instance variables of a component that are
defined with an @reference and an @binding.php anotation. When the
script or component makes calls on the local proxy, they are passed
on to the target component itself.
Components that need to create an SDO to pass to a component
will need a data factory to call. For this purpose the
SCA_LocalProxy class supports the createDataObject method,
which will create an SDO according to the model defined by the
components' @types annotations. The arguments to the
createDataObject are the same as those to SDO's XML Data Access
Service.
SCA_SoapProxy
When
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.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.
Components that need to create an SDO to pass to a component
will need a data factory to call. For this purpose the SCA_SoapProxy
class supports the createDataObject method, which will create an
SDO according to the model defined within the target WSDL. The
arguments to the createDataObject are the same as those to SDO's XML
Data Access Service.