ParaEngine::INPLWebServiceClient Class Reference

List of all members.

Detailed Description

interface of NPL web service client.

this class is usually implemented by .Net plug-in. See ParaEnginePlugin/NPLWebServiceClient class ID is WEBSERVICECLIENT_CLASS_ID


Public Member Functions

virtual INPLWebServiceGetWebService (const char *sURL)=0
 get the web service interface by its URL, if the web service does not exists it will return NULL, in which case one needs to call OpenWebService()
virtual INPLWebServiceOpenWebService (const char *sURL, const char *sUserName, const char *sPassword, const char *sDomain)=0
 open a new web service with optional credentials
virtual bool CloseWebService (const char *sURL)=0
 close a given web service.
virtual INPLJabberClientGetJabberClient (const char *sJID)=0
 get an existing jabber client instance interface by its JID.
virtual INPLJabberClientCreateJabberClient (const char *sJID)=0
 Create a new jabber client instance with the given jabber client ID.
virtual bool CloseJabberClient (const char *sJID)=0
 close a given jabber client instance.
virtual void AsyncDownload (const char *url, const char *destFolder, const char *callbackScript, const char *DownloaderName)=0
 Asynchronously download a file from the url.
virtual void CancelDownload (const char *DownloaderName)=0
 cancel all asynchronous downloads that matches a certain downloader name pattern
virtual int Download (const char *url, const char *destFolder, const char *callbackScript, const char *DownloaderName)=0
 Synchronous call of the function AsyncDownload().
virtual int ProcessResults ()=0
 this function is called once on each frame to polling all results and calling the callbacks in scripting interface
virtual int ProcessDownloaderResults ()=0
 this function is called once on each frame to polling all results and calling the callbacks in scripting interface
virtual void DeleteThis ()=0
 delete this object when it is no longer needed.


Member Function Documentation

virtual INPLWebService* ParaEngine::INPLWebServiceClient::OpenWebService ( const char *  sURL,
const char *  sUserName,
const char *  sPassword,
const char *  sDomain 
) [pure virtual]

open a new web service with optional credentials

Parameters:
sURL,: url of the web service, such as http://paraengine.com/test.asmx
sUserName the user name associated with the credentials
sPassword the password for the user name associated with the credentials.
sDomain the domain or computer name that verifies the credentials

virtual bool ParaEngine::INPLWebServiceClient::CloseWebService ( const char *  sURL  )  [pure virtual]

close a given web service.

Basically, there is no need to close a web service, unless one wants to reopen it with different credentials

virtual INPLJabberClient* ParaEngine::INPLWebServiceClient::GetJabberClient ( const char *  sJID  )  [pure virtual]

get an existing jabber client instance interface by its JID.

If the client is not created using CreateJabberClient() before, function may return NULL.

Parameters:
sJID,: such as "lixizhi@paraweb3d.com"

virtual INPLJabberClient* ParaEngine::INPLWebServiceClient::CreateJabberClient ( const char *  sJID  )  [pure virtual]

Create a new jabber client instance with the given jabber client ID.

It does not open a connection immediately.

Parameters:
sJID,: such as "lixizhi@paraweb3d.com"

virtual bool ParaEngine::INPLWebServiceClient::CloseJabberClient ( const char *  sJID  )  [pure virtual]

close a given jabber client instance.

Basically, there is no need to close a web service, unless one wants to reopen it with different credentials

Parameters:
sJID,: such as "lixizhi@paraweb3d.com"

virtual void ParaEngine::INPLWebServiceClient::AsyncDownload ( const char *  url,
const char *  destFolder,
const char *  callbackScript,
const char *  DownloaderName 
) [pure virtual]

Asynchronously download a file from the url.

Parameters:
callbackScript,: script code to be called, a global variable called msg is assigned, as below msg = {DownloadState=""|"complete"|"terminated", totalFileSize=number, currentFileSize=number, PercentDone=number}

virtual void ParaEngine::INPLWebServiceClient::CancelDownload ( const char *  DownloaderName  )  [pure virtual]

cancel all asynchronous downloads that matches a certain downloader name pattern

Parameters:
DownloaderName:regular expression. such as "proc1", "proc1.*", ".*"

virtual int ParaEngine::INPLWebServiceClient::Download ( const char *  url,
const char *  destFolder,
const char *  callbackScript,
const char *  DownloaderName 
) [pure virtual]

Synchronous call of the function AsyncDownload().

This function will not return until download is complete or an error occurs. this function is rarely used. AsyncDownload() is used.

Returns:
:1 if succeed, 0 if fail

virtual int ParaEngine::INPLWebServiceClient::ProcessResults (  )  [pure virtual]

this function is called once on each frame to polling all results and calling the callbacks in scripting interface

Note:
: this function must be called from the main NPL runtime thread,since it will execute NPL code internally.
Returns:
the number of asynchronous messages processed are returned.

virtual int ParaEngine::INPLWebServiceClient::ProcessDownloaderResults (  )  [pure virtual]

this function is called once on each frame to polling all results and calling the callbacks in scripting interface

Note:
: this function must be called from the main NPL runtime thread,since it will execute NPL code internally.
Returns:
the number of asynchronous download processed are returned.

virtual void ParaEngine::INPLWebServiceClient::DeleteThis (  )  [pure virtual]

delete this object when it is no longer needed.


Generated on Mon Dec 1 14:34:44 2008 for NPL Scripting Reference for ParaEngine by  doxygen 1.5.2