Session handling - HxGN EAM - Version 12.0.1 - Customization & Programming - Hexagon

HxGN EAM Web Services Toolkit Help

Language
English
Product
HxGN EAM
Search by Category
Customization & Programming
HxGN EAM Version
12.0.1

The HxGN EAM Web Services facade supports session-based Web services. When the first request is made, the facade creates a session and generates a session ID for the supplied tenant/user ID combination. The generated session ID is returned to the client as part of the response header. All subsequent Web services requests could be made within the existing session context by supplying the session ID instead of the user ID and password. The Web service sessions are subject to standard HxGN EAM session expiration time and licensing limitations such as allowed number of concurrent sessions, etc. Refer to the figure below for a conceptual view of Web services session processing.

The HxGN EAM Web Services facade supports session-based Web services. When the first request is made, the facade creates a session and generates a session ID for the supplied tenant/user ID combination. The generated session ID is returned to the client as part of the response header. All subsequent Web services requests could be made within the existing session context by supplying the session ID instead of the user ID and password. The Web service sessions are subject to standard HxGN EAM session expiration time and licensing limitations such as allowed number of concurrent sessions, etc. Refer to the figure below for a conceptual view of Web services session processing.

This example requests values for the Location object and returns an established Session ID in the SOAP header of the response. Note that the request does not supply SessionScenario= terminate, because the goal is to maintain session state between Connector SOAP requests

Please note that a single session ID must not be shared across client threads. It is essential that client threads not send concurrent requests to the server using the same session ID. Sending such concurrent requests will cause unpredictable errors on the server.

Request example

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope

xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Header>

<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext">

<UsernameToken Id="MyID">

<Username>Jones</Username>

<Password>password</Password>

</UsernameToken>

</wsse:Security>

<dstm:Organization xmlns:dstm="http://schemas.datastream.net/MP_functions">

ORG1

</dstm:Organization>

</soapenv:Header>

<soapenv:Body>

<cct:processRequest xmlns:cct="EWSConnector"/>

<ns1:MP0318_GetLocation_001 noun="Location" verb="Get" version="001" xmlns:ns1="http://schemas.datastream.net/MP_functions/MP0318_001" xmlns:dsf="http://schemas.datastream.net/MP_fields">

<dsf:LOCATIONID>

<dsf:LOCATIONCODE>LOCATION12</dsf:LOCATIONCODE>

<dsf:ORGANIZATIONID entity="USER">

<dsf:ORGANIZATIONCODE>ORG1</dsf:ORGANIZATIONCODE>

<dsf:DESCRIPTION/>

</dsf:ORGANIZATIONID>

<dsf:DESCRIPTION/>

</dsf:LOCATIONID>

</ns1:MP0318_GetLocation_001>

</soapenv:Body>

</soapenv:Envelope>

Response example

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Header>

<Session>

<SessionId>

3456783

</SessionId>

</Session>

</soapenv:Header>

<soapenv:Body>

<ns1:MP0318_GetLocation_001_Result

xmlns:ns1=http://schemas.datastream.net/MP_results/MP0318_001
xmlns:ns2=http://schemas.datastream.net/MP_entities/Location_001
xmlns:dsf="http://schemas.datastream.net/MP_fields">

<ns1:ResultData>

<ns2:Location recordid="0">

<dsf:LOCATIONID>

<dsf:LOCATIONCODE>LOCATION12</dsf:LOCATIONCODE>

<dsf:ORGANIZATIONID>

<dsf:ORGANIZATIONCODE>ORG1</dsf:ORGANIZATIONCODE>

<dsf:DESCRIPTION>test</dsf:DESCRIPTION>

</dsf:ORGANIZATIONID>

<dsf:DESCRIPTION>test</dsf:DESCRIPTION>

</dsf:LOCATIONID>

<dsf:DEPARTMENTID>

<dsf:DEPARTMENTCODE>*</dsf:DEPARTMENTCODE>

<dsf:DESCRIPTION>DEFAULT / ALL DEPARTMENTS</dsf:DESCRIPTION>

</dsf:DEPARTMENTID>

<dsf:SAFETY>false</dsf:SAFETY>

</ns2:Location>

</ns1:ResultData>

</ns1:MP0318_GetLocation_001_Result>

</soapenv:Body>

</soapenv:Envelope>

To make the next request in the existing session context (SessionId=3456783), substitute Security SOAP Header element with session element as shown below.

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope

xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Header>

<Session>

<SessionId>

3456783

</SessionId>

</Session>

<dstm:Organization xmlns:dstm="http://schemas.datastream.net/MP_functions">

ORG1

</dstm:Organization>

</soapenv:Header>

<soapenv:Body>

<cct:processRequest xmlns:cct="EWSConnector"/>

<ns1:MP0318_GetLocation_001 noun="Location" verb="Get" version="001"

xmlns:ns1="http://schemas.datastream.net/MP_functions/MP0318_001" xmlns:dsf="http://schemas.datastream.net/MP_fields">

<dsf:LOCATIONID>

<dsf:LOCATIONCODE>LOCATION12</dsf:LOCATIONCODE>

<dsf:ORGANIZATIONID entity="USER">

<dsf:ORGANIZATIONCODE>ORG1</dsf:ORGANIZATIONCODE>

<dsf:DESCRIPTION/>

</dsf:ORGANIZATIONID>

<dsf:DESCRIPTION/>

</dsf:LOCATIONID>

</ns1:MP0318_GetLocation_001>

</soapenv:Body>

</soapenv:Envelope>

If a sessionScenario element is not specified as terminate, then idle open sessions will be closed after a period defined by the HxGN EAM application server administration parameters.