getSessionByID

Description

getSessionByID returns the detail information of the specified session with XML format.

Syntax for .NET component

proxyobject.of_execinterface ( "getSessionByID", ref any paralist[] )

Table 12. 

Argument

Description

proxyobject

The instance of the proxy object generated for AppeonDotNetComponent.

paralist[]

Arrays of Any type. Specifies the parameter arrays for the component function.

paralist[1] - The ID of the session. Only one ID is allowed. If this parameter is NULL or an empty string (""), in .NET, the current application session will be used as the default value.

paralist[2] - The return value of getSessionByID function: the session content in XML format. This parameter must be declared, but need not to be assigned with values, as it is used to hold the return value.


Return value of of_execinterface

Returns 1 if the of_execinterface function succeeds and one of the following negative values if an error occurs.

-1: function fails to execute

-2: the specified session ID is not found

Return value of getSessionByID

Returns an XML string. The XML string is stored in the paralist[2] parameter of the of_execinterface function.

The session content in the XML format will be like this.

<?xml version='1.0' encoding='utf-8'?>
<sessions>
  <error>
    <code>0</code>
    <text></text>
  </error>
  <sever name="172.16.8.40" port="80">
    <session name="241910444">
       <session_id>241910444</session_id>
       <client>172.16.100.170</client>
       <application-name>34455</application-name>
       <user/>
       <state>0</state>
       <started>2018-11-20 12:57:14</started>
       <last_accessed>2018-11-20 12:57:15</last_accessed>
       <duration>21</duration>
       <server_id>172.16.8.40:80</server_id>
       <aws_id>DBEA12D26A7E4C44A8715EDC4C46D8F3</aws_id>
    </session>
  </sever>
</sessions>

Method execution results are recorded in the error node.

Two parameters, code and text, are contained in the error node. The code parameter shows the execution result and the text parameter records the detail error information. If the execution result is not 0, only the error node is listed in the XML.

Values for the code parameter:

0: function succeeds in execution.

-1: function fails to execute.

Code example

Any la_l[] 
Long lRet 
...
la_l[1] = ls_sessionconid
la_l[2] = ls_sessioncontent   

lRet = loadDBList.of_ExecInterface ("getSessionByID", la_l) //result is returned to la_l[2]

Syntax for EJB component

io_ejb.regstring ( String SessionconID )

io_ejb.Invokeretstring ( long objid, "getSessionByID", true, ref string retval )

Table 13. 

Argument

Description

io_ejb

A reference of Appeon EJBobject.

SessionconID

The ID of the session. Only one ID is allowed. If this parameter is NULL or an empty string (""), in Java, no value will be used as the default value.

objid

The handle to the component method.

retval

The return value of getSessionByID function: the session content in XML format. This parameter must be declared, but need not to be assigned with values, as it is used to hold the return value.

Return value of Invokeretstring

Returns 1 if the Invokeretstring function succeeds and one of the following negative values if an error occurs.

-1: function fails to execute

-2: the specified session ID is not found

Return value of getSessionByID

Returns an XML string. The XML string is stored in the retval parameter of Invokeretstring function.

The session content in the XML format will be like this.

<?xml version='1.0' encoding='utf-8'?>
<sessions>
  <error>
    <code>0</code>
    <text></text>
  </error>
  <sever name="172.16.8.40" port="80">
    <session name="241910444">
       <session_id>241910444</session_id>
       <client>172.16.100.170</client>
       <application-name>34455</application-name>
       <user/>
       <state>0</state>
       <started>2018-11-20 12:57:14</started>
       <last_accessed>2018-11-20 12:57:15</last_accessed>
       <duration>21</duration>
       <server_id>172.16.8.40:80</server_id>
       <aws_id>DBEA12D26A7E4C44A8715EDC4C46D8F3</aws_id>
    </session>
  </sever>
</sessions>

Method execution results are recorded in the error node.

Two parameters, code and text, are contained in the error node. The code parameter shows the execution result and the text parameter records the detail error information. If the execution result is not 0, only the error node is listed in the XML.

Values for the code parameter:

0: function succeeds in execution.

-1: function fails to execute.

Code example

Note that invokeretstring function is called because the return value is a string.

string ls_msg 
string retval01 
...
io_ejb.regstring (ls_sessionconid)

ls_msg = io_ejb.invokeretstring (il_bean1, "getSessionByID", true, ref retval01) //result is returned to retval01

Syntax for Web Service

getSessionByID ( string sessionid )

Table 14. 

Argument

Description

sessionid

The ID of the session. Only one ID is allowed. If this parameter is NULL or an empty string (""), in .NET, the current application session will be used as the default value.


Return value

XML string. For example,

<?xml version='1.0' encoding='utf-8'?>
<sessions>
  <error>
    <code>0</code>
    <text></text>
  </error>
  <sever name="172.16.8.40" port="80">
    <session name="241910444">
       <session_id>241910444</session_id>
       <client>172.16.100.170</client>
       <application-name>34455</application-name>
       <user/>
       <state>0</state>
       <started>2018-11-20 12:57:14</started>
       <last_accessed>2018-11-20 12:57:15</last_accessed>
       <duration>21</duration>
       <server_id>172.16.8.40:80</server_id>
       <aws_id>DBEA12D26A7E4C44A8715EDC4C46D8F3</aws_id>
    </session>
  </sever>
</sessions>

Method execution results are recorded in the error node.

Two parameters, code and text, are contained in the error node. The code parameter shows the execution result and the text parameter records the detail error information. If the execution result is not 0, only the error node is listed in the XML.

Values for the code parameter:

0: function succeeds in execution.

-1: function fails to execute.

Code example

//--connected to the web service
……
string ls_return, ls_session
ls_session= sle_3.text
ls_return = ieon_ws.getSessionByID (ls_session)