Section III – External Interfaces > External Interfaces > Application Server Relationship         Bottom of Page
Genesys 8.1
SCXML Technical Reference
                        External 2.0 Interfaces >

Application Server Relationship

The following sections cover how the orchestration platform interfaces with an application server.

Mapping of the SCXML and Functional Module Elements to the HTTP Messages

The following sections cover the mapping of the SCXML and functional module element's attributes into the corresponding HTTP message elements.

Get/Delete message
<fetch> mapping

Here is an example of the <fetch> action including basic authentication and optional headers:

<script>
var myheaders = new Object();
	     myheaders["If-Modified-Since"] = "Sat, 1 Jan 2011 20:00:00 GMT";
	    myheaders["X-CUSTOM-HEADER"] = "Custom header information";
</script>
<session:fetch requestid="_data.reqid"
		srcexpr="'http://www.business1.com/data2/content'" type="'plain-text'"
		method="'get or delete'" timeout="'100'" maxstale="'10'" maxage="'20'"
		username="open" password="'sesame'" headers="myheaders">
	<param name="'param1'" expr="'value1'"/>
	<parm name="'p2'" expr="'v2'"/>
</session:fetch>

Here is how it maps to an HTTP GET/DELETE message:

GET/DELETE /data2/content? param1=value1&p2=v2 HTTP/1.1
Host: www.business1.com
Cache-Control: max-age=10, max-stale=10
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
If-Modified-Since: Sat, 1 Jan 2011 20:00:00 GMT
X-CUSTOM-HEADER: Custom header information
...

Mapping Summary:

Note: The Basic authentication and optional headers will operate exactly the same for POST or PUT types.

<data> mapping

Here is an example of the <data> action:

<state id="bdataY" src="http://www.business1.com/parameters/dataY" />

Here is how it maps to an HTTP GET message:

GET /parameters/dataY HTTP/1.1
Host: www.business1.com
Cache-Control: max-age=10, max-stale=10
...

Mapping Summary:

Note: Basic Authentication and optional HTTP headers have not been shown in this section. Refer to the <fetch> mapping section for an example of how this is handled.

<response> mapping

Here is an example of a positive <response> action:

<ws:response requestid="_event.sendid">
	<param name="'param1'" expr="'value1'"/>
	<parm name="'p2'" expr="'v2'"/>
	<parm name="'p3" expr="'v3'"/>
</ws:response>

Here is how it maps to an HTTP GET Response message:

HTTP/1.1 200 
Content-Type=application/json
Content-Length=xx

{"param1":"value1","p2":"v2","p3":{"a":4,"b":5}}
...

Here is an example of a negative <response> action:

<ws:response requestid="_event.sendid" type="negative"
		resultcode="invalidparameter">
	<param name="'description" expr="'Invalid value for parm2"/>
</ws:response>

Here is how it maps to an HTTP GET Response message:

HTTP/1.1 500 invalidparameter 
Content-Type=application/json
Content-Length=xx

{"description":"Invalid value for parm2"}
...

Mapping Summary:

POST/PUT Message
<fetch> mapping

Here is an example of the <fetch> action with enctype = application/x-www-form-urlcoded:

<session:fetch requestid="_data.reqid"
		srcexpr="'http://www.business1.com/data2/content'" type="'plain-text'"
		method="'post or put'" timeout="'100'" maxstale="'10'"
		maxage="'20'" enctype="'x-www-form-urlcoded'">
	<param name="'param1'" expr="'value1'"/>
	<parm name="'p2'" expr="'v2'"/>
	<parm name="'p3" expr="'v3'"/>
</session:fetch>

Note: v3 has two properties: "a" and "b". v3.a = 4 and v3.b = 5.

Here is how it maps to an HTTP POST/PUT message:

POST/PUT /data2/content HTTP/1.1
Host: www.business1.com
Cache-Control: max-age=10, max-stale=10
Content-Type=application/x-www-form-urlencoded
Content-Length=xx

param1=value1&p2=v2&p3=[object object]
...

Here is an example of the <fetch> action with enctype = application/json:

<session:fetch requestid="_data.reqid"
		srcexpr="'http://www.business1.com/data2/content'" type="'plain-text'"
		method="'post or put'" timeout="'100'" maxstale="'10'"
		maxage="'20'" enctype="'application/json'">
	<param name="'param1'" expr="'value1'"/>
	<parm name="'p2'" expr="'v2'"/>
	<parm name="'p3" expr="'v3'"/>
</session:fetch>

Note: v3 has two properties "a" and "b". v3.a = 4 and v3.b = 5.

Here is how it maps to an HTTP POST/PUT message:

POST/PUT /data2/content HTTP/1.1
Host: www.business1.com
Cache-Control: max-age=10, max-stale=10
Content-Type=application/json
Content-Length=xx

{"param1":"value1","p2":"v2","p3":{"a":4,"b":5}}
...

Mapping Summary:

<response> mapping

Here is an example of a positive <response> action:

<ws:response requestid="_event.sendid">
	<param name="'param1'" expr="'value1'"/>
	<parm name="'p2'" expr="'v2'"/>
	<parm name="'p3" expr="'v3'"/>
</ws:response>

Here is how it maps to an HTTP POST Response message:

HTTP/1.1 200 
Content-Type=application/json
Content-Length=xx

{"param1":"value1","p2":"v2","p3":{"a":4,"b":5}}
...

Here is an example of a negative <response> action:

<ws:response requestid="_event.sendid" type="negative"
		resultcode="invalidparameter">
	<param name="'description" expr="'Invalid value for parm2"/>
</ws:response>

Here is how it maps to an HTTP POST Response message:

HTTP/1.1 500 invalidparameter 
Content-Type=application/json
Content-Length=xx

{"description":"Invalid value for parm2"}
...

Mapping Summary:




Section III – External Interfaces > External Interfaces > Application Server Relationship         Top of Page
Genesys 8.1
SCXML Technical Reference
                        External 2.0 Interfaces >