Package DE_EPAGES::WebService::API::Object::WebServiceSession
object interface for WS Session.
Base |
DE_EPAGES::Object::API::Object::Object |
Functions
doSub
start the stored method with the parameters (see setSub) service: may based on WebService::API::WebService::BaseAsyncService aParams: all necessary parameters of the method $WSession object passed to have easy acces to the session status etc.
Syntax |
my $ret = $WSession->doSub(); |
Return |
|
end
set status code=0 and passed status mesage
Syntax |
$WSession->end; $WSession->end( $StatusMessage ); |
Example |
$WSession->end( 'method finished' ); |
Input |
|
error
set status code=-1 and passed error mesage
Syntax |
$WSession->error; $WSession->error( $ErrorMessage ); |
Example |
$WSession->error( 'error occured' ); |
Input |
|
insert
Insert this info as web service session object
Syntax |
$WSession = DE_EPAGES::WebService::API::Object::WebServiceSession->insert($hInfo); |
Example |
my $WSessionFolder = LoadRootObject()->folder('WebServiceSessions'); my $WSession = $WSessionFolder->insertChild('WebServiceSession'); |
Input |
|
Return |
|
setSub
remember references to service: may based on WebService::API::WebService::BaseAsyncService code: reference to a Webservice method with expected long running time aParams: all necesary parameters of thje method this configuration will later use to start and run the method after sending the response back to the client the method should chnage the status ti signal the progressing and the end
Syntax |
$WSession->setSub( $service, $code, $aParams ); |
Example |
$WSession->setSub( $ExampleWebService, \&doLongTimeFunc, [$CountParam] ); $WSession->setSub( $ExampleWebService, sub {...}, \@Input ); |
Input |
|
status
set status code and status method of Webservice Session returns current status code and method if no code passed status code <0 should be used for errors status code 0 is used if method finished (see method $self->end) status code 1 is used if session started (see method insert) status codes >1 should be used for method progress and should be increased
Syntax |
$WSession->status( $StatusCode, $StatusMessage ); ( $StatusCode, $StatusMessage ) = $WSession->status; |
Example |
$WSession->status( -1, 'wrong parameter' ) $WSession->status( 0, 'method finished' ) $WSession->status( 1, 'method started' ) my ( $code, $msg ) = $WSession->status() |
Input |
|
Return |
|