bus_facade_context


**Description:** Used in the management of a session, logging in, creating a session (context entity) in the bean store, and logging out removing this session from the bean store.
**Default Methods** Please ensure you're familiar with... - [**Introduction to Beans**](/documentation/soap/gettingstarted/beans) - [**Requests and Responses**](/documentation/soap/gettingstarted/requests) - [**Anatomy of a session**](/documentation/soap/gettingstarted/session)
**Unique Methods** To call these methods use the following example structure...
paintRequest:
contextId   string  :   ''(omitted during a login request)
className   string  :   bus_facade_context
processName string  :   methodName  i.e. login
entityData  array   :   i.e. array('variableName'  => value) 
processData array   :   i.e. array('variableName'  => value)
Name Parameters Description
login contextId: Omitted
Entity Data: userName, password
Validates the API credentials, checks against the platform, and if successful returns the context entity beanId of the bean in the bean store. This beanId is used as the contextId for all subsequent requests in this session
logout contextId: Id used throughout the session
Entity Data: null
Process a logout request, locate the context bean with the contextId, garbage this from the bean store

Example Process - Logging In and Logging Out

[**WSDL**](http://paint.pure360.com/paint.pure360.com/ctrlPaint.wsdl) *Our WSDL defines our web service and where to locate our web service. In understanding these examples please familiarise yourself with the handleRequest (paintRequest / paintResponse)*
**Step 1 :** Begin by performing a login process with the API credentials * Don't use a contextId as this is the process to generate this * To access the context entity use the context entry point/gateway * Perform a login process with the writeable parameters userName and password **Example Request / Response**
paintRequest:
contextId   string  :   null
className   string  :   bus_facade_context
processName string  :   login
entityData  array   :   'userName' => "test.sys", 'password' => "password4"
processData array   :   null
paintResponse:
Result   array:
         'result'     => "success",
         'resultData' => array :
                         'bus_entity_context' => array :
                                                        … => ….,
                                                        … => …..,
                                                       'beanId' => ID for the context 
                                                                   entity bean in bean store
**Step 2 :** Next (or after performing other processes on other entities) perform a logout request with the contextId generated during the login process (and by subsequent processes) * Use the contextId (beanId of the context entity in the bean store) that ties a session together. * To access the context entity use the context entry point/gateway * Perform a logout process with no parameters, this will end the session removing the context entity from the bean store **Example Request / Response**
paintRequest:
contextId   string  :   C-KFDsCMMHXpDUi0ltN0p3FvF
className   string  :   bus_facade_context
processName string  :   logout
entityData  array   :   null
processData array   :   null
paintResponse:
Result   array : 'result' => "success"

bus_entity_context/bus_search_context variables

The only variables that are writeable and required are the userName and password used in the login unique process.