<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>John James Andersen</title>
	<atom:link href="http://www.john-james-andersen.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.john-james-andersen.com</link>
	<description>The Personal &#38; Professional Website</description>
	<lastBuildDate>Tue, 15 May 2012 17:21:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Using the ServiceNow JDBCProbe</title>
		<link>http://www.john-james-andersen.com/blog/service-now/using-the-servicenow-jdbcprobe.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/using-the-servicenow-jdbcprobe.html#comments</comments>
		<pubDate>Tue, 15 May 2012 17:21:26 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1461</guid>
		<description><![CDATA[There is a lesser known JDBC integration interface to ServiceNow than is generally published to the outside world, but it can make JDBC integrations go much smoother that traditionally supported in the ServiceNow product. A typical JDBC integration in ServiceNow is usually a data pull from a third party into ServiceNow through a one-time or [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/JDBCProbe-300x145.jpg" alt="" title="JDBCProbe" width="300" height="145" class="aligncenter size-medium wp-image-1462" /></p>
<p>There is a lesser known JDBC integration interface to ServiceNow than is generally published to the outside world, but it can make JDBC integrations go much smoother that traditionally supported in the ServiceNow product.</p>
<p>A typical JDBC integration in ServiceNow is usually a data pull from a third party into ServiceNow through a one-time or scheduled JDBC pull using a <a href="http://wiki.service-now.com/index.php?title=Data_Sources" title="ServiceNow Data Sources" target="_blank">Data Source</a> record.  This works great for bringing bulk data from an external source into ServiceNow. </p>
<p>What if, however, you want a more transactional data pull&#8230;or even to set data in the external database using JDBC?  There is a way to do this by creating XML payloads on the ECC queue.  There is some pretty good <a href="http://wiki.service-now.com/index.php?title=JDBCProbe" title="JDBCProbe through ECC Queue" target="_blank">ECC Queue &#8211; JDBC Probe</a> documentation on the wiki.  This can be cumbersome, however to build ECC Queue records with XML documents for the queries you wish to make.  There is a much easier way!</p>
<p>Unfortunately, what I am about to demonstrate does not come with a vanilla instance, but requires the &#8220;Integration &#8211; JDBC&#8221; plugin.  Just request the plugin for your instance via HI, or through your account representative.  It is a small plugin that can be enabled in a matter of seconds by ServiceNow.</p>
<p>The plugin will create, among other things, a Script Include called &#8220;JDBCProbe&#8221;.  This script include creates an API for generating the XML payloads on the ECC Queue so that you don&#8217;t have to worry about how to represent SQL statements in XML.</p>
<h1>JDBCProbe API Basics</h1>
<p>Every JDBCProbe API call will require some initial parameters and values.  </p>
<p><strong>MID Server: </strong>The JDBCProbe requires a MID Server for execution.  Specify the name of the MID Server as it it shown in the MID Server list.  </p>
<p>Here is what my MID Server list looks like:<br />
<img src="http://www.john-james-andersen.com/wp-content/uploads/MIDList.png" alt="" title="MIDList" width="574" height="89" class="aligncenter size-full wp-image-1464" /></p>
<p>I am going to use my MID Server, &#8220;DEB1&#8243; for these examples.</p>
<p><strong>Driver:</strong> You need to specific the JDBC Driver that will be used to make the JDBC call. This is specific to the type of Database you are calling into.  For this example, I am using a MySQL database.  Thus, the driver string is:  &#8220;com.mysql.jdbc.Driver&#8221;.  Other valid OOB driver classes are:</p>
<blockquote><p>
<em>Oracle</em>: oracle.jdbc.OracleDriver<br />
<em>Microsoft SQL Server</em>: com.microsoft.sqlserver.jdbc.SQLServerDriver<br />
<em>MySQL</em>: com.mysql.jdbc.Driver<br />
<em>Sybase</em>: com.sybase.jdbc3.jdbc.SybDriver<br />
<em>IBM DB2 Universal</em>: com.ibm.db2.jcc.DB2Driver</p></blockquote>
<p><strong>Connection String: </strong>The JDBC protocol uses a connection string to establish the authentication and other parameters to establish a connection between the client and the Database.  Each Database has its own connection string format.  Here is a list taken from the <a href="http://wiki.service-now.com/index.php?title=JDBCProbe#Direct_JDBC_Probe" title="Direct JDBCProbe" target="_blank">ServiceNow JDBCProbe wiki</a> for setting up your connection string:</p>
<blockquote><p><em>Oracle</em>: [jdbc:oracle:thin:<username/password>@<database>]<br />
<em>Microsoft SQL Server</em>: [jdbc:sqlserver://localhost;user=MyUserName;password=*****;]<br />
<em>MySQL</em>: [jdbc:mysql://localhost/database?user=username%26password=passwd]<br />
<em>Sybase</em>: [jdbc:sybase:Tds:10.10.11.162:4100/NCOMS?user=yyy%26password=xxx]<br />
<em>DB2 Universal</em>: [jdbc:db2://sysmvs1.stl.ibm.com:5021/san_jose:user=db2adm;password=db2adm]</p></blockquote>
<p><strong>Function:</strong> This tells the JDBCProbe what type of query you intend to do with the database.  Supported functions are:  &#8220;insert&#8221;, &#8220;select&#8221;, &#8220;update&#8221;, &#8220;delete&#8221;.</p>
<h1>JDBCProbe API Functions</h1>
<p>The following is a list of the functions available by the JDBCProbe Script Include:</p>
<p><strong>JDBCProbe( string MIDServer )  //Constructor</strong><br />
Constructor for the JDBCProbe class.  The MIDServer parameter is the name of the MID Server which will be issuing the database commands.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;DEB1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p><strong>setDriver( string Driver )</strong><br />
Sets the driver class corresponding to the brand of database with which you are connecting.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;DEB1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setDriver</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p><strong>setConnectionString( string connectionString )</strong><br />
Sets the connection string appropriate for the brand of database with which you are connecting.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;DEB1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setConnectionString</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;jdbc:mysql://mysqlserver.org/snctestdb?user=MyUsername&amp;password=MyPassword&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p><strong>setTable( string tablename )</strong><br />
Indicates which table we will query against.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;DEB1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setTable</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;incident&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p><strong>setFunction( string function )</strong><br />
Sets the query function being used.  Supported functions are &#8220;select&#8221;, &#8220;insert&#8221;, &#8220;update&#8221;, &#8220;delete&#8221;.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;DEB1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setFunction</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;insert&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p><strong>addField( string fieldName, string fieldValue )</strong><br />
Adds a field on the insert query.  You should provide both the fieldName as well as the value.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;DEB1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setDriver</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setConnectionString</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;jdbc:mysql://mysqlserver.org/snctestdb?user=MyUsername&amp;password=MyPassword&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setTable</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;incident&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setFunction</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;insert&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">addField</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;priority&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p><strong>addNumberField( string fieldName, string fieldValue )</strong><br />
Adds a field formatted for numbers on the insert query.  You should provide both the fieldName as well as the value.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;DEB1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setDriver</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setConnectionString</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;jdbc:mysql://mysqlserver.org/snctestdb?user=MyUsername&amp;password=MyPassword&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setTable</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;incident&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setFunction</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;insert&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">addNumberField</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;priority&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p><strong>create( )</strong><br />
Creates the JDBCProbe entry on the ECC Queue table for processing.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;DEB1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setDriver</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setConnectionString</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;jdbc:mysql://mysqlserver.org/snctestdb?user=MyUsername&amp;password=MyPassword&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setTable</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;incident&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setFunction</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;insert&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">addField</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;priority&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p><strong>setWhereClause( string whereClause)</strong><br />
Allows you to set a string representing the &#8220;Where&#8221; clause for a select, update, or delete query.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;DEB1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setDriver</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setConnectionString</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;jdbc:mysql://mysqlserver.org/snctestdb?user=MyUsername&amp;password=MyPassword&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setTable</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;incident&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setFunction</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;select&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setWhereClause</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;priority='1'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p><strong>setDataSource( string dataSourceSysId )</strong><br />
This allows you to have all JDBC settings and query information come from a datasource rather than your script.  You will need to pass in the sys_id to the data source record containing this information.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;DEB1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setDataSource</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;11e091bf0a258102005ba7a71b145a8a&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h1>ECC Queue Records</h1>
<p>Once you execute your script and end it with the create() function, an &#8220;output&#8221; record will be placed on the ECC Queue. This output record will contain all of the data set through the script.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/outputReady.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/outputReady.png" alt="" title="outputReady" width="867" height="81" class="aligncenter size-full wp-image-1471" /></a></p>
<p>Once the MID Server grabs the output record, it will execute the query and then return the JDBC response message back via an &#8220;input&#8221; record on the ECC Queue corresponding to the original ECC Queue entry.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/inputReady.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/inputReady.png" alt="" title="inputReady" width="1021" height="112" class="aligncenter size-full wp-image-1472" /></a></p>
<h1>INSERT example</h1>
<p>The following code will insert a row in a table called &#8220;incident&#8221; on a MySQL server that I have:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DEB1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setDriver</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'com.mysql.jdbc.Driver'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setConnectionString</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'jdbc:mysql://mySqlServer.org/snctest?user=MyUser&amp;password=MyPassword'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setTable</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;incident&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setFunction</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;insert&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">addField</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;summary&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;My chair will not roll smoothly&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">addNumberField</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;priority&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">addField</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;urgency&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;2&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">addField</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;impact&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>This code creates an output record on the ECC Queue that has the following Payload:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jdbc_driver&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;connection_string&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;jdbc:mysql://mysql.ht4.org/snctest?user=snctest&amp;password=sncrocks&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;work&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;insert</span> <span style="color: #000066;">table</span>=<span style="color: #ff0000;">&quot;incident&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;summary<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>My chair will not roll smoothly<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/summary<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;impact<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/impact<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;urgency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/urgency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;priority</span> <span style="color: #000066;">quoted</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/priority<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/insert<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>The result is created by the MID Server on the ECC Queue.  Here is the Payload of the result:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;results</span> <span style="color: #000066;">probe_time</span>=<span style="color: #ff0000;">&quot;6449&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;result<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;insertResult<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1 rows inserted<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/insertResult<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/result<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;result</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;topic&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;JDBCProbe&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;work&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;lt;work&amp;gt;&amp;lt;insert table=&amp;quot;incident&amp;quot;&amp;gt;&amp;lt;summary&amp;gt;My chair will not roll smoothly&amp;lt;/summary&amp;gt;&amp;lt;impact&amp;gt;1&amp;lt;/impact&amp;gt;&amp;lt;urgency&amp;gt;2&amp;lt;/urgency&amp;gt;&amp;lt;priority quoted=&amp;quot;false&amp;quot;&amp;gt;1&amp;lt;/priority&amp;gt;&amp;lt;/insert&amp;gt;&amp;lt;/work&amp;gt;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;connection_string&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;jdbc:mysql://mysql.ht4.org/snctest?user=snctest&amp;amp;password=sncrocks&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;queue&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;output&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;error&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;from_sys_id&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jdbc_driver&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sys_id&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;80d4367b507da0006d49b2e21aafd57a&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;state&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;ready&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;from_host&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;agent&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;mid.server.DEB1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;processed&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ecc_queue&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;80d4367b507da0006d49b2e21aafd57a&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;response_to&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;source&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sequence&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;1373db366fe0000001&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;JDBCProbe&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;table_name&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;ecc_queue&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;agent_correlator&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/results<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<h1>UPDATE example</h1>
<p>The following code will update all incidents in my database that have a priority of 1.  It will set the urgency field to 4.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DEB1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setDriver</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'com.mysql.jdbc.Driver'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setConnectionString</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'jdbc:mysql://mySqlServer.org/snctest?user=MyUser&amp;password=MyPassword'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setTable</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;incident&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setFunction</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;update&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">addField</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;urgency&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;4&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setWhereClause</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;priority='1'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>It creates an output record in the ECC queue with the following Payload:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jdbc_driver&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;connection_string&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;jdbc:mysql://mysql.ht4.org/snctest?user=snctest&amp;amp;password=sncrocks&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;work&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;update</span> <span style="color: #000066;">table</span>=<span style="color: #ff0000;">&quot;incident&quot;</span> <span style="color: #000066;">where</span>=<span style="color: #ff0000;">&quot;priority='1'&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;urgency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>4<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/urgency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/update<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>The result is created by the MID Server on the ECC Queue.  Here is the Payload of the result:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;results</span> <span style="color: #000066;">probe_time</span>=<span style="color: #ff0000;">&quot;102&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;result<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;updateResult<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>4 rows updated<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/updateResult<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/result<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;result</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;topic&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;JDBCProbe&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;work&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;lt;work&amp;gt;&amp;lt;update table=&amp;quot;incident&amp;quot; where=&amp;quot;priority='1'&amp;quot;&amp;gt;&amp;lt;urgency&amp;gt;4&amp;lt;/urgency&amp;gt;&amp;lt;/update&amp;gt;&amp;lt;/work&amp;gt;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;connection_string&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;jdbc:mysql://mysql.ht4.org/snctest?user=snctest&amp;amp;password=sncrocks&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;queue&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;output&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;error&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;from_sys_id&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jdbc_driver&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sys_id&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;d2d6367b507da0006d49b2e21aafd5ad&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;state&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;ready&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;from_host&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;agent&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;mid.server.DEB1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;processed&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ecc_queue&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;d2d6367b507da0006d49b2e21aafd5ad&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;response_to&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;source&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sequence&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;1373db889dd0000001&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;JDBCProbe&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;table_name&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;ecc_queue&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;agent_correlator&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/results<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<h1>SELECT example</h1>
<p>The following code will select all incidents in my database that have a priority of 1.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DEB1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setDriver</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'com.mysql.jdbc.Driver'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setConnectionString</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'jdbc:mysql://mySqlServer.org/snctest?user=MyUser&amp;password=MyPassword'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setTable</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;incident&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setFunction</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;select&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setWhereClause</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;priority='1'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>It creates an output record in the ECC queue with the following Payload:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jdbc_driver&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;connection_string&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;jdbc:mysql://mysql.ht4.org/snctest?user=snctest&amp;amp;password=sncrocks&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;work&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;select</span> <span style="color: #000066;">table</span>=<span style="color: #ff0000;">&quot;incident&quot;</span> <span style="color: #000066;">where</span>=<span style="color: #ff0000;">&quot;priority='1'&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>The result is created by the MID Server on the ECC Queue.  The &#8220;Name&#8221; field contains the number of rows returned.  Here is the Payload of the result:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;results</span> <span style="color: #000066;">probe_time</span>=<span style="color: #ff0000;">&quot;236&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;result</span> <span style="color: #000066;">query</span>=<span style="color: #ff0000;">&quot;SELECT * FROM incident WHERE priority='1'&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;row</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;summary</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;255&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>My chair will not roll smoothly<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/summary<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Long&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;-5&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;external_id</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;255&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;priority</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Integer&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/priority<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;external_system</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;255&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;impact</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Integer&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/impact<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;urgency</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Integer&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>4<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/urgency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/row<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;row</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;summary</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;255&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>My chair will not roll smoothly<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/summary<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Long&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;-5&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;external_id</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;255&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;priority</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Integer&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/priority<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;external_system</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;255&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;impact</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Integer&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/impact<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;urgency</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Integer&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>4<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/urgency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/row<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;row</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;summary</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;255&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>My chair will not roll smoothly<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/summary<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Long&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;-5&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;external_id</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;255&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;priority</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Integer&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/priority<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;external_system</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;255&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;impact</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Integer&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/impact<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;urgency</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Integer&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>4<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/urgency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/row<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;row</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;summary</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;255&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>My chair will not roll smoothly<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/summary<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Long&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;-5&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>4<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;external_id</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;255&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;priority</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Integer&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/priority<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;external_system</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;255&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;impact</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Integer&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/impact<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;urgency</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;java.lang.Integer&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>4<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/urgency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/row<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/result<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;topic&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;JDBCProbe&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;work&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;lt;work&amp;gt;&amp;lt;select table=&amp;quot;incident&amp;quot; where=&amp;quot;priority='1'&amp;quot;/&amp;gt;&amp;lt;/work&amp;gt;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;connection_string&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;jdbc:mysql://mysql.ht4.org/snctest?user=snctest&amp;amp;password=sncrocks&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;queue&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;output&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;error&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;from_sys_id&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jdbc_driver&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sys_id&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;23d7367b507da0006d49b2e21aafd5ae&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;state&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;ready&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;from_host&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;agent&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;mid.server.DEB1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;processed&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ecc_queue&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;23d7367b507da0006d49b2e21aafd5ae&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;response_to&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;source&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sequence&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;1373dbca0140000001&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;JDBCProbe&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;table_name&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;ecc_queue&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;agent_correlator&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/results<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<h1>DELETE example</h1>
<p>The following code will delete all incidents in my database that have a priority of 1.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> j <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> JDBCProbe<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DEB1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setDriver</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'com.mysql.jdbc.Driver'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setConnectionString</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'jdbc:mysql://mySqlServer.org/snctest?user=MyUser&amp;password=MyPassword'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setTable</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;incident&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setFunction</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;delete&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">setWhereClause</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;priority='1'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
j.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>It creates an output record in the ECC queue with the following Payload:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jdbc_driver&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;connection_string&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;jdbc:mysql://mysql.ht4.org/snctest?user=snctest&amp;amp;password=sncrocks&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;work&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">table</span>=<span style="color: #ff0000;">&quot;incident&quot;</span> <span style="color: #000066;">where</span>=<span style="color: #ff0000;">&quot;priority='1'&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>The result is created by the MID Server on the ECC Queue.  The &#8220;Name&#8221; field contains the number of rows returned.  Here is the Payload of the result:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;results</span> <span style="color: #000066;">probe_time</span>=<span style="color: #ff0000;">&quot;67&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;result<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;deleteResult<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>4 rows deleted<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/deleteResult<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/result<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;result</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;topic&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;JDBCProbe&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;work&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;lt;work&amp;gt;&amp;lt;delete table=&amp;quot;incident&amp;quot; where=&amp;quot;priority='1'&amp;quot;/&amp;gt;&amp;lt;/work&amp;gt;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;connection_string&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;jdbc:mysql://mysql.ht4.org/snctest?user=snctest&amp;amp;password=sncrocks&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;queue&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;output&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;error&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;from_sys_id&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jdbc_driver&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sys_id&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;31e8b6bb507da0006d49b2e21aafd57f&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;state&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;ready&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;from_host&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;agent&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;mid.server.DEB1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;processed&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ecc_queue&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;31e8b6bb507da0006d49b2e21aafd57f&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;response_to&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;source&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sequence&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;1373dc001800000001&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;JDBCProbe&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;table_name&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;ecc_queue&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;agent_correlator&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/results<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/using-the-servicenow-jdbcprobe.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Understanding ServiceNow SAML 2.0 Logs</title>
		<link>http://www.john-james-andersen.com/blog/service-now/understanding-servicenow-saml-2-0-logs.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/understanding-servicenow-saml-2-0-logs.html#comments</comments>
		<pubDate>Mon, 14 May 2012 14:33:25 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1449</guid>
		<description><![CDATA[The documentation for ServiceNow&#8217;s SAML setup is the best that it has ever been. More and more customers are able to set up SAML correctly without having to engage outside help. That being said, what happens when you set up SAML and things just aren&#8217;t working out correctly? When debugging SAML issues in ServiceNow, there [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/syslog-150x150.png" alt="" title="syslog" width="150" height="150" class="aligncenter size-thumbnail wp-image-1450" /></p>
<p>The documentation for ServiceNow&#8217;s SAML setup is the best that it has ever been.  More and more customers are able to set up SAML correctly without having to engage outside help.  That being said, what happens when you set up SAML and things just aren&#8217;t working out correctly?</p>
<p>When debugging SAML issues in ServiceNow, there are two things I recommend:<br />
1. Use the Debug Log statements in ServiceNow<br />
2. Use a network tracer such as those built into Chrome &#038; Firefox, or Fiddler for Windows users.</p>
<p>This article covers the first recommended action, following the Debug Log statements inside ServiceNow.</p>
<p><H1>Enabling and Viewing Debug Logging</H1><br />
First, you will need to make sure you have Debug Logging enabled for your SAML plugin.  This can be done by browsing to the properties page and checked the Debug Logging checkbox.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/ServiceNow-IT-Service-Management-Suite.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/ServiceNow-IT-Service-Management-Suite.png" alt="SAML Debug Logging Property" title="SAML Debug Logging Property" width="612" height="205" class="aligncenter size-full wp-image-1451" /></a></p>
<p>This will ensure that the SAML debug statements will be logged to your instance&#8217;s System Log.</p>
<p>Now, to browse your System Log, simply go to &#8220;System Logs -> All&#8221;.  I like to sort my logs on creation date where the create time on the filter for the log is after the last statement before I attempt to do a SAML login.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/logs.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/logs.png" alt="Filtering the System Log" title="Filtering the System Log" width="599" height="299" class="aligncenter size-full wp-image-1452" /></a></p>
<p><H1>Typical Log Statements</H1></p>
<p>The following is typical log output for a successful SAML authentication:</p>
<p>This line just shows the SAML processing URL (the one that the IdP will send the Response to when it is done) and also the calculated base URL of the instance for use later on in the script.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Stripping down the serviceURL: https://myinstance.service-now.com/navpage.do to a base URL of: https://myinstance.service-now.com</div></td></tr></tbody></table></div>
<p>Now, in the case of this example, we were using deep linking.  This means that we clicked on a non-home page link an after authentication we want to be redirected to that specific page.  In order for SAML to trigger on that, the url needs to use &#8220;nav_to.do&#8221;.  This is what link we were using in this example:</p>
<pre>https://myinstance.service-now.com/nav_to.do?uri=incident.do?sys_id=46e482d9a9fe198101d3e3f3e2a14459</pre>
<p>In this next log statement, we analyze the destination URL to see if there is deep linking.  The request URI is the page that is being accessed, and the &#8220;Query String&#8221; statement is the parameters on that URL.</p>
<p>Based on the URI an Query String, the script will attempt to use Deep Linking since it found query string parameters.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">requestURI: /nav_to.do<br />
<br />
Query String (qs): uri=incident.do?sys_id=46e482d9a9fe198101d3e3f3e2a14459<br />
<br />
URI Parameter: incident.do?sys_id=46e482d9a9fe198101d3e3f3e2a14459<br />
<br />
There may be Deep Linking involved with this SAML request</div></td></tr></tbody></table></div>
<p>If we were not deep linking, then most of those statements above would be empty, or show a &#8220;null&#8221; value.</p>
<p>Next SAML will try to generate a Relay State parameter.  This is sent to the IdP.  Once authentication is complete on the Identity Provider&#8217;s side, it will redirect back to ServiceNow and it will post this Relay State with the SAML Response.  This lets ServiceNow know where to redirect the browser once the login is completed.</p>
<p>The SAML plugin will URL encode the Relay State value since this is going on the URL that we send to the IdP.  We don&#8217;t want any special URL characters to interfere with the base URL redirection that we are doing.</p>
<p>If there is no relay state, then a default relay state is generated.  Out of the box, this relay state will be the main page of your instance.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Generating a Relay State of: https://myinstance.service-now.com/nav_to.do?uri=incident.do%3fsys_id%3d46e482d9a9fe198101d3e3f3e2a14459</div></td></tr></tbody></table></div>
<p>Once the Relay State is generated, the system will generate an AuthnRequest XML document.  This document will then be DEFLATED, base64 encoded, and URL Encoded and added to the URL as a &#8220;SAMLRequest&#8221; parameter.  The log will show both the XML document for the request, and the full URL with SAMLRequest and RelayState that we will use for redirection to the IdP.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;saml2p:AuthnRequest xmlns:saml2p=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot; AssertionConsumerServiceURL=&quot;https://myinstance.service-now.com/navpage.do&quot; ForceAuthn=&quot;false&quot; ID=&quot;SNC04bc590a4d03b653d77fb07a88a345eb&quot; IsPassive=&quot;false&quot; IssueInstant=&quot;2012-05-09T15:21:52.974Z&quot; ProtocolBinding=&quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST&quot; ProviderName=&quot;https://myinstance.service-now.com/navpage.do&quot; Version=&quot;2.0&quot;&gt;&lt;saml2:Issuer xmlns:saml2=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;https://myinstance.service-now.com&lt;/saml2:Issuer&gt;&lt;saml2p:NameIDPolicy AllowCreate=&quot;true&quot; Format=&quot;urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress&quot; SPNameQualifier=&quot;https://myinstance.service-now.com/navpage.do&quot;/&gt;&lt;saml2p:RequestedAuthnContext Comparison=&quot;exact&quot;&gt;&lt;saml2:AuthnContextClassRef xmlns:saml2=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport&lt;/saml2:AuthnContextClassRef&gt;&lt;/saml2p:RequestedAuthnContext&gt;&lt;/saml2p:AuthnRequest&gt;<br />
<br />
Redirecting to: https://idp.ssocircle.com:443/sso/SSORedirect/metaAlias/ssocircle?SAMLRequest=nVPBcpswEP0VRneDwKa2NcYzlEynnklTYtwechPSYmsGJKoVjvP3BeIkPjTuJNfdp9333j6tkDd11LK0cwe9hT8doPNOTa2RPXcS0lnNDEeFTPMGkDnBivTHLYt8ylprnBGmJl6KCNYpozOjsWvAFmCPSsCv7W1CDs61LAi4LY0uzZN%2FMA1Ijb6xexYuKI0CzY8t34MvDfG%2BGStgJJSQitcIxNvcJKS4y%2BisFPGS8pmk0%2FJLPJXzeVXSOV8s%2BHQWQ9kDMeeI6ghvTxE72Gh0XLuERDSMJjSe0OUujFkUsjjyl%2FPZA%2FHys5SvSkul99d1l88gZN93u3yS%2Fyx244CjkmDvevRHJf8Gi713PT%2BfkvVqtJ6NzO3lNa6T4i8nIOv%2Fbl8FlzvOG1s2cN%2Fc5KZW4slL69o8Zha46%2FU428F4moa792mEfjhWlJxUI5RBw1WdSmkBkXhFPmy473itKgX2gzYFrzzPSQU5xqSPnIOT8zLTtNwqHIyEExfu1cpLWFb3Rm2h%2BpSxV2GCiWF2Xx5C%2BGisHEIFoue5s1xja6x7Mf5fjNbn5jv63tqXv3X9Fw%3D%3D&amp;RelayState=https://myinstance.service-now.com/nav_to.do?uri=incident.do%3fsys_id%3d46e482d9a9fe198101d3e3f3e2a14459</div></td></tr></tbody></table></div>
<p>Here, the user&#8217;s browser is redirected to the IdP for authentication.  Logging is now the responsibility of the IdP.  We will not receive any more log messages in the SAML process until the IdP processed the authentication and redirects the user back to ServiceNow with the SAML response document and relay state.</p>
<p>Logging resumes as we get the response back from the IdP.  Before we act on the response, we first do a number of validation and security checks to ensure we can trust this SAML response.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Response object created<br />
<br />
Issue Instant: 2012-05-09T15:22:01.000Z<br />
<br />
Signature Reference ID: s2e460726688ab83e1875101549b1ad03d4af8837a<br />
<br />
certificate Issuer DN: CN=CA, O=SSOCircle, C=DE<br />
<br />
Public key created<br />
<br />
Signature not in response, attempting to get signature from assertion<br />
<br />
Got signature<br />
<br />
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;ds:Signature xmlns:ds=&quot;http://www.w3.org/2000/09/xmldsig#&quot;&gt;<br />
&lt;ds:SignedInfo&gt;<br />
&lt;ds:CanonicalizationMethod Algorithm=&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;/&gt;<br />
&lt;ds:SignatureMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#rsa-sha1&quot;/&gt;<br />
&lt;ds:Reference URI=&quot;#s255bdf815a7493479752d610386841f58ac677211&quot;&gt;<br />
&lt;ds:Transforms&gt;<br />
&lt;ds:Transform Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#enveloped-signature&quot;/&gt;<br />
&lt;ds:Transform Algorithm=&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;/&gt;<br />
&lt;/ds:Transforms&gt;<br />
&lt;ds:DigestMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;/&gt;<br />
&lt;ds:DigestValue&gt;gtpu2XT1bLHTMkpQeTpiunMO1Yo=&lt;/ds:DigestValue&gt;<br />
&lt;/ds:Reference&gt;<br />
&lt;/ds:SignedInfo&gt;<br />
&lt;ds:SignatureValue&gt;<br />
mCvayhe1KJaLy/o1D9kIpL1t99rTRdedpLw7KQIy9T/siDytBOgo42yr91sfcG2dc7AX/JuQpQh8<br />
HGL63H0ZgadVEp0DlErc8jetkje3o6DgKd/Cw0HAMuJujhh83cFthkQDgX8xg9L7LUqgptqHds/5<br />
ssLyVvCok3dJYyImPX8=<br />
&lt;/ds:SignatureValue&gt;<br />
&lt;ds:KeyInfo&gt;<br />
&lt;ds:X509Data&gt;<br />
&lt;ds:X509Certificate&gt;<br />
MIICjDCCAXSgAwIBAgIFAJRvxcMwDQYJKoZIhvcNAQEEBQAwLjELMAkGA1UEBhMCREUxEjAQBgNV<br />
BAoTCVNTT0NpcmNsZTELMAkGA1UEAxMCQ0EwHhcNMTEwNTE3MTk1NzIxWhcNMTYwODE3MTk1NzIx<br />
WjBLMQswCQYDVQQGEwJERTESMBAGA1UEChMJU1NPQ2lyY2xlMQwwCgYDVQQLEwNpZHAxGjAYBgNV<br />
BAMTEWlkcC5zc29jaXJjbGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbzDRkudC/<br />
aC2gMqRVVaLdPJJEwpFB4o71fR5bnNd2ocnnNzJ/W9CoCargzKx+EJ4Nm3vWmX/IZRCFvrvy9C78<br />
fP1cmt6Sa091K9luaMAyWn7oC8h/YBXH7rB42tdvWLY4Kl9VJy6UCclvasyrfKx+SR4KU6zCsM62<br />
2Kvp5wW67QIDAQABoxgwFjAUBglghkgBhvhCAQEBAf8EBAMCBHAwDQYJKoZIhvcNAQEEBQADggEB<br />
AJ0heua7mFO3QszdGu1NblGaTDXtf6Txte0zpYIt+8YUcza2SaZXXvCLb9DvGxW1TJWaZpPGpHz5<br />
tLXJbdYQn7xTAnL4yQOKN6uNqUA/aTVgyyUJkWZt2giwEsWUvG0UBMSPS1tp2pV2c6/olIcbdYU6<br />
ZecUz6N24sSS7itEBC6nwCVBoHOL8u6MsfxMLDzJIPBI68UZjz3IMKTDUDv6U9DtYmXLc8iMVZBn<br />
cYJn9NgNi3ghl9fYPpHcc6QbXeDUjhdzXXUqG+hB6FabGqdTdkIZwoi4gNpyr3kacKRVWJssDgak<br />
eL2MoDNqJyQ0fXC6Ze3f79CKy/WjeU5FLwDZR0Q=<br />
&lt;/ds:X509Certificate&gt;<br />
&lt;/ds:X509Data&gt;<br />
&lt;/ds:KeyInfo&gt;<br />
&lt;/ds:Signature&gt;<br />
<br />
Signature is valid.</div></td></tr></tbody></table></div>
<p>After the SAML response is validated and trusted by the system, we will process it and attempt to login using the nameId token passed back to use from the IdP.</p>
<p>The log will display the NameID token received from the IdP.  We will match this up with a real user in our system and establish a valid ServiceNow session.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NameID:john.user@service-now.com<br />
<br />
SAML2 NameID: john.user@service-now.com<br />
<br />
SAML2 SessionIndex: s2edd20d41d9a7f3fcdb02360877e9d8cfa313ac11</div></td></tr></tbody></table></div>
<p>At this point, we redirect the user&#8217;s browser to the page indicated by the RelayState that was passed back to us from the IdP.  This should be the same relay state that we sent to the IdP to hold on for us.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">We will be redirecting user to the RelayState: https://myinstance.service-now.com/nav_to.do?uri=incident.do?sys_id=46e482d9a9fe198101d3e3f3e2a14459</div></td></tr></tbody></table></div>
<p>The user is then authenticated and redirected to the relay state&#8217;s URL.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/understanding-servicenow-saml-2-0-logs.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending out ServiceNow Attachments via SOAP</title>
		<link>http://www.john-james-andersen.com/blog/service-now/sending-out-servicenow-attachments-via-soap.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/sending-out-servicenow-attachments-via-soap.html#comments</comments>
		<pubDate>Thu, 10 May 2012 12:47:36 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1441</guid>
		<description><![CDATA[I have had a few people ask me lately how to send record attachments within ServiceNow to other third party services in an integration. My answer has always been descriptive, but I have never really provided any solid examples of performing this type of activity. I have decided to take an example of InstanceA sending [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/paperclip.png" alt="" title="paperclip" width="283" height="222" class="aligncenter size-full wp-image-1442" /></p>
<p>I have had a few people ask me lately how to send record attachments within ServiceNow to other third party services in an integration.  My answer has always been descriptive, but I have never really provided any solid examples of performing this type of activity.  </p>
<p>I have decided to take an example of InstanceA sending a new attachment on an incident record to a third party  system via SOAP Web Services.  In my example, we only send out the attachment if the incident record has an existing &#8220;Correlation ID&#8221; set on the record.  We assume, for the purposes of the example, that the correlation ID corresponds to a unique record in a third party system.  </p>
<p><H1>General Architecture</H1></p>
<p>In order to do this, I created a business rule on the &#8220;Sys_attachment&#8221; table.  The business rule is set to trigger when a new attachment is created.  I&#8217;ve set it to run asynchronously so that it doesn&#8217;t affect the performance of the attachment feature in the product (eg. you don&#8217;t have to wait for us to send the attachment to the third party system for the UI to process the newly attached record).  For every attachment, we will check the parent record&#8217;s correlation ID.  If it is not empty, then we attempt to send the attachment to the third party.</p>
<p><H1>Business Rule Settings &#038; Code</h1>
<p>Name:  Send Correlation Attachments SOAP<br />
When:   async<br />
Insert:  checked<br />
Table:   Attachment [sys_attachment]<br />
Condition: gs.isInteractive()<br />
Script:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gs.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Entering Business Rule to Send Attachment via SOAP&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;Test&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">//Checking to get any correlation ID set on the record</span><br />
<span style="color: #003366; font-weight: bold;">var</span> correlationId <span style="color: #339933;">=</span> getCorrelation<span style="color: #009900;">&#40;</span>current.<span style="color: #660066;">table_name</span><span style="color: #339933;">,</span> current.<span style="color: #660066;">table_sys_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">//We only send attachments if the record correlates to another system</span><br />
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>correlationId <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #006600; font-style: italic;">//Load some common Packages from Java</span><br />
&nbsp; <span style="color: #006600; font-style: italic;">//typically we don't like to do this, but these are commonly used ones</span><br />
&nbsp; <span style="color: #006600; font-style: italic;">//so we should be safe</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> sa <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Packages.<span style="color: #660066;">com</span>.<span style="color: #660066;">glide</span>.<span style="color: #660066;">ui</span>.<span style="color: #660066;">SysAttachment</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> StringUtil <span style="color: #339933;">=</span> Packages.<span style="color: #660066;">com</span>.<span style="color: #660066;">glide</span>.<span style="color: #660066;">util</span>.<span style="color: #660066;">StringUtil</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #006600; font-style: italic;">//Get the base64 encoding of the attachment</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> binData <span style="color: #339933;">=</span> &nbsp;sa.<span style="color: #660066;">getBytes</span><span style="color: #009900;">&#40;</span>current<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> encData <span style="color: #339933;">=</span> &nbsp;StringUtil.<span style="color: #660066;">base64Encode</span><span style="color: #009900;">&#40;</span>binData<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; <span style="color: #006600; font-style: italic;">//Send it via SOAP to the third party - using the third party's </span><br />
&nbsp; <span style="color: #006600; font-style: italic;">//format. &nbsp;This example uses another SN instance, so the SOAP</span><br />
&nbsp; <span style="color: #006600; font-style: italic;">//body uses the format required by ServiceNow</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> s <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> SOAPMessage<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Demo10 ECC Queue'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'insert attachment'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; s.<span style="color: #660066;">setParameter</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'filename'</span><span style="color: #339933;">,</span> current.<span style="color: #660066;">file_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; s.<span style="color: #660066;">setParameter</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mimetype'</span><span style="color: #339933;">,</span> current.<span style="color: #660066;">content_type</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; s.<span style="color: #660066;">setParameter</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'destTable'</span><span style="color: #339933;">,</span> current.<span style="color: #660066;">table_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; s.<span style="color: #660066;">setParameter</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'destSysId'</span><span style="color: #339933;">,</span> correlationId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; s.<span style="color: #660066;">setParameter</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'payload'</span><span style="color: #339933;">,</span> encData<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; s.<span style="color: #660066;">post</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <br />
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; gs.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;The record (&quot;</span><span style="color: #339933;">+</span>current.<span style="color: #660066;">table_name</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;:&quot;</span><span style="color: #339933;">+</span>current.<span style="color: #660066;">table_sys_id</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;) did not have necessary correlation...will not send attachment&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #006600; font-style: italic;">/*<br />
&nbsp;* Checks to see if the record has a correlation ID<br />
&nbsp;* <br />
&nbsp;* Params:<br />
&nbsp;* tablename - name of the table in the system where the record belongs<br />
&nbsp;* sysid - the sys_id of the record in the table<br />
&nbsp;* <br />
&nbsp;* Returns:<br />
&nbsp;* Either a correlation_id value or empty string<br />
&nbsp;*/</span><br />
<span style="color: #003366; font-weight: bold;">function</span> getCorrelation<span style="color: #009900;">&#40;</span>tablename<span style="color: #339933;">,</span> sysid<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> gr <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GlideRecord<span style="color: #009900;">&#40;</span>tablename<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; gr.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span>sysid<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> gr.<span style="color: #660066;">correlation_id</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> gr.<span style="color: #660066;">correlation_id</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h1>A note about the SOAP Message</h1>
<p>In this example, the code from the business rule builds out a SOAPMessage object that consumes another ServiceNow instance&#8217;s SOAP Attachment Web Service.  Typically, you would not be integrating with another ServiceNow instance.  You would create a SOAPMessage record that consumes the third party&#8217;s SOAP web service that supports attachments.  You will use that SOAPMessage object to post the base64 encoded file and its meta data in the format required by the third party.</p>
<h1>Other Documentation</h1>
<p><a href="http://wiki.service-now.com/index.php?title=AttachmentCreator_SOAP_Web_Service" title="AttachmentCreator SOAP Web Service" target="_blank">AttachmentCreator SOAP Web Service</a> &#8211; Official ServiceNow documentation on the inbound AttachmentCreator SOAP web service.  It does not cover an outbound scenario that we demonstrate here.  But it does show the format that ServiceNow uses to accept attachments via SOAP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/sending-out-servicenow-attachments-via-soap.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing SAML 2.0 Frame-in-Frame Timeout issues in ServiceNow</title>
		<link>http://www.john-james-andersen.com/blog/service-now/fixing-saml-2-0-frame-in-frame-timeout-issues-in-servicenow.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/fixing-saml-2-0-frame-in-frame-timeout-issues-in-servicenow.html#comments</comments>
		<pubDate>Tue, 24 Apr 2012 13:15:59 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1411</guid>
		<description><![CDATA[Because ServiceNow was built on a framework of various Frames to built out its standard UI, there are some scenarios where a user will see framing issues in the application. One common scenario where this happens is with SAML 2.0. If a user lets their session expire, and then then click on a link inside [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.john-james-andersen.com/wp-content/uploads/frameInFrame.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/frameInFrame-300x186.png" alt="Frame in Frame issue with SAML 2.0 timeout in ServiceNow" title="frameInFrame" width="300" height="186" class="aligncenter size-medium wp-image-1412" /></a></p>
<p>Because ServiceNow was built on a framework of various Frames to built out its standard UI, there are some scenarios where a user will see framing issues in the application.</p>
<p>One common scenario where this happens is with SAML 2.0.  If a user lets their session expire, and then then click on a link inside the browser, they will be directed to their IdP.  After authentication is verified, the IdP redirects them back to ServiceNow.  The problem here is that it does so in the right hand frame, rather than in the top window.  This yields a result of a frame in frame rendering.  If the user were to hit the refresh button, the app would be displayed properly.  However, it is a bit ugly and most users wouldn&#8217;t think to hit the refresh button to fix the problem.</p>
<p>I often recommend to customers to modify their IdP login page to have <a href="http://www.john-james-andersen.com/blog/programming/bust-out-of-those-frames.html" title="Frame busting javascript" target="_blank">frame busting javascript</a> on the page so that it busts out of the ServiceNow frames.  However, customers don&#8217;t always have that option, or they use Kerberos, which doesn&#8217;t display a form for authentication.</p>
<p>In order to get around that limitation, I have come up with a workaround that should work for most customers.</p>
<h1>Create a UI Page that sets the SAML service URL as the top URL</h1>
<p>I created a UI page that does a sys_property query and finds the SAML 2.0 Service URL that is used by the IdP to redirect us back to ServiceNow.  The UI page then sets that URL as the top URL for the browser window (eliminating extra frames).</p>
<p>Here are the values I used for the UI page:</p>
<p>Name:<br />
<strong>frame_bust</strong></p>
<p>HTML:</p>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;?xml <span style="color: #000066;">version</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1.0&quot;</span> encoding<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;utf-8&quot;</span> ?&gt;</span><br />
<span style="color: #009900;">&lt;j:jelly trim<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;false&quot;</span> xmlns:j<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jelly:core&quot;</span> xmlns:g<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;glide&quot;</span> xmlns:j2<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;null&quot;</span> xmlns:g2<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;null&quot;</span>&gt;</span><br />
<br />
<span style="color: #009900;">&lt;g:evaluate var<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jvar_service_url&quot;</span>&gt;</span><br />
&nbsp; var prop = new GlideRecord(&quot;sys_properties&quot;);<br />
&nbsp; prop.addQuery(&quot;name&quot;, &quot;glide.authenticate.sso.saml2.service_url&quot;);<br />
&nbsp; prop.query();<br />
&nbsp; prop.next(); &nbsp;<br />
&nbsp; prop.value;<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>g:evaluate&gt;</span><br />
<br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><br />
&nbsp; if(&quot;${jvar_service_url}&quot;){<br />
&nbsp; &nbsp; top.location.replace(&quot;${jvar_service_url}&quot;);<br />
&nbsp; }<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>j:jelly&gt;</span></div></td></tr></tbody></table></div>
<h1>Modify the SAML Login Script</h1>
<p>By default, if a user is not deep linking, meaning they are going to a Service-Now URL that is not a &#8220;nav_to.do&#8221; page, then we set the RelayState to navpage.do, which does not break us out of frames as it is a framed page.  We need to modify the default of navpage.do to be our new frame_bust.do page.</p>
<p>To change this, we need to browse to the SAML 2.0 Login Script.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/BrowseToLoginScript.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/BrowseToLoginScript-300x145.png" alt="" title="BrowseToLoginScript" width="300" height="145" class="aligncenter size-medium wp-image-1415" /></a></p>
<p>Once you are there, search for the following snippet of code:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>uriparam<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//No deep linking</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">logDebug</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;No Deep Linking for this SAML request&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; relayState <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">serviceURL</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//Deep Linking</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">logDebug</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;There may be Deep Linking involved with this SAML request&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> destinationURI <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>uriparam<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; destinationURI <span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;?uri=&quot;</span> <span style="color: #339933;">+</span> encodeURIComponent<span style="color: #009900;">&#40;</span>uriparam<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; relayState <span style="color: #339933;">=</span> baseURL <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;/nav_to.do&quot;</span> <span style="color: #339933;">+</span> destinationURI<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Just above that code, enter the following snippet:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//Added to handle frame-in-frame situation</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>uriparam<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; uriparam <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;frame_bust.do&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Hence, that section of code should now look like this:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//Added to handle frame-in-frame situation</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>uriparam<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; uriparam <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;frame_bust.do&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>uriparam<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//No deep linking</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">logDebug</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;No Deep Linking for this SAML request&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; relayState <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">serviceURL</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//Deep Linking</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">logDebug</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;There may be Deep Linking involved with this SAML request&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> destinationURI <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>uriparam<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; destinationURI <span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;?uri=&quot;</span> <span style="color: #339933;">+</span> encodeURIComponent<span style="color: #009900;">&#40;</span>uriparam<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; relayState <span style="color: #339933;">=</span> baseURL <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;/nav_to.do&quot;</span> <span style="color: #339933;">+</span> destinationURI<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<h1>The Result</h1>
<p>Now when we reach ServiceNow without a valid session, and we are not deep linking, instead of sending a default relay state of: https://yourinstance.service-now.com/navpage.do, we send the relay state as https://yourinstance.service-now.com/frame_bust.do.</p>
<p>After the SAML authentication takes place, the user is redirected back to service-now with the frame_bust.do page still in the relay state.  After Service-Now authenticates the user according to the SAML response, it will then redirect you to frame_bust.do.  For a second or so while the page is rendering, you will see a frame-in-frame look, but as soon as the page renders, it will break out of the frame and redirect you to the home page (navpage.do).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/fixing-saml-2-0-frame-in-frame-timeout-issues-in-servicenow.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deep Link Generator</title>
		<link>http://www.john-james-andersen.com/blog/service-now/deep-link-generator.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/deep-link-generator.html#comments</comments>
		<pubDate>Thu, 19 Apr 2012 20:40:49 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>
		<category><![CDATA[ServiceNow]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1406</guid>
		<description><![CDATA[In order for deep linking to work in ServiceNow (especially with SSO configurations such as SAML), you will need to format your URL properly for the deep linking to be preserved through login. ServiceNow uses a page called &#8220;nav_to.do&#8221; to process deep links. The relative SN url is placed in a &#8220;uri&#8221; parameter. For example, [...]]]></description>
			<content:encoded><![CDATA[<p>In order for deep linking to work in ServiceNow (especially with SSO configurations such as SAML), you will need to format your URL properly for the deep linking to be preserved through login.</p>
<p>ServiceNow uses a page called &#8220;nav_to.do&#8221; to process deep links.  The relative SN url is placed in a &#8220;uri&#8221; parameter.</p>
<p>For example, if I want to deep link to </p>
<pre>

https://demo.service-now.com/incident.do
</pre>
<p>I would need to go format my deep link url to be like the following:</p>
<pre>

https://demo.service-now.com/nav_to.do?uri=incident.do
</pre>
<p>This can get tedious, especially if your &#8216;uri&#8217; parameter will contain other special URL characters.</p>
<p>The following is a tool that will allow you to paste the ServiceNow link you wish to use with Deep Linking.  Click the Submit button and the url will be formatted for you automatically.</p>
<p><iframe width='550' height='550' style='border: 0px;' src='/tools/snDeepLinker.php'>Iframes need to be enabled in your browser for this to work, or just browse to: <a href='/tools/snDeepLinker.php'>ServiceNow Deep Linking Tool</a>.</iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/deep-link-generator.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Certified ServiceNow System Administrator</title>
		<link>http://www.john-james-andersen.com/career/awards/certified-servicenow-system-administrator.html</link>
		<comments>http://www.john-james-andersen.com/career/awards/certified-servicenow-system-administrator.html#comments</comments>
		<pubDate>Mon, 02 Apr 2012 17:33:57 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Awards]]></category>
		<category><![CDATA[Latest News]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1401</guid>
		<description><![CDATA[After years of working with ServiceNow, John Andersen made it official by taking the Certified System Administrator exam. He was relieved that his experience paid off as he passed the exam and received the certification.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/SNcertifiedAdmin.png" alt="John Andersen - Certified ServiceNow System Administrator" title="John Andersen - Certified ServiceNow System Administrator" width="666" height="270" class="aligncenter size-full wp-image-1402" /></p>
<p>After years of working with ServiceNow, John Andersen made it official by taking the Certified System Administrator exam.  He was relieved that his experience paid off as he passed the exam and received the certification.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/career/awards/certified-servicenow-system-administrator.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Command Line Execution with ServiceNow MID Servers</title>
		<link>http://www.john-james-andersen.com/blog/service-now/command-line-execution-with-servicenow-mid-servers.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/command-line-execution-with-servicenow-mid-servers.html#comments</comments>
		<pubDate>Wed, 28 Mar 2012 17:58:52 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1390</guid>
		<description><![CDATA[A little known fact about ServiceNow and MID Servers is that ServiceNow can be configured such that it can execute shell commands on a computer that hosts a MID Server. Of course, it will only execute commands that it has rights to execute as the user running the MID Server process, but this can be [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/Shell1.png" alt="Shell Dialog" title="Shell Dialog" width="445" height="247" class="aligncenter size-full wp-image-1391" /></p>
<p>A little known fact about ServiceNow and MID Servers is that ServiceNow can be configured such that it can execute shell commands on a computer that hosts a MID Server.  Of course, it will only execute commands that it has rights to execute as the user running the MID Server process, but this can be very handy with command line integrations.</p>
<p>In order to have a MID Server execute a shell command, simply create a record on the ECC Queue that has the following information:</p>
<blockquote><p><strong>Agent</strong>: YOUR MID SERVER<br />
<strong>Topic</strong>: Command<br />
<strong>Name (optional):</strong> THE COMMAND YOU WISH TO EXECUTE<br />
<strong>Queue</strong>: Output<br />
<strong>Payload (optional)</strong>: An XML document defining a command to execute.</p></blockquote>
<p>There are two ways to do this: the name method and the payload method.  With the &#8220;Name&#8221; method, you place your command in the &#8220;Name&#8221; field fo the ECC Queue record in the format that you normally would on a Shell prompt.  With the &#8220;Payload&#8221; method, you encapsulate the command in an XML document for the MID Server to process.</p>
<p>The advantage of the &#8220;Name&#8221; method is that it is easy to enter and very readable.  The advantage of the &#8220;Payload&#8221; method is that you may need longer command strings than the name field can support (eg. 120 characters).  The Payload field can handle a much larger command.</p>
<h1>The Name Method</h1>
<p>The following record will execute a directory listing with the &#8220;-l&#8221; option for the working directory of the MID Server:</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/shell2.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/shell2.png" alt="ECC Queue Command Example" title="ECC Queue Command Example" width="598" height="294" class="aligncenter size-full wp-image-1392" /></a></p>
<p>Once this executes, a corresponding Input record will be generated:</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/shell3.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/shell3.png" alt="Command Line Result Record in ECC Queue" title="Command Line Result Record in ECC Queue" width="719" height="181" class="aligncenter size-full wp-image-1393" /></a></p>
<p>If you open that record and read the Payload field, you will find the results to me &#8220;ls -l&#8221; query:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;results</span> <span style="color: #000066;">probe_time</span>=<span style="color: #ff0000;">&quot;2165&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;result</span> <span style="color: #000066;">command</span>=<span style="color: #ff0000;">&quot;ls -l&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stdout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>total 52<br />
drwxr-xr-x 2 john john 4096 Mar 28 11:11 bin<br />
drwxr-xr-x 2 john john 4096 Mar &nbsp;6 11:25 conf<br />
-rwxr-xr-x 1 john john 5715 Mar 28 11:11 config.xml<br />
drwxr-xr-x 2 john john 4096 Mar &nbsp;6 11:25 etc<br />
drwxr-xr-x 2 john john 4096 Mar &nbsp;6 11:32 extlib<br />
drwxr-xr-x 8 john john 4096 Mar &nbsp;6 11:25 jre6<br />
drwxr-xr-x 2 john john 4096 Mar &nbsp;6 11:25 lib<br />
drwxr-xr-x 2 john john 4096 Mar &nbsp;6 11:33 logs<br />
drwxr-xr-x 2 john john 4096 Mar &nbsp;6 11:25 properties<br />
-rwxr-xr-x 1 john john &nbsp; 16 Jan 16 14:38 start.sh<br />
-rwxr-xr-x 1 john john &nbsp; 15 Jan 16 14:38 stop.sh<br />
drwxr-xr-x 4 john john 4096 Mar &nbsp;6 11:33 work<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/stdout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stderr</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/result<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;topic&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Command&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;queue&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;output&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;error&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;from_sys_id&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sys_id&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;bc7e5b29508520006d4913147419ba01&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;state&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;ready&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;from_host&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;agent&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;mid.server.DEB1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;processed&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ecc_queue&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;bc7e5b29508520006d4913147419ba01&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;response_to&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;source&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sequence&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;1365a5ab1950000001&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;ls -l&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;table_name&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;ecc_queue&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;agent_correlator&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/results<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<h1>The &#8220;Payload&#8221; Method</h1>
<p>The payload method will yield the same results as the &#8220;Name&#8221; method, but the difference is in the creation of the initial output ecc queue record.</p>
<p>Instead of placing the command in the &#8220;Name&#8221; field of the ECC Queue record we make up a small XML Document and place it in the Payload field.</p>
<p>In this example, we want to see what files within the MID Server installation have changed today:</p>
<p>find /home/john/mid/deb1 -type f -mtime -1 -exec ls -al {} \;</p>
<p>To do this using the Payload method, we create an ECC Queue record that looks like:</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/Shell4.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/Shell4.png" alt="" title="Command Line ECC Queue Record via Payload" width="800" height="285" class="aligncenter size-full wp-image-1394" /></a></p>
<p>The payload as shown in the screenshot is:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;find /home/john/mid/deb1 -type f -mtime -1 -exec ls -al {} \;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>The resulting record will be in the same format as using the Name method, so I won&#8217;t display it here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/command-line-execution-with-servicenow-mid-servers.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ServiceNow: SCCM Integration Demo</title>
		<link>http://www.john-james-andersen.com/videos/service-now-training-videos/servicenow-sccm-integration-demo.html</link>
		<comments>http://www.john-james-andersen.com/videos/service-now-training-videos/servicenow-sccm-integration-demo.html#comments</comments>
		<pubDate>Mon, 19 Mar 2012 15:50:42 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[ServiceNow Training Videos]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1388</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><iframe width="960" height="720" src="http://www.youtube.com/embed/SjBr5SwXaEc?rel=0" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/videos/service-now-training-videos/servicenow-sccm-integration-demo.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ServiceNow/Microsoft SCCM Integration Demo</title>
		<link>http://www.john-james-andersen.com/blog/service-now/servicenowmicrosoft-sccm-integration-demo.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/servicenowmicrosoft-sccm-integration-demo.html#comments</comments>
		<pubDate>Mon, 19 Mar 2012 15:24:48 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1364</guid>
		<description><![CDATA[Within the past year, ServiceNow released a new version of their Microsoft SCCM integration plugin. There are now two existing version available for ServiceNow customers. I created the following demo video to explain the differences between the two plugins, outline when you may choose one version over the other, and provided a small demo explaining [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.youtube.com/watch?v=SjBr5SwXaEc" target="_blank"><img src="http://www.john-james-andersen.com/wp-content/uploads/Slide011-300x225.jpg" alt="ServiceNow integration to Microsoft SCCM" title="ServiceNow integration to Microsoft SCCM" width="300" height="225" class="aligncenter size-medium wp-image-1366" /></a></p>
<p>Within the past year, ServiceNow released a new version of their Microsoft SCCM integration plugin.  There are now two existing version available for ServiceNow customers.  I created the following demo video to explain the differences between the two plugins, outline when you may choose one version over the other, and provided a small demo explaining how to set each plugin up within ServiceNow.</p>
<h1>ServiceNow/SCCM Integration Demo Video</h1>
<p><iframe width="480" height="360" src="http://www.youtube.com/embed/SjBr5SwXaEc?rel=0" frameborder="0" allowfullscreen></iframe></p>
<p>Disclaimer: During the creation of this tutorial video, I discovered some mistakes in the original ServiceNow documentation for the integration.  The video may contains a few of those mistakes, but the wiki has since been corrected.  Please watch the video for a good understanding of the plugin, but use the appropriate ServiceNow wiki pages as your guide when you do your actual set up.</p>
<h1>Known Changes from the Demo</h1>
<ul>
<li>&#8220;Use last run datetime&#8221; should be enabled for the &#8220;SCCM Computer Info&#8221; data source and NOT for the &#8220;SCCM Software&#8221; datasource.  The original documentation (and hence this video) has it reversed.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/servicenowmicrosoft-sccm-integration-demo.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SAML 2.0 Configuration &#8211; Oracle OIF with ServiceNow</title>
		<link>http://www.john-james-andersen.com/blog/service-now/saml-2-0-configuration-oracle-oif-with-servicenow.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/saml-2-0-configuration-oracle-oif-with-servicenow.html#comments</comments>
		<pubDate>Mon, 12 Mar 2012 14:40:50 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1333</guid>
		<description><![CDATA[Last week I worked with Principle Sales Consultant, and all around Oracle Guru, Warren Strange, author of &#8220;Strange Brew&#8221;. Together we took a couple of hours to set up a SAML 2.0 setup between a ServiceNow instance and and Oracle Identity Federation server. While, you don&#8217;t have to customize either product to get this working, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/SNOracle.png" alt="" title="SNOracle" width="300" height="187" class="aligncenter size-full wp-image-1334" /></p>
<p>Last week I worked with Principle Sales Consultant, and all around Oracle Guru, <a href="http://ca.linkedin.com/in/warrenstrange" title="Warren Strange's LinkedIn Profile" target="_blank">Warren Strange</a>, author of <a href="http://blog.warrenstrange.com/" title="Strange Brew - A blog by Warren Strange" target="_blank">&#8220;Strange Brew&#8221;</a>.  Together we took a couple of hours to set up a SAML 2.0 setup between a ServiceNow instance and and Oracle Identity Federation server.  </p>
<p>While, you don&#8217;t have to customize either product to get this working, there are a few potential gotchas that we ran into.  In order to help make this an easier process for everyone, we decided to write up our experience.  </p>
<h1>The ServiceNow Side</h1>
<p>The first step we took was to configure ServiceNow as the Service Provider in this relationship.  In order to do this, we had to do the following:</p>
<p><strong>1) Enable the SAML 2.0 Plugin</strong><br />
You would typically call support, or talk to your account manager to get this activated on your instance.</p>
<p><strong>2) Obtain the OIF Identity Provider Metadata</strong><br />
To obtain the metadata from the OIF server, we browsed to:  http://yourserver.com/fed/idp/metadata</p>
<p><strong>3) Configure the SAML 2.0 Properties in ServiceNow</strong></p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/oifProperties.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/oifProperties.png" alt="" title="oifProperties" width="551" height="510" class="aligncenter size-full wp-image-1339" /></a></p>
<p>For Label (1) in the above screenshot, we used the &#8220;Location&#8221; attribute in the IdP Metadata element that looked like:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SingleSignOnService</span> </span><br />
<span style="color: #009900;"> &nbsp; &nbsp; <span style="color: #000066;">Binding</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; &nbsp; <span style="color: #000066;">Location</span>=<span style="color: #ff0000;">&quot;GET_THIS_VALUE_HERE&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p>For Label (2) in the above screenshot, we used the &#8220;Location&#8221; attribute in the IdP Metada element that looked like:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SingleLogoutService</span> <span style="color: #000066;">Binding</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect&quot;</span> <span style="color: #000066;">Location</span>=<span style="color: #ff0000;">&quot;GET_THIS_VALUE_HERE&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p>Change properties labeled (3) and (4) in the screenshot to be the ServiceNow instance URL that you are configuring.  They will both need to be the same URL in this configuration.  (Some instances have property (3) appended with “/navpage.do”.  Do not include that for this configuration).</p>
<p><strong>4) Import the OIF Certificate into ServiceNow</strong></p>
<p>From the Oracle IDP Metadata, look for the X509Certificate under the &lt;md:KeyDescriptor use=&#8221;signing&#8221;> section.  </p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/oifCertMeta.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/oifCertMeta.png" alt="" title="oifCertMeta" width="589" height="403" class="aligncenter size-full wp-image-1346" /></a></p>
<p>Copy that string and place it between the &#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211; and &#8212;-END CERTIFICATE&#8212;- strings in the SAML 2.0 Certificate in your ServiceNow Instance as seen below:</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/oifCertRecord.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/oifCertRecord.png" alt="" title="oifCertRecord" width="663" height="367" class="aligncenter size-full wp-image-1347" /></a></p>
<p><strong>5) Build a ServiceNow SP Metadata document</strong></p>
<p>This is the most complicated part of the process, but rest assured it is not that difficult.  ServiceNow does not currently build the domain certificate into their SP metadata that they generate.  However, Oracle requires the certificate to be in the metadata.  We could not find a way to add the certificate manually.  It doesn&#8217;t mean it can&#8217;t be done on the Oracle side, we just weren&#8217;t aware of how to do it.  So, the easiest way to move forward is to modify the generated metadata from ServiceNow to include the public certificate PEM in the metadata.</p>
<p>You can get the PEM certificate metadata from your client browser when browsing to your ServiceNow instance.  Use your browser&#8217;s certificate application to export the &#8220;*.service-now.com&#8221; certificate to PEM format.  You should be fine just using the text we used below.  If ServiceNow ever changes the certificate, then you will likely have to use the browser to get it on your own during this configuration.</p>
<p>In your ServiceNow instance, click on the “Metadata” link and copy the metadata to a text editor.  </p>
<p>Add the following section to your meta data between the <SPSSODescriptor> element and the <SingleLogoutService> element:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;KeyDescriptor</span> <span style="color: #000066;">use</span>=<span style="color: #ff0000;">&quot;signing&quot;</span> <span style="color: #000066;">xmlns:md</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:2.0:metadata&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ds:KeyInfo</span> <span style="color: #000066;">xmlns:ds</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/09/xmldsig#&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ds:KeyName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>*.service-now.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ds:KeyName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ds:X509Data</span> <span style="color: #000066;">xmlns:ds</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/09/xmldsig#&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ds:X509Certificate</span> <span style="color: #000066;">xmlns:ds</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/09/xmldsig#&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
MIID6TCCAtGgAwIBAgIQaWG5DFrv6VYEv/tPlqZYbDANBgkqhkiG9w0BAQUFADA8<br />
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMVGhhd3RlLCBJbmMuMRYwFAYDVQQDEw1U<br />
aGF3dGUgU1NMIENBMB4XDTExMDcwNDAwMDAwMFoXDTEzMTAwMjIzNTk1OVowgYEx<br />
CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRIwEAYDVQQHFAlTYW4g<br />
RGllZ28xGDAWBgNVBAoUD1NlcnZpY2Utbm93LmNvbTETMBEGA1UECxQKT3BlcmF0<br />
aW9uczEaMBgGA1UEAxQRKi5zZXJ2aWNlLW5vdy5jb20wggEiMA0GCSqGSIb3DQEB<br />
AQUAA4IBDwAwggEKAoIBAQDACla2WcmR3wo3wxJZw/LJJJ9T5hMHmtCD+7Fgnfqy<br />
+cnTeJ0QK7TbjVkkIR6VoDqurZ/vmul0d8RlqaAhdvErEf7zHd5Iv55IIpZVBmr0<br />
iZ7nC0nHi8Zpu+GNxBptAQSmTldB/aiImb8VHItQTcq3qQM+mBGi+WqR31cPugDF<br />
I2+03f+V5xob0nkE3y00I9dqCpjzrRNrIIZUMJGy4pkpXZDzNWyjPN/Bg7FIRjyo<br />
XyLYHMI1ChOIkzq7yFrEgsI0qOo7j5jYX7DZOIAmX2TTvatYCoWqm1C3QrwRHUvI<br />
2bSLdS+iEQp/fkue336btB1N8+VP5Q/Ri9KvHdJCiN1LAgMBAAGjgaAwgZ0wDAYD<br />
VR0TAQH/BAIwADA6BgNVHR8EMzAxMC+gLaArhilodHRwOi8vc3ZyLW92LWNybC50<br />
aGF3dGUuY29tL1RoYXd0ZU9WLmNybDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYB<br />
BQUHAwIwMgYIKwYBBQUHAQEEJjAkMCIGCCsGAQUFBzABhhZodHRwOi8vb2NzcC50<br />
aGF3dGUuY29tMA0GCSqGSIb3DQEBBQUAA4IBAQB9zifSRfQLsQIbFcfrBg9E1R0o<br />
Nx5sco6WHQ3f8v4RrGO4ZAMGnqDlsAjEG88LzQfeVkqcAmsTWxCyCHW0iGWvUbfN<br />
cAHvLdr9VlLmUnz3wg69VgnW+fwppPAyD1L1ZEafESw5eoivkjcQ5DIedjjKwYiI<br />
FjkLngEOORkBhKmyGLlV7nXWG0VmJkDt5xHH5i3rVq1G8sEV743kSLtK/Dugn7Hf<br />
HSYbiyDpHv8EJmFBYtFFYIPUyKOPowaTu2zj9qJz83X5oLulBd6eLZfaAgsjZ/Rb<br />
1MTfRzgI2mur/IiTx9KL7Ymg+NJm7y7/wb1Fy438OwBANG6VrJUJqjxyYR/a <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ds:X509Certificate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ds:X509Data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ds:KeyInfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/KeyDescriptor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>Your resulting metadata document would look something like this:</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/oifCustomMeta.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/oifCustomMeta.png" alt="" title="oifCustomMeta" width="497" height="397" class="aligncenter size-full wp-image-1348" /></a></p>
<p>Save the meta data as a file and use it in one of the following steps for the OIF Server below.</p>
<h1>Oracle Identity Federation Configuration Steps</h1>
<p><strong>1) Add the ServiceNow SP Metadata into OIF</strong></p>
<p>Navigate to  -> Administration -> Federation</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/oifAddConfig.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/oifAddConfig.png" alt="" title="oifAddConfig" width="672" height="284" class="aligncenter size-full wp-image-1351" /></a></p>
<p>Click on the &#8220;+ Add&#8221; button</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/oifPlusAdd.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/oifPlusAdd.png" alt="" title="oifPlusAdd" width="664" height="333" class="aligncenter size-full wp-image-1352" /></a></p>
<p>Load the meta data file that you created and saved from ServiceNow service provider instance. </p>
<p>This will create Relying Party Provider for OIF. </p>
<p><strong>2) Configure the new Relying Party Record in OIF</strong></p>
<p>Select the newly created provider and click on the “Edit” button to manually edit the provider settings:</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/oifEditConfig.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/oifEditConfig.png" alt="" title="oifEditConfig" width="670" height="258" class="aligncenter size-full wp-image-1353" /></a></p>
<p>On the “Oracle Identity Federation Settings Tab”  make sure you have the following settings:</p>
<p>Under “Attribute Mappings and Filters” check “Email Address” and “Transient One Time Identifier”</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/oifEditSettingsSSO.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/oifEditSettingsSSO.png" alt="" title="oifEditSettingsSSO" width="665" height="415" class="aligncenter size-full wp-image-1354" /></a></p>
<p>Under “Assertion Settings”  enable “Send Signed Assertion” </p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/oifAssertionSettings.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/oifAssertionSettings.png" alt="" title="oifAssertionSettings" width="518" height="210" class="aligncenter size-full wp-image-1355" /></a></p>
<p>Under “Protocol Settings”  enable:<br />
“Include Signing Certificate in XML Signatures”</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/oifProtocolSettings.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/oifProtocolSettings.png" alt="" title="oifProtocolSettings" width="528" height="240" class="aligncenter size-full wp-image-1356" /></a></p>
<p>Under “Messages to Send/Require Signed”  enable  “Send Signed” for Request – HTTP Redirect</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/oifMessagestoSend.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/oifMessagestoSend.png" alt="" title="oifMessagestoSend" width="417" height="219" class="aligncenter size-full wp-image-1357" /></a></p>
<h1>Testing the Integration</h1>
<p>For this setup, we used email address as the token that the IdP would share with ServiceNow for the identity once successful authentication takes place.  In order for this scenario to work, you must have a user created in the ServiceNow users list that has an email address that is the same as the user in OIF that you will be testing with.</p>
<p>To initiate SSO go to your service-now domain. It it configured to use SP initiated SSO. You should  see that you are re-directed to OIF for authentication.  Once authenticated  you will be redirected back again to Service-Now were you will be logged in.</p>
<h1>Credits</h1>
<p>Many thanks to Warren Strange for reaching out to me to set up this configuration.  Also thanks to the engineers on the Oracle side for answering our questions.  Finally, many thanks to ServiceNow for provisioning a demo instance for us to work with to prove out SAML 2.0 functionality between OIF and ServiceNow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/saml-2-0-configuration-oracle-oif-with-servicenow.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
