<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://www.xlayer.co.za/forum/extern.php?action=feed&amp;fid=12&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[SXI Forum / SXI Web Services]]></title>
		<link>https://www.xlayer.co.za/forum/index.php</link>
		<description><![CDATA[The most recent topics at SXI Forum.]]></description>
		<lastBuildDate>Mon, 02 Mar 2020 17:35:05 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[XLayer API v3.0]]></title>
			<link>https://www.xlayer.co.za/forum/viewtopic.php?id=109&amp;action=new</link>
			<description><![CDATA[<p>You can also connect to a MSSQLServer/EXPRESS installation should you prefer.</p><p>This can create a SQLExpress container on your machine with the default ports exposed (1433).&#160; You can also connect to a database that is already installed.&#160; You will need to connect to this database using a tool like DBeaver using the following credentials:</p><div class="quotebox"><blockquote><div><p>Username: sa<br />Password: sXi_Pass (Or whatever is already configured for an existing installation)</p></div></blockquote></div><p>To setup a MSSQL EXPRESS container follow these steps:</p><ol class="decimal"><li><p>Create a directory on your machine E.g. dockerImgCfgs</p></li><li><p>Create a file called docker-compose.yml inside that directory and paste the following into it:</p><div class="codebox"><pre><code>version: &#039;3&#039;

services:
  db01:
    image: mcr.microsoft.com/mssql/server:2017-latest
    container_name: xlayer-api-sqlexpress01
    hostname: xlayer-api-sqlexpress01
    networks:
      - sxiws_net
    ports:
      - 1433:1433
    volumes:
      # ===== Windows Host =====
      - C:\dockerImgCfgs\SQLEXPRESS01:/var/opt/mssql/data
    environment:
      - ACCEPT_EULA=Y
      - SA_PASSWORD=sXi_Pass
      - MSSQL_PID=Express

networks:
  sxiws_net:
    driver: bridge</code></pre></div></li><li><p>Run the following to start your container</p><div class="codebox"><pre><code>docker-compose up</code></pre></div></li><li><p>Connect to this database container and create a &quot;sxirestapi&quot; database.</p></li><li><p>Once the database is created you can start the XLayerAPI and it will create the relevant tables.</p></li></ol><p><strong>NOTE:</strong><br />If you wish to get rid of the container that was launched simply run the following:</p><div class="codebox"><pre><code>docker-compose down</code></pre></div><p>Remember to delete the DBs file system that will have been created in C:\dockerImgCfgs\SQLEXPRESS01</p>]]></description>
			<author><![CDATA[dummy@example.com (SeanR)]]></author>
			<pubDate>Mon, 02 Mar 2020 17:35:05 +0000</pubDate>
			<guid>https://www.xlayer.co.za/forum/viewtopic.php?id=109&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[SXIWebServices-2.3 (Writing to a database) in Docker]]></title>
			<link>https://www.xlayer.co.za/forum/viewtopic.php?id=101&amp;action=new</link>
			<description><![CDATA[<p>Remember if you get the </p><div class="codebox"><pre><code>http: server gave HTTP response to HTTPS client</code></pre></div><p> error you need to perform the following:</p><p>Go to docker settings on your local machine and perform the following:</p><ul><li><p>For <strong>Windows</strong> go to docker settings and on the &quot;Daemon&quot; tab click on the advanced toggle switch and add the following to the json given: </p><div class="codebox"><pre><code>&quot;insecure-registries&quot;: [&quot;xlayer.co.za:5000&quot;]</code></pre></div></li><li><p>For <strong>Linux</strong> edit the &quot;daemon.json&quot; file. The default location is &quot;/etc/docker/daemon.json&quot;. (If the file cannot be found, create it.) then add the following code:</p><div class="codebox"><pre><code>{
  &quot;insecure-registries&quot; : [&quot;xlayer.co.za:5000&quot;]
}</code></pre></div></li></ul>]]></description>
			<author><![CDATA[dummy@example.com (SeanR)]]></author>
			<pubDate>Thu, 17 Oct 2019 05:55:21 +0000</pubDate>
			<guid>https://www.xlayer.co.za/forum/viewtopic.php?id=101&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[SXIWebServices-2.1 in Docker]]></title>
			<link>https://www.xlayer.co.za/forum/viewtopic.php?id=99&amp;action=new</link>
			<description><![CDATA[<p>Requirements for running the SXIWebServices in Docker:</p><ol class="decimal"><li><p>Install Docker</p><ul><li><p>Follow the steps to download docker from this <strong><a href="https://docs.docker.com/v17.09/engine/installation/#supported-platforms" rel="nofollow">link</a></strong> based on your operating system.</p></li></ul></li><li><p>Go to docker settings on your local machine and perform the following:</p><ul><li><p>For <strong>Windows</strong> go to docker settings and on the &quot;Daemon&quot; tab click on the advanced toggle switch and add the following to the json given: </p><div class="codebox"><pre><code>&quot;insecure-registries&quot;: [&quot;xlayer.co.za:5000&quot;]</code></pre></div></li><li><p>For <strong>Linux</strong> edit the &quot;daemon.json&quot; file. The default location is &quot;/etc/docker/daemon.json&quot;. (If the file cannot be found, create it.) then add the following code:</p><div class="codebox"><pre><code>{
  &quot;insecure-registries&quot; : [&quot;xlayer.co.za:5000&quot;]
}</code></pre></div></li></ul></li><li><p>To download the docker image and run it, perform the following:</p><ul><li><p>For <strong>Windows</strong> in an administrator CMD execute the following command:</p><div class="codebox"><pre><code>docker run -p 8080:8080 -d --name SXIWebService -v C:/SXI/XPress/XmlOut:/opt/SXI/XPress/XmlOut -v C:\SXI\WebServiceLogs:/opt/SXI/WebServiceLogs xlayer.co.za:5000/sxiws:2.1</code></pre></div></li><li><p>For <strong>Linux</strong> in a terminal execute the following command:</p><div class="codebox"><pre><code>sudo docker run -p 8080:8080 -d --name SXIWebService -v /opt/SXI/XPress/XmlOut:/opt/SXI/XPress/XmlOut -v /opt/SXI/WebServiceLogs:/opt/SXI/WebServiceLogs xlayer.co.za:5000/sxiws:2.1</code></pre></div></li><li><p>A short explanation:<br />&quot;-v <span style="color: #FF0000">C:/SXI/XPress/XmlOut</span>:<span style="color: blue">/opt/SXI/XPress/XmlOut</span> -v <span style="color: #FF0000">C:\SXI\WebServiceLogs</span>:<span style="color: blue">/opt/SXI/WebServiceLogs</span>&quot;<br />The above argument mounts a directory on your local computer with a directory in the container. The parts highlighted in <span style="color: #FF0000">red</span> point to the directory on your local computer. The parts highlighted in <span style="color: blue">blue</span> point to the directory in the container. <br /><strong><span style="color: #FF0000">NB*</span></strong> if any of the directories highlighted in <span style="color: #FF0000">red</span> do not exist you will get an ERROR. Make sure they are pointing to the correct folder path that exists. Remember that the above example is for Windows however the same applies for Linux as well.</p></li></ul></li></ol><p>After performing these steps Tomcat will be up and running and all SXI web services will be available. You can access them by pointing your browser to <strong>&quot;localhost:8080/SXIWebServices-2.1/&quot;</strong>. The default user of the manager-gui for Tomcat is <strong>&quot;sxi&quot;</strong> and the password is our standard password.</p>]]></description>
			<author><![CDATA[dummy@example.com (MarekR)]]></author>
			<pubDate>Tue, 15 Oct 2019 14:59:59 +0000</pubDate>
			<guid>https://www.xlayer.co.za/forum/viewtopic.php?id=99&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Install and Configure the new SXI Webservices]]></title>
			<link>https://www.xlayer.co.za/forum/viewtopic.php?id=61&amp;action=new</link>
			<description><![CDATA[<p>With v2.3 of the SXI Web services you get some additional functionality.&#160; SXIWebservices are distributed as a war file which can be downloaded from the SXI web server.</p><p>Below are some of the new features:</p><ol class="decimal"><li><p>Each web service has the ability of writing their transaction to a database</p></li><li><p>The tables will be created should they not exist</p></li><li><p>SXIWebServices makes use of Tomcat connection pooling</p></li><li><p>Any database that is supported by Tomcat can be used for SXIWebServices</p></li><li><p>SXI Rest Importer and SXI SOAP Importer can also now be called synchronously</p></li></ol><p>Some of the notable changes:</p><ol class="decimal"><li><p>The config names have been changed to remove the word Async (e.g REST Importer used to be called SXIRESTAsyncImporter.properties however it is now called SXIRESTImporter.properties</p></li><li><p>The REST importer and the SOAP importer each have their own log for both the Async and Sync endpoints - this can be changed if need be.</p></li><li><p>A common return object returned by all SXIWebServices</p></li><li><p>Several bug fixes and code cleanups</p></li></ol><h5><span class="bbu">Asynchronous Operation</span></h5><p>When a calling system calls the asynchronous endpoints the web services will immediately respond with a Transaction Response.&#160; This response will include the results of <strong>SAVING</strong> that transaction <strong>ONLY</strong>.&#160; The transaction IDs that are returned are only the <em>unique internal integration reference numbers</em> that have been generated for each transaction and are not an indication of a full / complete transaction.&#160; Asynchronous operations are typically called when integrating with systems like Service Desks.</p><h5><span class="bbu">Synchronous Operation</span></h5><p>A synchronous operation relies on writing to a database.&#160; The session will keep checking for a response that will be found in the &quot;tranResult&quot; field of specific transaction record that was inserted earlier.&#160; The session will wait for the number of seconds found in the <span style="color: blue"><em>DBSyncTimeout</em></span> configuration properties.&#160; </p><ul><li><p>If a response is found before the time out has expired the data inside the &quot;tranResult&quot; field is sent back to the calling system, as well as a <strong>SUCCESS transaction status</strong>.</p></li><li><p>If the Timeout value expires <em>before</em> the tranResult is found a <strong>FAILED</strong> status is returned to the calling system.</p></li></ul><h5><span class="bbu">Installation:</span></h5><p><em>Prerequisites:</em></p><ol class="decimal"><li><p><a href="https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html" rel="nofollow">Java</a>&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;- <em>v1.8_192 or above</em></p></li><li><p><a href="https://tomcat.apache.org/download-90.cgi" rel="nofollow">Tomcat</a>&#160; &#160; &#160; &#160; &#160; &#160;- <em>v9.0.13 or above</em></p></li><li><p><a href="https://www.microsoft.com/en-us/sql-server/sql-server-editions-express" rel="nofollow">MS SQLExpress</a> - <em> v2017 or above installed on your local server</em></p></li></ol><h5>Basic Steps</h5><ol class="decimal"><li><p>Download the SXIWebServices-2.3.war file from the SXI FTP server</p></li><li><p><strong>Rename</strong> SXIWebServices-2.3.war to SXIWebServices.war</p></li><li><p>Place the war file in the tomcat/webapps directory. <em>Tomcat will extract it for you.</em></p></li><li><p>Configure the relevant properties files</p></li><li><p>Each SXIWebService endpoint has 3 potential outputs:</p><ol class="alpha"><li><p>XML file on the file system</p></li><li><p>Database</p></li><li><p>Elastic Search (Big Data - typically for reporting)</p></li></ol></li><li><p>Configure the endpoints (<em>discussed below</em>)</p></li><li><p>Ensure the configuration that you are pointing to exists and can be accessed.</p></li><li><p>Restart Tomcat to activate the new configuration.</p></li></ol><h5>Configuration</h5><ol class="decimal"><li><p><strong>Configure transactions to be written to an XML File:</strong><br />To configure the SXIWebService endpoint to create an XML file on the file system, edit the .properties file corresponding to the endpoint you wish to use.&#160; These property files can be found in <em>[tomcat_dir]/webapps/SXIWebServices/WEB-INF/classes</em> directory.</p><ol class="alpha"><li><p>This functionality can be turned on by changing the <span style="color: blue"><em>CreateXML</em></span> property from <strong>No</strong> to <strong>Yes</strong>.</p></li><li><p>By default the <strong>Windows</strong> version of the <span style="color: blue"><em>XMLOutputPath</em></span> is active.&#160; Typically this is configured to point to the XPress XmlIn1, XmlIn2 or typically XmlOut directory.&#160; If SXIWebServices is installed on a *nix machine then simply comment out the Windows <span style="color: blue"><em>XMLOutputPath</em></span> property and un-comment the *Nix version and point the <span style="color: blue"><em>XMLOutputPath</em></span> to the directory you wish to have the transaction files written into.</p></li><li><p>Set the <span style="color: blue"><em>XMLEncoding</em></span> to either ISO-8859-1 / UTF-8.&#160; This determines what characterset is allowed to be placed into the XML output file.</p></li><li><p><span style="color: blue"><em>DefaultDestination</em></span> must contain the IP address or hostname of the server where XPressStation is listening for transactions to be processed.&#160; This can be left to 127.0.0.1 if you have configured <em>XMLOutputPath</em> to <strong>XmlOut</strong> - <em> For more details about using the XLayer Transport Module <strong>XPress</strong> please speak to your <a href="http://www.sxi.co.za" rel="nofollow">SXI</a> representative.</em></p></li></ol><p><span style="color: red"><strong>NOTE:</strong> You MUST have <strong><em>write</em></strong>&#160; permissions to access the directory configured in <em>XMLOutputPath</em> and the machine must have enough disk space to write those files.</span></p><p>If you have enabled Creating XML files your config should include a section that look as follows:</p><div class="codebox"><pre><code>#==============================================================================#
#Do you want the trigger to be created as an XML file: Yes/No
CreateXML=Yes
# Windows paths must use forward slashes.
XMLOutputPath = C:/SXI/XPress/XmlOut
#Unix
#XMLOutputPath = /opt/SXI/docstore/process
#This can be used to change the XML declaration (ISO-8859-1 / UTF-8)
XMLEncoding=ISO-8859-1
DefaultDestination = 127.0.0.1</code></pre></div></li><li><p><strong>Configure transactions to be written to a Database:</strong><br />There are 2 parts to this configuration:</p><ul><li><p>The properties file - <strong>Note:</strong> not all the properties are needed any longer as we have moved to connection pooling and the redundant properties will be removed in due course.</p></li><li><p>The Context.xml file used to configure <a href="https://tomcat.apache.org/tomcat-9.0-doc/jndi-datasource-examples-howto.html" rel="nofollow">Tomcat&#039;s Connection Pooling</a>.</p></li></ul><p>To turn on the functionality of writing the transactions to a database you need to change the <em>CreateDBRecord</em> property from <strong>No</strong> to <strong>Yes</strong>.</p><ol class="alpha"><li><p><strong>The Properties File:</strong></p><ol class="decimal"><li><p>This functionality can be turned on by changing the <span style="color: blue"><em>CreateDBRecord</em></span> property from <strong>No</strong> to <strong>Yes</strong>.&#160; <em>This will always be here</em></p></li><li><p><span style="color: blue"><em>DBType</em></span> refers to the type of database you are going to write the transactions into.&#160; In THIS example we will write transactions to a MSSQLExpress server that has been installed locally.&#160; </p><ul><li><p><span style="color: red"><strong>Note:</strong> you will need to download the jtds-1.3.1.jar file and copy it to the <em>[tomcat_dir]/lib</em> directory.</span>&#160; This jar file can be downloaded from the SXI FTP Server.</p></li><li><p>If you are wanting to write to a different database you will need to download the database driver jar file that is needed to communicate with that specific database type and copy it into the [tomcat_dir]/lib directory.&#160; There will also be further configuration to change in the Context.xml part.</p></li></ul></li><li><p>The <span style="color: blue"><em>DBServer</em></span> property refers to the IP address or hostname of the server where the database is installed.</p></li><li><p>The <span style="color: blue"><em>DBPort</em></span> property refers to the port the database is listening on.&#160; </p><ul><li><p><span style="color: red"><strong>Note:</strong> SQLExpress will <strong> NOT</strong> work unless you ensure that TCP is enabled and that the firewall is not blocking traffic on port 1433.</span>&#160; </p></li></ul><ul><li><p><a href="http://support.webecs.com/kb/a868/how-do-i-configure-sql-server-express-to-allow-remote-tcp-ip-connections-on-port-1433.aspx" rel="nofollow">Here is a web page explaining how to do this</a>.</p></li></ul></li><li><p><span style="color: blue"><em>DBUser</em></span> is a user that has suitable permissions to create a table and insert records into the <em>DBName</em> in the <em>DBTriggerTable</em>&#160; </p></li><li><p><span style="color: blue"><em>DBPass</em></span> is the password <em>in clear text</em> for the <em>DBUser</em>.</p></li><li><p><span style="color: blue"><em>DBName</em></span> is the name of the database where the Web Service Transactions will be written to. </p><ul><li><p><span style="color: red"><strong>NOTE:</strong> This database <strong>MUST</strong> already exist before you can connect with the SXIWebServices.</span></p></li></ul></li><li><p><span style="color: blue"><em>DBTriggerTable</em></span> this is the name of the table where the transactions will actually be written to.&#160; <strong>Note:</strong>&#160; This table will be created if it does not already exist. </p></li><li><p><span style="color: blue"><em>DBSyncTimeout</em></span> is a value in seconds indicating how long the <em>Synchronous</em> endpoints will wait for a response before returning to the calling system.&#160; Please see more about the Synchronous operation lower down in this document. </p></li></ol><p>If you have enabled writing transactions to a database your config should include a section that look as follows:</p><div class="codebox"><pre><code>#==============================================================================#
#Do you want the trigger to be inserted into a Database Table: Yes/No
CreateDBRecord=Yes
DBType=MSSQL
DBServer=127.0.0.1
DBPort=1433
DBUser=sa
DBPass=qwerty
DBName=SXI_WS_Transactions
DBTriggerTable=SXIWSTriggers
DBSyncTimeout=15</code></pre></div></li><li><p><strong>The context.xml File:</strong><br />The content.xml file can be found in the <em>[tomcat_dir]/webapps/SXIWebServices/META-INF</em> directory.<br /><span style="color: red"><strong>Do NOT change the configuration option <em>name=&quot;jdbc/sxiwsDB&quot;</em>. It will break the connection pooling.&#160; This will be address by configuration in a later version.</strong></span><br />You will not need to change everything in the Context.xml file and most of the fields are best left unchanged.&#160; However the following will have to be changed:</p><ol class="decimal"><li><p><span style="color: blue"><em>username</em></span> is a user that has suitable permissions to create a table and insert records into the <em>url</em> database</p></li><li><p><span style="color: blue"><em>password</em></span> is the password <em>in clear text</em> for the <em>DBUser</em>.</p></li><li><p><span style="color: blue"><em>url</em></span> must include the SQL server (IP or name):port/&lt;dbname&gt;.</p><ul><li><p><span style="color: red"><strong>Note:</strong> there is no need to change the jdbc:jtds:sqlserver:// part of this url when we are using MSSQLExpress</span></p></li><li><p>If you are wanting to write to a different database you will need to download the database driver jar file that is needed to communicate with that specific database type you are wanting to write to and then copy it into the [tomcat_dir]/lib directory.&#160; You will also need to change the <span style="color: blue"><em>driverClassName</em></span>, <span style="color: blue"><em>type</em></span>and <span style="color: blue"><em>url</em></span> (jdbc:jtds:sqlserver) lines in the Context.xml file.</p></li></ul></li></ol><div class="codebox"><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE xml&gt;
&lt;Context path=&quot;/SXIWebServices&quot;&gt;
  &lt;Resource 
	auth=&quot;Container&quot; 
	driverClassName=&quot;net.sourceforge.jtds.jdbc.Driver&quot; 
	maxActive=&quot;1000&quot; 
	maxIdle=&quot;30&quot; 
	maxWait=&quot;10000&quot; 
	name=&quot;jdbc/sxiwsDB&quot; 
	password=&quot;qwerty&quot; 
	removeAbandoned=&quot;true&quot; 
	removeAbandonedTimeout=&quot;30&quot; 
	type=&quot;javax.sql.DataSource&quot; 
	url=&quot;jdbc:jtds:sqlserver://localhost:1433/SXI_WS_Transactions&quot; 
	username=&quot;sa&quot; 
	validationQuery=&quot;select 1&quot;/&gt;
&lt;/Context&gt;</code></pre></div></li></ol></li><li><p><strong>Configure transactions to be written to Elastic Search:</strong><br />This can be turned on by changing the <span style="color: blue"><em>CreateXDataRecord</em></span> from <strong>No</strong> to <strong>Yes</strong>.</p><p>You will also need to configure the <span style="color: blue">IP address</span> and <span style="color: blue">port</span> of the Elastic Search index server.</p><p>If you have enabled writing XData records to be processed your config should include a section that look as follows:</p><div class="codebox"><pre><code>#==============================================================================#
#Do you want the trigger to be inserted into the X-Data Index: Yes/No
CreateXDataRecord=Yes
XDataIndexServer=127.0.0.1
XDataIndexPort=9200</code></pre></div></li></ol>]]></description>
			<author><![CDATA[dummy@example.com (SeanR)]]></author>
			<pubDate>Wed, 28 Nov 2018 18:04:31 +0000</pubDate>
			<guid>https://www.xlayer.co.za/forum/viewtopic.php?id=61&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[SXISOAPImporter installation]]></title>
			<link>https://www.xlayer.co.za/forum/viewtopic.php?id=35&amp;action=new</link>
			<description><![CDATA[<ol class="decimal"><li><p>Download the latest SXISOAPImporter.war file from the SXI server /opt/installers directory</p></li><li><p>Copy this file into your TOMCAT_HOME/webapps directory</p></li><li><p>Start your Apache Tomcat service</p></li><li><p>Apache Tomcat will automatically install the web service and you will then be in a position to manage the SXISOAPImporter service from the Apache Manager App .(<a href="http://localhost:8080/manager/html" rel="nofollow">http://localhost:8080/manager/html</a>)</p></li><li><p>The SXISOAPImporter help page can be accessed from <a href="http://localhost:8080/SXISOAPImporter/" rel="nofollow">http://localhost:8080/SXISOAPImporter/</a></p></li><li><p>As described in the SXISOAPImporter help page the configuartion file SXISOAPImporter.properties is found in TOMCAT_HOME/webapps/SXISOAPImporter/WEB-INF/Classes directory</p></li><li><p>The SXISOAPImporter log file is found in TOMCAT_HOME/webapps/SXISOAPImporter/logs</p></li></ol>]]></description>
			<author><![CDATA[dummy@example.com (SeanR)]]></author>
			<pubDate>Wed, 21 Nov 2018 16:29:26 +0000</pubDate>
			<guid>https://www.xlayer.co.za/forum/viewtopic.php?id=35&amp;action=new</guid>
		</item>
	</channel>
</rss>
