VCL
[ class tree: VCL ] [ index: VCL ] [ all elements ]

Class: Service

Source Location: /webservices.inc.php

Class Overview

Object
   |
   --Persistent
      |
      --Component
         |
         --Service

This component represents a web service.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods

Class: Component

Component::__construct()
Component constructor
Component::ajaxCall()
Dumps the javascript code to make an ajax call to the server.
Component::callEvent()
Calls a server event.
Component::defaultName()
Component::defaultTag()
Component::dumpChildrenFormItems()
This method is called by the page just after dumping the starting form tag.
Component::dumpChildrenHeaderCode()
Dumps the header code for all the children
Component::dumpChildrenJavascript()
Dumps the javascript code for all the children
Component::dumpFormItems()
Dumps code just after the form tag, useful to dump hidden fields for state retrieving for non visible components
Component::dumpHeaderCode()
Dumps header code required
Component::dumpHiddenKeyFields()
Dumps hidden field values for the key record
Component::dumpJavascript()
Dumps the javascript code needed by this component
Component::dumpJSEvent()
Dumps javascript code for an event
Component::fixupProperty()
Resolves the right reference to an object property
Component::generateAjaxEvent()
Returns the javascript code to generate an ajax call.
Component::getName()
Specifies the name for the component. The name is used as an identifier and should be unique.
Component::getTag()
A versatile property of every Component that can be used in any way you want
Component::hasValidDataField()
Returns true if a valid data field is attached to the component
Component::init()
Initializes a component
Component::insertComponent()
Inserts a component into the component's collection
Component::loaded()
Initializes the component after the form file has been read into memory.
Component::loadedChildren()
Calls childrens loaded
Component::loadResource()
Loads this component from a string
Component::preinit()
Method called before init()
Component::readAccessibility()
Provides accessibility info to the embedded RPC engine.
Component::readComponentCount()
Indicates the number of components owned by the component.
Component::readComponents()
Lists all the components owned by this component.
Component::readControlState()
A flag to know the state of the control, csLoading, csDesigning
Component::readDataFieldValue()
This property returns the value of the datafield if any.
Component::readFromResource()
Reads a component from a resource file
Component::readNamePath()
Specifies the path to uniquely identify a component, qualified by the owner when required.
Component::readOwner()
Indicates the component that is responsible for streaming and freeing this component.
Component::removeComponent()
Removes a component from the component's collection
Component::serializeChildren()
Serializes all children
Component::setName()
Component::setTag()
Component::unserializeChildren()
Unserializes all children by calling unserialize for all the components
Component::updateDataField()
Updates the field on the dataset attached, if any
Component::writeControlState()

Class: Persistent

Persistent::allowserialize()
This method provides an opportunity for the component developer to prevent the serialization/unserialization of a property.
Persistent::assign()
Assigns the source properties to this object.
Persistent::assignError()
Raises an assignation error.
Persistent::assignTo()
Assigns this object to another object.
Persistent::inSession()
This method determines if this object exists in the current session.
Persistent::readNamePath()
Used to serialize/unserialize. It returns the full path to identify this component.
Persistent::readOwner()
Owner of the component.
Persistent::serialize()
Stores this object into the session.
Persistent::unserialize()
This method uses PHP reflection to iterate through published properties (the ones starting with get) and retrieve the properties stored by a previous serialize() call.

Class: Object

Object::__construct()
Constructs an object and initializes its data before the object is first used.
Object::className()
Returns a string indicating the type of the object instance (as opposed to the type of the variable passed as an argument).
Object::classNameIs()
Determines whether an object is of a specific type.
Object::classParent()
Returns the type of the immediate ancestor of a class.
Object::inheritsFrom()
Determines the relationship of two object types.
Object::methodExists()
Check if a method exists declared on this object instance.
Object::readProperty()
Reads a property from the streams
Object::__get()
To virtualize properties
Object::__set()
To virtualize properties

Class Details

[line 46]
This component represents a web service.

This component allows you to publish specific application functionality using SOAP technology, so you can write clients that consume that functionality in other languages that share the same technology.




Tags:

link:  http://www.w3.org/TR/soap/
example:  example not found
example:  example not found


[ Top ]


Class Variables

$_active =  false

[line 50]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_namespace =  "http://localhost"

[line 79]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onaddcomplextypes =  null

[line 147]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onregisterservices =  null

[line 108]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_schematargetnamespace =  "http://localhost/xsd"

[line 93]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_servicename =  "VCL"

[line 65]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 225]

Service __construct( [ $aowner = null])



Overrides Component::__construct() (Component constructor)

Parameters:

   $aowner  

[ Top ]

method addComplexType [line 313]

void addComplexType( string $name, [string $typeClass = 'complexType'], [string $phpType = 'array'], [string $compositor = ''], [string $restrictionBase = ''], [array $elements = array()], [array $attrs = array()], [string $arrayType = ''])

Adds a complex type to the schema

Use this method on the OnAddComplexTypes event to provide a description for your complex types.

  1.  <?php
  2.  
  3.  //Adding a string array type
  4.        'ArrayOfstring',
  5.        'complexType',
  6.        'array',
  7.        '',
  8.        'SOAP-ENC:Array',
  9.        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]'),
  10.        'xsd:string'
  11.  );
  12.  
  13.  //Adding a PHP associative array ( SOAP Struct )
  14.        'SOAPStruct',
  15.        'complexType',
  16.        'struct',
  17.        'all',
  18.        array('myVar'=> array('name'=>'myVar','type'=>'string')
  19.  );
  20.  ?>




Parameters:

string   $name   Type name
string   $typeClass   (complexType|simpleType|attribute)
string   $phpType   currently supported are array and struct (php assoc array)
string   $compositor   (all|sequence|choice)
string   $restrictionBase   namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
array   $elements   = array ( name = array(name=>'',type=>'') )
array   $attrs   = array( array( 'ref' => "http://schemas.xmlsoap.org/soap/encoding/:arrayType", "http://schemas.xmlsoap.org/wsdl/:arrayType" => "string[]" ) )
string   $arrayType   namespace:name (http://www.w3.org/2001/XMLSchema:string)

[ Top ]

method defaultActive [line 63]

void defaultActive( )



[ Top ]

method defaultNameSpace [line 91]

void defaultNameSpace( )



[ Top ]

method defaultOnAddComplexTypes [line 192]

void defaultOnAddComplexTypes( )



[ Top ]

method defaultOnRegisterServices [line 145]

void defaultOnRegisterServices( )



[ Top ]

method defaultSchemaTargetNamespace [line 105]

void defaultSchemaTargetNamespace( )



[ Top ]

method defaultServiceName [line 77]

void defaultServiceName( )



[ Top ]

method getActive [line 61]

boolean getActive( )

Specifies if the webservice is active or not.

If this property is set to true, the component will fire the events to get the functions to register and any complex type required and will publish the WSDL and process service requests




[ Top ]

method getNameSpace [line 89]

string getNameSpace( )

Specifies the Name Space for the WSDL

This property is used to provide the namespace used when generating the web service description (WSDL)




[ Top ]

method getOnAddComplexTypes [line 190]

mixed getOnAddComplexTypes( )

Fired when the service needs to register complex types.

Use this event to register all complex types your functions need by calling addComplexType method. Complex types are built using simple types.

  1.  <?php
  2.       function MyWebServiceAddComplexTypes($sender$params)
  3.       {
  4.        //Add the complex type array of strings
  5.        $this->MyWebService->addComplexType
  6.        (
  7.                'ArrayOfstring',
  8.                'complexType',
  9.                'array',
  10.                '',
  11.                'SOAP-ENC:Array',
  12.                array(),
  13.                array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]')),
  14.                'xsd:string'
  15.        );
  16.  
  17.        //Add the complex type array of integers
  18.        $this->MyWebService->addComplexType
  19.        (
  20.                'ArrayOfinteger',
  21.                'complexType',
  22.                'array',
  23.                '',
  24.                'SOAP-ENC:Array',
  25.                array(),
  26.                array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'integer[]')),
  27.                'xsd:integer'
  28.        );
  29.       }
  30.  ?>




Tags:



[ Top ]

method getOnRegisterServices [line 143]

mixed getOnRegisterServices( )

Fired when the service needs to register the functions to be published by the service.

Use this event to call register method and specify which methods do you want to publish so are available by users of the webservice.

  1.  <?php
  2.       function MyWebServiceRegisterServices($sender$params)
  3.       {
  4.                //Register the echo service
  5.                $this->MyWebService->register(
  6.                "serviceEcho",
  7.                array('input'=>'xsd:string'),
  8.                array('return'=>'xsd:string'),
  9.                'http://localhost/'
  10.                );
  11.  
  12.  
  13.                //Register the conversion service
  14.                $this->MyWebService->register(
  15.                "StringArrayToIntArray",
  16.                array('input'=>'tns:ArrayOfstring'),
  17.                array('return'=>'tns:ArrayOfinteger'),
  18.                'http://localhost/'
  19.                );
  20.  
  21.       }
  22.  ?>




Tags:



[ Top ]

method getSchemaTargetNamespace [line 103]

string getSchemaTargetNamespace( )

Specifies the Target Name Space for the WSDL

This property is used to provide the target namespace used when gene3rating the webservice description (WSDL)




[ Top ]

method getServiceName [line 75]

string getServiceName( )

Specifies the Name of the service you want to create

This property determines the name of the service you are going to publish. The default value is VCL




[ Top ]

method init [line 194]

void init( )



Overrides Component::init() (Initializes a component)

[ Top ]

method register [line 260]

void register( string $name, [array $in = array()], [array $out = array()], [mixed $namespace = false], [mixed $soapaction = false], [mixed $style = false], [mixed $use = false], [string $documentation = ''], [string $encodingStyle = ''])

Register a service function with the server

Use this method on the OnRegisterServices event to register all methods you want to publish.

  1.  <?php
  2.                //Register the echo service
  3.                $this->MyWebService->register(
  4.                "serviceEcho",
  5.                array('input'=>'xsd:string'),
  6.                array('return'=>'xsd:string'),
  7.                'http://localhost/'
  8.                );
  9.  ?>




Parameters:

string   $name   the name of the PHP function, class.method or class..method
array   $in   assoc array of input values: key = param name, value = param type
array   $out   assoc array of output values: key = param name, value = param type
mixed   $namespace   the element namespace for the method or false
mixed   $soapaction   the soapaction for the method or false
mixed   $style   optional (rpc|document) or false Note: when 'document' is specified, parameter and return wrappers are created for you automatically
mixed   $use   optional (encoded|literal) or false
string   $documentation   optional Description to include in WSDL
string   $encodingStyle   optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)

[ Top ]

method setActive [line 62]

void setActive( $value)



Parameters:

   $value  

[ Top ]

method setNameSpace [line 90]

void setNameSpace( $value)



Parameters:

   $value  

[ Top ]

method setOnAddComplexTypes [line 191]

void setOnAddComplexTypes( $value)



Parameters:

   $value  

[ Top ]

method setOnRegisterServices [line 144]

void setOnRegisterServices( $value)



Parameters:

   $value  

[ Top ]

method setSchemaTargetNamespace [line 104]

void setSchemaTargetNamespace( $value)



Parameters:

   $value  

[ Top ]

method setServiceName [line 76]

void setServiceName( $value)



Parameters:

   $value  

[ Top ]


Documentation generated on Sat, 13 Jun 2009 10:52:13 -0700 by phpDocumentor 1.4.1