<?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"
	>

<channel>
	<title>Inverse2</title>
	<atom:link href="http://inverse2.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://inverse2.com</link>
	<description>An open source community developing a RESTful web service framework and java based XML interface toolkit</description>
	<pubDate>Wed, 13 Aug 2008 22:48:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>News</title>
		<link>http://inverse2.com/?p=8</link>
		<comments>http://inverse2.com/?p=8#comments</comments>
		<pubDate>Wed, 21 May 2008 14:20:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://localhost/inverse2/?p=8</guid>
		<description><![CDATA[16 July 2008 - AjaxToaster Version 1.0.0.RC2 released.
AjaxToaster is an Ajax application server which makes it easy to create RESTful web services for rich web client applications.  It  runs under any of the main Java servlet containers (tomcat/glassfish/websphere/jboss/jetty) and you can download the war file and release notes now.

9 July 2008 - XMLToaster [...]]]></description>
			<content:encoded><![CDATA[<div class="announcement_post"><blockquote><p><span><em>16 July 2008</em> - AjaxToaster Version 1.0.0.RC2 released.<br />
AjaxToaster is an Ajax application server which makes it easy to create RESTful web services for rich web client applications.  It  runs under any of the main Java servlet containers (tomcat/glassfish/websphere/jboss/jetty) and you can download the <a href="http://inverse2.com/?page_id=10">war file</a> and <a href="http://inverse2.com/downloads/AjaxToaster/1_0_0_RC2/Docs/releaseNotes.html">release notes</a> now.<br />
</span></p></blockquote>
<blockquote><p><span><em>9 July 2008</em> - XMLToaster Version 1.0.12 released.   Another small enhancement - You may now choose the type of logging that you want XMLToaster to use - either standard Java logging or Log4J.  The jar file is now available for <a href="http://inverse2.com/?page_id=10">download</a>.<br />
</span></p></blockquote>
<blockquote><p><span><em>8 July 2008</em> - XMLToaster <a href="http://inverse2.com/?page_id=10">Version1.0.11</a> released.   The runtime is now Java 5 and you may now specify a namespace for an XML message that does not have an associated XSD schema.</span></p></blockquote>
<p><span id="more-8"></span></p>
<blockquote><p><span><em>3 May 2008</em> - XMLToaster Version1.0.10 released.  See the <a href="http://inverse2.com/?page_id=10">downloads page</a>.  This is a bugfix release which increases support for MySQL, improves error handling to give meaningful messages and some tweaks for compatibility with AjaxToaster.<br />
</span></p></blockquote>
<blockquote><p><span><em>3 May 2008</em> - We&#8217;ve put the new <a href="http://inverse2.com/?page_id=28"><strong>AjaxToaster</strong></a> code on the download page.  This is a server which is designed to make it very easy for your ajax applications to get data from, and persist data to your databases.  The goal is to provide a powerful but simple and easy to use SOA.</span></p>
<p>The <a href="http://inverse2.com/?page_id=10">downloads page</a> contains a beta version of the ajaxToaster servlet that can be installed under any application server.  Read the <a href="http://inverse2.com/documentation/AjaxToasterTutorial.html">tutorial</a> for information on how to set it up.</p>
<p>It also contains an alpha version of an &#8220;all in one&#8221; development environment for windows - this installer comes bundled with an application server and DBMS.  After installing just go to http://localhost:8089 to access example applications and scripts and the ajaxToaster admin console.   Apologies that this is only for windows at the moment, but a debian package is in the works.</p></blockquote>
<p><a href="http://inverse2.com/?page_id=21">News Archive&#8230;</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://inverse2.com/?feed=rss2&amp;p=8</wfw:commentRss>
		</item>
		<item>
		<title>RESTful Web Services - part II</title>
		<link>http://inverse2.com/?p=44</link>
		<comments>http://inverse2.com/?p=44#comments</comments>
		<pubDate>Wed, 13 Aug 2008 18:11:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://inverse2.com/?p=44</guid>
		<description><![CDATA[         
Build a RESTful Web Service in Just a Minute - Part 2

This article is the followup to the post Build a RESTful Web Service in Just a Minute, which showed how to build a REST web service which returned a person record from a database.
This article [...]]]></description>
			<content:encoded><![CDATA[<div><img style="float:left; display:inline; width: 80px;padding-right:15px;" src="http://www.inverse2.com/images/ajaxToasterIcon.gif" alt="" />         </p>
<h3>Build a RESTful Web Service in Just a Minute - Part 2</h3>
</div>
<p>This article is the followup to the post <a href="inverse2.com?p=43">Build a RESTful Web Service in Just a Minute</a>, which showed how to build a <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST</a> web service which returned a <i>person</i> record from a database.</p>
<p>This article will show you how you can write and deploy another one-minute web service - this one  maintains the <i>person</i> table and in subsequent articles we will see AjaxToaster services that handle complex data structures such as you might find in real world applications.<br />
<span id="more-44"></span><br />
Before we get started it&#8217;s assumed that you have <a href="/?page_id=10">AjaxToaster</a> installed and that you have your environment set up (See the <a href="#resources">resources section</a> for details).  It will also be useful if you have created the retrieve service from the <a href="/?p=43">first article</a>.  <i>(AjaxToaster is an Ajax application server which runs under Tomcat/JBOSS/Glassfish/Websphere - you need an AjaxToaster server to run any of these examples)</i></p>
<h3>Creating the Person maintenance service</h3>
<p>To create the service that will update the &#8220;person&#8221; entity in the database, create a file named &#8220;<strong>PersonUpdate.xts</strong> &#8221; in a directory called &#8216;contacts&#8217; under the Toaster <i>services</i> directory (If you are running Tomcat on windows this is likely to be found under c:\program files\Tomcat 6.0\webapps\toaster)<br />
e.g<br />
<img src="/images/contactsService.jpg" height=249 width=424 /></p>
<p>Add the following into PersonUpdate.xts.</p>
<div style="background:#E4F2FD; border:1px solid; width:80%; margin-left:5%; padding:15px;display:block;">
<p style="font-family: courier, monospace; font-size:10px;text-align:left;">
<pre>
  update table person using (insert,update)
  set personID = {person.id, key:1, uid:true, type:'integer'},
       firstname = {person.forename},
       lastname = {person.surname},
       dob        = {person.dateOfBirth};
  \g
</pre>
</p>
</div>
<p>This script tells AjaxToaster how to save the &#8216;person&#8217; data into the database.  The update statement is similar to a standard SQL update statement, but the phrase &#8220;<i>using (insert, update)</i>&#8221;  means that it can insert OR update data into the &#8216;person&#8217; database.<br />
Full details of the update syntax can be found in the <a href="?page_id=45">documentation</a>.</p>
<p>The line &#8220;<i>personID = {person.id, key:1, uid:true, type:&apos;integer&apos;},</i>&#8221; tells it that <i>personID</i> is the key and that it is defined as an auto-generated key in the database.<br />
If a row is inserted into the database the auto generated key will be populated in the return message.</p>
<p>This statement alone is enough to build the service.  It can now be run as a non-restful service with parameters specified in the URL -<br />
e.g.<br />
http://localhost:8080/toaster/contacts/PersonUpdate?inputjson={person:{forename:&#8217;Fred&#8217;,surname:&#8217;Flintstone&#8217;,dateOfBirth:&#8217;1952-02-02&#8242;}}<br />
(see the <a href="/?page_id=40">AjaxToaster parameters documentation</a> for more details)</p>
<p>To turn it into a RESTful service we need to add two new mappings to the &#8220;<strong>AjaxToaster.urimappings</strong>&#8221; file.  The first mapping is used when person data is being updated (the client application will know the ID of the person) and the second mapping is used when a new person is being created.</p>
<div style="background:#E4F2FD; border:1px solid; width:80%; margin-left:5%; padding:15px;display:block;">
<p style="font-family: courier, monospace; font-size:10px;">    /person/{id}.POST=/contacts/PersonUpdate<br />
    /person.POST=/contacts/PersonUpdate</p>
</div>
<p>
And thats it! Now in 7 lines of SQL, 2 lines of config, and zero lines of crazy Java annotations you have a fully operational RESTful service to update and create &#8220;person&#8221; entities.<br />
If you want to see this service (and the one from the first article) in action then you can <a href="restful_part2.zip">download the example code</a>.  The file &#8220;restful_part2_example.html&#8221; uses generic Ajax to invoke the service and POST updates and inserts to it.
</p>
<p>
&nbsp;
</p>
<p><a name="resources"></a></p>
<h2>Resources</h2>
<div style="background:lightgrey; border:1px solid; width:80%; margin-left:5%; padding:15px;display:block;">
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">Example code for RESTful Web Services Part II</h3>
<p>The <a href="restful_part2.zip">example code download</a> includes the <i>toaster.war</i> web application which contains the ajaxToaster server, the html/javascript required to run a basic demo of the personUpdate service, and the &#8220;contactsDB.sql&#8221; file needed to create the demo database tables.</p>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">Java Runtime</h3>
<p>AjaxToaster requires Java 5 or later. This can be downloaded from the<br />
<a href="http://java.sun.com/javase/downloads/index.jsp">Sun website</a>.</p>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">Java Web Container</h3>
<p>Any Java web container is able to run AjaxToaster, but if you are getting started then we recommend using Apache Tomcat 6. This can be downloaded from <a href="http://tomcat.apache.org/download-60.cgi">here</a> and you can find documentation on setting it up <a href="http://tomcat.apache.org/tomcat-6.0-doc/index.html">here</a> .</p>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">AjaxToaster</h3>
<p>The AjaxToaster application can be downloaded from <a href="http://inverse2.com/?page_id=10">the downloads page</a>.  The &#8220;toaster.war&#8221; file is the only one you need for this article, but &#8220;toasterExamples.war&#8221; is an application that contains lots of useful documentation and example applications.  We also recommend that you read the <a href="http://inverse2.com/downloads/AjaxToaster/1_0_0_RC2/Docs/releaseNotes.html">release notes</a> which contain information on features of AjaxToaster.</p>
<p>For instructions on how to install a WAR file under Apache Tomcat use the following links;</p>
<div style="width:80%; margin-left:5%; padding-left:15px;display:block; padding-top:"><a href="http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html">Install using the Tomcat Manager application</a><br />
<a href="http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html">Tomcat web application deployment</a></div>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">MySQL Database</h3>
<p>The script that sets up the &#8220;contacts&#8221; database used in this series of articles has been developed against a MySQL database.  MySQL can be downloaded from <a href="http://dev.mysql.com/downloads/mysql/5.0.html#downloads">here</a> .</p>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">Creating the Database Tables</h3>
<p>The script that creates the database, tables and data can be downloaded <a href="http://inverse2.com/RESTful/contactsDB.sql">here (contactsDB.sql)</a>.  By default the script will create a database named &#8216;<strong>mydb</strong> &#8216;.  If you edit the script to change this then you must also change the name of the database used in the JDBC URL in the &#8220;AjaxToaster.properties&#8221; file.</p>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">JDBC Driver</h3>
<p>The JDBC driver for MySQL can be downloaded from <a href="http://dev.mysql.com/downloads/connector/j/5.1.html">mysql.com</a>.</p>
<p>To make the JDBC driver accessible to AjaxToaster you should copy the downloaded JAR file to the &#8220;WEB-INF&#8221; directory of the &#8220;toaster&#8221; application installed under Tomcat.</p>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">Connecting AjaxToaster to the Database</h3>
<p>To make AjaxToaster aware of the database you must add the following lines to the &#8220;AjaxToaster.properties&#8221; file in the &#8220;toaster&#8221; web applications&#8217; &#8220;services&#8221; directory.</p>
<div style="width:80%; margin-left:5%; padding-left:15px;display:block; padding-top:">jdbc.driver.mydb=com.mysql.jdbc.Driver<br />
jdbc.database.mydb=jdbc:mysql://localhost/<em>mydb</em><br />
jdbc.username.mydb=<em>username</em><br />
jdbc.password.mydb=<em>password</em></div>
<p>Change <em>mydb</em>, <em>username</em>, and <em>password</em> to suite your local database.</p>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">AjaxToaster Note</h3>
<p>AjaxToaster will automatically detect changes that you make to the configuration and web service script files. However, this checking is done every 30 seconds by default, so, if you are too fast, you might find that AjaxToaster has not noticed your shiny new RESTful web service when you first try to access it!</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://inverse2.com/?feed=rss2&amp;p=44</wfw:commentRss>
		</item>
		<item>
		<title>RESTful Web Services in Just a Minute</title>
		<link>http://inverse2.com/?p=43</link>
		<comments>http://inverse2.com/?p=43#comments</comments>
		<pubDate>Mon, 28 Jul 2008 17:12:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://inverse2.com/?p=43</guid>
		<description><![CDATA[

Build a RESTful Web Service in Just a Minute

This article will show you how you can write and deploy a RESTful web service (that does something useful!) in around a minute.
It is planned to be the first part in a series of articles that will use AjaxToaster to demonstrate RESTful web services interacting with a [...]]]></description>
			<content:encoded><![CDATA[<div>
<img src="/images/ajaxToasterIcon.gif" style="float:left; display:inline; width: 80px;padding-right:15px;"/></p>
<h3>Build a RESTful Web Service in Just a Minute</h3>
</div>
<p>This article will show you how you can write and deploy a RESTful web service (that does something useful!) in around a minute.</p>
<p>It is planned to be the first part in a series of articles that will use AjaxToaster to demonstrate RESTful web services interacting with a relational database.  In this first article we will show you a service that retrieves a simple data structure, in subsequent articles we will move onto a service that updates data and then services that handle complex data structures such as you might find in real world applications.<br />
<span id="more-43"></span></p>
<p>Before we start the stopwatch :-), it&#8217;s assumed that you have AjaxToaster installed in your environment and that you have our fictitious &#8220;contacts&#8221; database set-up.  For instructions on how to do this, use the links in the <a href="#resources">resources section</a> at the end of the article.</p>
<h3 style="margin-top:30px;">Ready, steady, go!!!</h3>
<p>First you should create a new directory named &#8220;<strong>contacts</strong> &#8221; in the toaster web applications&#8217; &#8220;services&#8221; directory. On a standard Windows installation of Tomcat 6.0 this directory will be &#8220;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\toaster\services&#8221;.  This is where we will create our web services.</p>
<p>Create a file named &#8220;<strong>service.config</strong> &#8221; in your new directory and add the following content.</p>
<div style="background:#E4F2FD; border:1px solid; width:80%; margin-left:5%; padding:15px;margin-top:8px;display:block;"><span style="padding-top: 0px; margin-top: 0px; font-size: 10px; font-family: courier,monospace;">jdbc_pool_name=mydb</span></div>
<p>The content of this file sets the default database for all service script files in the directory.  <em>We are assuming that the &#8216;mydb&#8217; database connection has been setup as described in the resources section.</em></p>
<p>Now create a file in the &#8216;contacts&#8217; directory called &#8220;<strong>PersonService.stx</strong> &#8221; with the following content:</p>
<div style="background:#E4F2FD; border:1px solid; width:80%; margin-left:5%; padding:15px;margin-top:8px;display:block;">
<p style="font-family: courier, monospace; font-size:10px;">xmlselect using noschema<br />
select<br />
personid      into xml:{person.id},<br />
firstname     into xml:{person.forename},<br />
lastname      into xml:{person.surname},<br />
dob           into xml:{person.dateOfBirth}<br />
from<br />
person<br />
where<br />
personId = ${PERSONID}<br />
order by<br />
personid;</p>
</div>
<p>Now edit the &#8220;<strong>AjaxToaster.urimappings</strong> &#8221; file (which is in the &#8220;services&#8221; directory) and add the following line to define your RESTful URI:</p>
<div style="background:#E4F2FD; border:1px solid;width:80%;margin-left:5%; margin-top:8px;padding:15px;display:block;">
<p style="font-family:courier,monospace;font-size:10px;">/person/{id}.GET=/contacts/PersonService?PERSONID={id}</p>
</div>
<p>When a client accesses a URI in the format &#8220;&#8230;/person/<em>999</em>&#8221; using an HTTP GET, the &#8220;PersonService.stx&#8221; script will be invoked and passed <em>999</em> as the &#8220;PERSONID&#8221; parameter. This will run the query above against the database and return person number 999 to you.</p>
<p>So that&#8217;s it! You are now ready to use your new RESTful web service.  Point your web browser at a URL such as <strong>http://localhost:8080/toaster/person/1</strong> and you should see the person data as shown below.</p>
<p><img src="http://www.inverse2.com/images/RESTful_part1_results.jpg" alt="" /></p>
<p>You can change the &#8216;person&#8217; that you retrieve simply by changing the number on the end of the URL (use 1 through 5 for the person records that are setup by the database creation script).</p>
<p>The client can also decide to receive the data as a JSON message by either adding a parameter to the URL called &#8220;returnjson&#8221; (for example http://localhost:8080/toaster/person/1?returnjson) or by setting the HTTP request header &#8220;<strong>Accept</strong> &#8221; to &#8220;<strong>text/json</strong> &#8220;.</p>
<p>In the next article we will look at how the client can set the HTTP request header and how we can update data in the database using AjaxToaster RESTful web services.</p>
<p style="margin-top:30px;">
<p><a name="resources"></a></p>
<h2>Resources</h2>
<div style="background:lightgrey; border:1px solid; width:80%; margin-left:5%; padding:15px;display:block;">
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">Java Runtime</h3>
<p>AjaxToaster requires Java 5 or later. This can be downloaded from the<br />
<a href="http://java.sun.com/javase/downloads/index.jsp">Sun website</a>.</p>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">Java Web Container</h3>
<p>Any Java web container is able to run AjaxToaster, but if you are getting started then we recommend using Apache Tomcat 6. This can be downloaded from <a href="http://tomcat.apache.org/download-60.cgi">here</a> and you can find documentation on setting it up <a href="http://tomcat.apache.org/tomcat-6.0-doc/index.html">here</a> .</p>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">AjaxToaster</h3>
<p>The AjaxToaster application can be downloaded from <a href="http://inverse2.com/?page_id=10">here</a>.  The &#8220;toaster.war&#8221; file is the only one you need for this article, but &#8220;toasterExamples.war&#8221; is an application that contains lots of useful documentation and example applications.  We also recommend that you read the release notes which contain information on features of AjaxToaster.</p>
<p>For instructions on how to install a WAR file under Apache Tomcat use the following links;</p>
<div style="width:80%; margin-left:5%; padding-left:15px;display:block; padding-top:"><a href="http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html">Install using the Tomcat Manager application</a><br />
<a href="http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html">Tomcat web application deployment</a></div>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">MySQL Database</h3>
<p>The script that sets up the &#8220;contacts&#8221; database used in this series of articles has been developed against a MySQL database.  MySQL can be downloaded from <a href="http://dev.mysql.com/downloads/mysql/5.0.html#downloads">here</a> .</p>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">Creating the Database Tables</h3>
<p>The script that creates the database, tables and data can be downloaded <a href="http://inverse2.com/RESTful/contactsDB.sql">here (contactsDB.sql)</a>.  By default the script will create a database named &#8216;<strong>mydb</strong> &#8216;.  If you edit the script to change this then you must also change the name of the database used in the JDBC URL in the &#8220;AjaxToaster.properties&#8221; file.</p>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">JDBC Driver</h3>
<p>The JDBC driver for MySQL can be downloaded from <a href="http://dev.mysql.com/downloads/connector/j/5.1.html">mysql.com</a>.</p>
<p>To make the JDBC driver accessible to AjaxToaster you should copy the downloaded JAR file to the &#8220;WEB-INF&#8221; directory of the &#8220;toaster&#8221; application installed under Tomcat.</p>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">Connecting AjaxToaster to the Database</h3>
<p>To make AjaxToaster aware of the database you must add the following lines to the &#8220;AjaxToaster.properties&#8221; file in the &#8220;toaster&#8221; web applications&#8217; &#8220;services&#8221; directory.</p>
<div style="width:80%; margin-left:5%; padding-left:15px;display:block; padding-top:">jdbc.driver.mydb=com.mysql.jdbc.Driver<br />
jdbc.database.mydb=jdbc:mysql://localhost/<em>mydb</em><br />
jdbc.username.mydb=<em>username</em><br />
jdbc.password.mydb=<em>password</em></div>
<p>Change <em>mydb</em>, <em>username</em>, and <em>password</em> to suite your local database.</p>
<h3 style="margin-bottom:-10px;margin-top:35px;padding:0px">AjaxToaster Note</h3>
<p>AjaxToaster will automatically detect changes that you make to the configuration and web service script files. However, this checking is done every 30 seconds by default, so, if you are too fast, you might find that AjaxToaster has not noticed your shiny new RESTful web service when you first try to access it!</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://inverse2.com/?feed=rss2&amp;p=43</wfw:commentRss>
		</item>
		<item>
		<title>JSON Service Mapping Descriptions</title>
		<link>http://inverse2.com/?p=38</link>
		<comments>http://inverse2.com/?p=38#comments</comments>
		<pubDate>Wed, 21 May 2008 14:19:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://inverse2.com/?p=38</guid>
		<description><![CDATA[We decided that one of the biggest things missing from ajaxToaster was formal descriptions of the web services.  Historically WSDL has been used to describe the operations and input/output messages for WS web services, but If you&#8217;ve ever looked at a WSDL document, you&#8217;ll understand why we have decided to implement Kris Zyp&#8217;s JSON [...]]]></description>
			<content:encoded><![CDATA[<p>We decided that one of the biggest things missing from ajaxToaster was formal descriptions of the web services.  Historically WSDL has been used to describe the operations and input/output messages for WS web services, but If you&#8217;ve ever looked at a WSDL document, you&#8217;ll understand why we have decided to implement Kris Zyp&#8217;s JSON <a title="JSON Service Mapping Description" href="http://groups.google.com/group/json-schema/web/service-mapping-description-proposal">service-mapping-description</a> proposal instead.  <span id="more-38"></span></p>
<p>This is pretty straightforward and easy to understand, and overall we&#8217;re happy with the concept, but is not without it&#8217;s quirks and ambiguities.  For instance, there isn&#8217;t a distinction between &#8220;services&#8221; and operations. There isn&#8217;t any way to tell how parameters are passed into the service on a POST - in the post body or as url parameters.</p>
<p>It is also not so simple to use the resulting object from javascript.  Here&#8217;s an example of a service description:</p>
<pre>
"services": {
        "foo": {
            "transport": "GET",
            "target": "executeFoo.php",
            "parameters": [
                {"name":"paramOne", "type": "string"},
                {"name":"paramTwo", "type": "integer", "default": 5},
                {"name":"paramThree", "type": "integer", "optional": true}
            ]
        },
        "add": {
            "transport": "POST",
            "envelope": "JSON-RPC-2.0",
            "additionalParameters": {"type": "integer", "default": 0},
            "parameters": [
                {"type": "integer", "default": 0},
                {"type": "integer", "default": 0}
            ]
        }
    }
}</pre>
<p>This SMD contains two services, &#8220;foo&#8221; and &#8220;add&#8221;.  Note that the services aren&#8217;t in an array, so the properties for a particular service can only be referred to directly if you already know the name of the service e.g. alert(services.foo.transport);<br />
Most of the time you won&#8217;t know this, so you have to resort to tricks - e.g using eval&#8230;.</p>
<pre>
for (x in services) {
    servicedetails = eval("services."+x);
    alert(servicedetails.transport);
}
</pre>
<p>Complaints aside, we are looking forward to adding this to the next version of AjaxToaster, as it will make documenting and testing services much easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://inverse2.com/?feed=rss2&amp;p=38</wfw:commentRss>
		</item>
		<item>
		<title>What is XMLToaster - And why should I be interested?</title>
		<link>http://inverse2.com/?p=37</link>
		<comments>http://inverse2.com/?p=37#comments</comments>
		<pubDate>Mon, 12 May 2008 14:17:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Documentation]]></category>

		<guid isPermaLink="false">http://inverse2.com/?p=37</guid>
		<description><![CDATA[
The Smell of Burning XML - Introducing XMLToaster
Java can be a very blunt tool when it comes to working with XML - there are lots of concepts to understand, lots of APIs to learn, and lots of code to write. Even when you have made it through the concepts and APIs you&#8217;ve only made it [...]]]></description>
			<content:encoded><![CDATA[<p><img style="display:inline;position:relative;top:0px;" src="http://inverse2.com/images/burntToast.gif" alt="burningXML" /></p>
<h3 style="position:relative;padding-top:0px;margin-top:0px;top:-30px; left: 120px;">The Smell of Burning XML - Introducing XMLToaster</h3>
<p>Java can be a very blunt tool when it comes to working with XML - there are lots of concepts to understand, lots of APIs to learn, and lots of code to write. Even when you have made it through the concepts and APIs you&#8217;ve only made it to the starting line!<br />
Now you need to get some data to go with your XML, which often means learning yet another API to integrate with your relational database!</p>
<p>In this article I will explain how the XMLToaster can simplify the process of working in the XML and relational database worlds, without giving away any of the power and flexibility of either.<br />
<span id="more-37"></span></p>
<p>The examples in this article are based on the database shown in figure 1 which supports the XML messages we will be generating for an imaginary address book system.</p>
<p><img src="http://inverse2.com/images/xmlToasterArticle_figure1.gif" alt="" /><br />
<em>Figure 1. The database schema</em></p>
<h3>A simple example</h3>
<p>For the first example of an XMLToaster query I will show you how to generate a list of names from the data in the &#8220;<em>person</em>&#8221; table.</p>
<pre>   <code>
xmlselect using noschema
select
    p.firstname     into xml:{addressBook.person.firstname},
    p.surname       into xml:{addressBook.person.surname}
from
    person p
order by
    surname  newValue throwNew xml:{addressBook.person}
   </code></pre>
<p>If you are familiar with SQL you will see that it&#8217;s a normal SQL select statement with a little extra &#8220;syntactic sugar&#8221; sprinkled on top. In fact, I am going to assume that you&#8217;re familiar with the SQL &#8220;select &#8230; from.. order by&#8221; syntax so I will just describe the extra statements that tell the XMLToaster what the XML output is going to look like.</p>
<p>Starting from the top, the statement &#8220;<code>xmlselect using noschema</code>&#8221; indicates that the generated XML doesn&#8217;t have to conform to an XML schema. For simple queries this is normally fine and for complex messages where fine control over the generated XML is essential you can specify a schema (as we shall see in a later example).</p>
<p>The &#8220;into xml:{addressBook.person.firstname}&#8221; says where each person&#8217;s firstname will appear in the output XML. In this case it will go underneath &lt;addressBook&gt;&lt;person&gt; and appear in an element called &lt;firstname&gt;.</p>
<p>Finally, &#8220;newValue throwNew xml:{addressBook.person}&#8221; after surname in the &#8220;order by&#8221; part of the select statement means that a new &lt;person&gt; element will be created in the output XML every time a new value of surname is encountered, so we&#8217;ll get a new &lt;person&gt; block with every new surname.</p>
<p>Here is the XML that is generated by the query&#8230;</p>
<pre>   <code>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;addressBook&gt;
  &lt;person&gt;
    &lt;surname&gt;Abbingdon&lt;/surname&gt;
    &lt;firstname&gt;Alice&lt;/firstname&gt;
  &lt;/person&gt;
  &lt;person&gt;
    &lt;surname&gt;Bloomsbury&lt;/surname&gt;
    &lt;firstname&gt;Bob&lt;/firstname&gt;
  &lt;/person&gt;
  &lt;person&gt;
    &lt;surname&gt;Chesterfield&lt;/surname&gt;
    &lt;firstname&gt;Charles&lt;/firstname&gt;
  &lt;/person&gt;
&lt;/addressBook&gt;
   </code></pre>
<h3>Example using some of SQL features and a child XML element</h3>
<p>Since the XMLToaster syntax is similar to standard SQL you can write something a little more complex and can join tables, use SQL functions and restrict data with a normal <em>where</em> clause.<br />
The query below expands the first example. Now the</p>
<pre><code>
xmlselect using noschema
select
    p.personId,
    concat(p.firstname, ' ', p.surname) into xml:{addressBook.person.name}
from
    person p
xmlunion
select
    p.personId,
    n.nicknameId,
    concat('A.K.A. ', n.nickname)       into xml:{addressBook.person.nickname}
from
    nickname n,
    person   p
where
    p.personId = n.personId
order by
    personId   newValue throwNew xml:{addressBook.person},
    nicknameId newValue throwNew xml:{addressBook.person.nickname}
</code></pre>
<p>In this query we are using the &#8220;<code>concat</code>&#8221; function to format the SQL data before we put it into the XML structure.</p>
<p>The query also contains the keyword &#8220;<code>xmlunion</code>&#8221; which is similar to the standard SQL &#8220;<code>union</code>&#8221; keyword, in that it pools the<br />
results of the various select statements, but you don&#8217;t have to have the same resultset columns in each select clause.</p>
<p>The order by clause of this query contains two columns, and two &#8220;<code>throwNew</code>&#8221; keywords.  This allows us to create a new &#8220;<code>person</code>&#8221;<br />
element whenever the &#8220;<code>personId</code>&#8221; changes in the resultset, and to create a new &#8220;<code>nickname</code>&#8221; element underneath the correct<br />
&#8220;<code>person</code>&#8221; element for each nickname that is returned.</p>
<p>When the query is run against our test database, XMLToaster produces the following XML:</p>
<pre><code>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;addressBook&gt;
  &lt;person&gt;
    &lt;name&gt;Alice Abbingdon&lt;/name&gt;
    &lt;nickname&gt;A.K.A. Ally&lt;/nickname&gt;
  &lt;/person&gt;
  &lt;person&gt;
    &lt;name&gt;Bob Bloomsbury&lt;/name&gt;
    &lt;nickname&gt;A.K.A. Bobby&lt;/nickname&gt;
    &lt;nickname&gt;A.K.A. Billy&lt;/nickname&gt;
  &lt;/person&gt;
  &lt;person&gt;
    &lt;name&gt;Charles Chesterfield&lt;/name&gt;
  &lt;/person&gt;
&lt;/addressBook&gt;
</code></pre>
<h3>An awkward example - When the tables and XML schema don&#8217;t match.</h3>
<p>In this next example we are going to generate an XML message that lists the people and their home and work addresses.<br />
In the database the home and work addresses are kept in the same table (personAddress), but the XSD schema that we have been asked to use has the two types of addresses separated in the XML heirachy.  This can be awkward for traditional forms of relational to XML mapping because they like the XML data heirachy to closely match the database table relationship heirachy.  Unfortunately in real life there are frequently differences - maybe the database was designed to different requirements than your application (and vice versa), or maybe it&#8217;s a legacy database.  This can force you to perform unnecessary transformations of the XML you get from the database into the XML that you really require, which is costly in terms of development/maintenance effort and system performance.</p>
<p>OK, back to the code. This is how you can generate the list of people and their addresses.</p>
<pre><code>
xmlselect using schema 'addressList.xsd'
   /* Person Name - put person's name into &lt;person&gt; */
select
   p.personId,
   p.firstName         into xml:{addressBook2.person.firstname},
   p.surname           into xml:{addressBook2.person.surname}
from
   person p

xmlunion
    /* Home Address - if they have a home address put that into &lt;person&gt;&lt;home&gt; */
select
   p.personId,
   a.line1             into xml:{addressBook2.person.home.line1},
   a.line2             into xml:{addressBook2.person.home.line2},
   a.city              into xml:{addressBook2.person.home.city},
   a.state             into xml:{addressBook2.person.home.state},
   a.zip               into xml:{addressBook2.person.home.zip}
from
   address       a,
   personAddress p
where
   p.addressId   = a.addressId
and p.addressType = 'HOME'

xmlunion
    /* Work Address - if the person has a work address, put that into &lt;person&gt;&lt;work&gt; */
select
   p.personId,
   a.line1             into xml:{addressBook2.person.work.line1},
   a.line2             into xml:{addressBook2.person.work.line2},
   a.city              into xml:{addressBook2.person.work.city},
   a.state             into xml:{addressBook2.person.work.state},
   a.zip               into xml:{addressBook2.person.work.zip}
from
   address       a,
   personAddress p
where
   p.addressId   = a.addressId
and p.addressType = 'WORK'

/* notice that XMLToaster uses the "order by personId" to join all three unions together */
order by
   personId   newValue throwNew xml:{addressBook2.person}
</code></pre>
<p>In the query statement we have three different selects separated by the &#8220;<code>xmlunion</code>&#8221; keyword.<br />
The three seperate <em>select</em>&#8217;s are then effectively joined together in the <em>order by</em> clause of the statement,<br />
such that data with the same &#8220;<code>personId</code>&#8221; is processed by XMLToaster together.<br />
In this way you can build in as much complexity to your selects as you require.</p>
<p>When the query is run against our test database, the following XML is produced:</p>
<pre><code>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;addressBook2&gt;
 &lt;person&gt;
   &lt;firstname&gt;Alice&lt;/firstname&gt;
   &lt;surname&gt;Abbingdon&lt;/surname&gt;
   &lt;home&gt;
     &lt;line1&gt;21 Pardee Lane&lt;/line1&gt;
     &lt;line2 nil="true" /&gt;
     &lt;city&gt;Oxford&lt;/city&gt;
     &lt;state&gt;California&lt;/state&gt;
     &lt;zip&gt;765231&lt;/zip&gt;
   &lt;/home&gt;
   &lt;work&gt;
     &lt;line1&gt;37 Edgewater Drive&lt;/line1&gt;
     &lt;line2 /&gt;
     &lt;city&gt;Cambridge&lt;/city&gt;
     &lt;state&gt;Calfornia&lt;/state&gt;
     &lt;zip&gt;655332&lt;/zip&gt;
   &lt;/work&gt;
 &lt;/person&gt;
 &lt;person&gt;
   &lt;firstname&gt;Bob&lt;/firstname&gt;
   &lt;surname&gt;Bloomsbury&lt;/surname&gt;
   &lt;home&gt;
     &lt;line1&gt;7 Capwell Drive&lt;/line1&gt;
     &lt;line2 /&gt;
     &lt;city&gt;Melrose&lt;/city&gt;
     &lt;state&gt;California&lt;/state&gt;
     &lt;zip&gt;765783&lt;/zip&gt;
   &lt;/home&gt;
   &lt;work&gt;
     &lt;line1&gt;18 Pendleton Way&lt;/line1&gt;
     &lt;line2 /&gt;
     &lt;city&gt;Eastcote&lt;/city&gt;
     &lt;state&gt;California&lt;/state&gt;
     &lt;zip&gt;765656&lt;/zip&gt;
   &lt;/work&gt;
 &lt;/person&gt;
 &lt;person&gt;
   &lt;firstname&gt;Charles&lt;/firstname&gt;
   &lt;surname&gt;Chesterfield&lt;/surname&gt;
   &lt;home&gt;
     &lt;line1&gt;15 Wistar Road&lt;/line1&gt;
     &lt;line2 /&gt;
     &lt;city&gt;Westbridge&lt;/city&gt;
     &lt;state&gt;California&lt;/state&gt;
     &lt;zip&gt;765322&lt;/zip&gt;
   &lt;/home&gt;
   &lt;work&gt;
     &lt;line1&gt;42 Ashton Avenue&lt;/line1&gt;
     &lt;line2 /&gt;
     &lt;city&gt;Northville&lt;/city&gt;
     &lt;state&gt;California&lt;/state&gt;
     &lt;zip&gt;76529&lt;/zip&gt;
   &lt;/work&gt;
 &lt;/person&gt;
&lt;/addressBook2&gt;
</code></pre>
<h3>Hidden power</h3>
<p>In this last example I am going to show how you can use XMLToaster to produce an XML message containing the results of a search against the database.<br />
The requirement is to find a distinct list of people with either a firstname or nickname that matches the search name.  A query to select this from our database would be</p>
<pre><code>
select distinct p.personid, firstname, n.nickname, surname
from person p left outer join nickname n on n.personid = p.personid
where p.firstname like 'Bob%' or n.nickname like 'Bob%'
</code></pre>
<p>This may sound straightforward, but what happens when the search criteria match both a persons&#8217; firstname <em>and</em> their nickname?  For instance if we search for &#8220;Bob*&#8221; and it matches someone with a firstname of &#8220;Bob&#8221; and nickname of &#8220;Bobby&#8221; they would appear in the results twice<br />
This would result in the person appearing multiple times in the select resultset, something that we don&#8217;t want.<br />
We could try using <em>select distinct</em> to cure the problem, because, assuming you need to know which nickname the match was against, the resultset rows will already be distinct. To solve this problem we can use the power of the XMLToaster &#8220;<code>throwNew</code>&#8221; keyword,<br />
which gives us control over when a new element is created in the XML - in these circumstances, only when a new person is returned in the resultset.</p>
<p>Here is the select statement to perform the search (note that parameters are passed into XMLToaster queries using the &#8220;<code>${XYZ}</code>&#8221; syntax).</p>
<pre><code>
xmlselect using noschema
select
   p.personId,
   p.firstName             into xml:{searchResults.person.firstname},
   p.surname               into xml:{searchResults.person.surname}
from
   person  p
where
   firstName like '${NAME}%'
xmlunion
select
   n.personId,
   n.nicknameId,
   p.firstName             into xml:{searchResults.person.firstname},
   p.surname               into xml:{searchResults.person.surname},
   n.nickname              into xml:{searchResults.person.nickname}
from
   person   p,
   nickname n
where
   p.personId    = n.personId
and n.nickname like '${NAME}%'

order by
   surname,
   personId   newValue throwNew xml:{searchResults.person},
   nicknameId newValue throwNew xml:{searchResults.person.nickname}
</code></pre>
<p>When run with the &#8220;NAME&#8221; paramater set to &#8220;B&#8221; we get a message with a single instance of Bob, even though the search criteria matched his firstname and two of his nicknames.</p>
<pre><code>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;searchResults&gt;
 &lt;person&gt;
   &lt;surname&gt;Bloomsbury&lt;/surname&gt;
   &lt;firstname&gt;Bob&lt;/firstname&gt;
   &lt;nickname&gt;Bobby&lt;/nickname&gt;
   &lt;nickname&gt;Billy&lt;/nickname&gt;
 &lt;/person&gt;
&lt;/searchResults&gt;
</code></pre>
<h3>Saving XML into a database</h3>
<p>XMLToaster also provides a means of saving XML messages into a relational database without first transforming the XML, converting it into an object and then performing an Object-to-Relational  mapping. This is achieved by specifying where in the input XML the data for each column of a table or parameter of a stored procedure comes from.  These mapping specifications can be more complicated than the simple SQL select syntax used to get XML data out of a database, but are still very intuitive and powerful.  You can see an example <a href="http://inverse2.com/?p=6">here</a>.</p>
<h3>System Performance (There&#8217;s a RAT in the system what am I gonna do?)</h3>
<p>Traditional heirachical processing tends to have a naive brute-force approach to extracting data where each level of the heirachy is fetched from the database a child-at-a-time.  This means that for each row in our &#8220;<code>person</code>&#8221; table, using traditional relational to XML mapping techniques would perform two singleton selects to get their home and business addresses. If we have 1000 rows in the person table, this means 2000 singleton selects executing against the database each time we want to produce the address list.<br />
This doesn&#8217;t sound too bad in theory, after all the same amount of data is ultimately read from the disk, right?  In practice it is nearly always orders of magnitude slower.  Relational databases perform much, much better when extracting (say) 5000 rows in a single query than running 5000 queries that extract a row each.</p>
<p>Another significant drain on performance that heirachical processing fetches from the database a child-at-a-time, executing many small select statements on the database server rather than a few big statements.<br />
For instance, in our &#8220;<code>person</code>&#8221; table, using traditional relational to XML mapping techniques, we would have to perform two singleton selects to get their home and business addresses.  If we have 1000 rows in the person table, this means 2000 singleton selects executing against the database each time we want to produce the address list.  The problem gets proportionally worse the more levels there are to the hierachy and can cripple an application.</p>
<p>Many of the performance problems in database-centric applications can be traced to this kind of iterative processing of database rows (often referred to as &#8220;Row At a Time&#8221; processing, or RAT&#8217;s).  These tight loops of small statements continually thrown at the DBMS are one of the best ways to send your DBA insane (or at least a bit <em>more</em> insane), as they are difficult to mediate against unless you control the source code.  Throwing hardware and memory (i.e $money) at this problem tends to result in linear improvements.  Good indexing and caching can move some of the load from disk to cpu, but the ultimate fix is to change the coding to be &#8220;set oriented&#8221;.  This requires far more complex back-end processing than the naive brute force approach to build the correct <em>select</em> statements, but can give exponential performance improvement.<br />
This is exactly what XMLToaster is designed to do.  By giving the developer the power to extract objects using unrestricted joins, we make use of the set processing performance boost provided by the relational database.</p>
<h3>Conclusion</h3>
<p>In this short introduction to XMLToaster I hope that I&#8217;ve been able to show that it is an easy to use, yet powerful tool for building XML messages from relational database data. Its&#8217; simplicity lends itself to situations where you don&#8217;t need the overhead of a heavywieght toolset, for example where XML is just the data format and you don&#8217;t need to hold the data in a transient object. I also think that by being able to work directly to an XSD schema the development process for XML messaging systems is vastly improved.  This allows you to skip any transformation steps that might have been required to convert the data extracted from the database structure into the structure that the message consumer requires. This should speed up development times and, just as importantly, decrease maintainence effort when things inevitably change.</p>
<p>An article like this we can only scratch the surface of what you can do with XMLToaster. For anyone who wants to learn more about using XMLToaster I would advise that they read the tutorial which is referenced in the resources section below. If you don&#8217;t find what you&#8217;re looking for there then feel free to <a href="http://inverse2.com/?page_id=36">contact us</a>, or, for the ultimate documentation there is always the source code available at <a href="http://sourceforge.net/projects/xmltoaster">sourceforge</a> ;)</p>
<h3><a id="resources" name="resources">Resources</a></h3>
<ul>
<li> <a href="http://inverse2.com/downloads/XMLToasterArticle_Resources.zip">Sample code</a> for this article</li>
<li> <a href="http://www.inverse2.com/inverse2/?page_id=9">Toaster Documentation Page</a></li>
<li> <a href="http://sourceforge.net/projects/xmltoaster/">SourceForge</a> home of XMLToaster code</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://inverse2.com/?feed=rss2&amp;p=37</wfw:commentRss>
		</item>
		<item>
		<title>New persistance syntax in XmlToaster 1.0.8</title>
		<link>http://inverse2.com/?p=6</link>
		<comments>http://inverse2.com/?p=6#comments</comments>
		<pubDate>Wed, 05 Mar 2008 03:49:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[News]]></category>

		<category><![CDATA[Add new tag]]></category>

		<guid isPermaLink="false">http://localhost/inverse2/?p=6</guid>
		<description><![CDATA[We have reviewed how persistance is managed in v1.0.8.
The xmltosql parser has been rewritten to support a more human readable psuedo-sql syntax in addition to the current XML configuration.


An example of updating a table with the new, simplified syntax:  If this is the xml message to save to the database&#8230;.

&#60;message&#62;
&#160;&#160;&#160;&#160;&#60;dish&#160;&#160;id=12&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;dishname&#62;Dry&#160;&#160;Toast&#60;/dishname&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;dishtype&#62;MAIN&#60;/dishtype&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;prices&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;retail&#62;1.50&#60;/retail&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;wholesale&#62;0.05&#60;/wholesale&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;/prices&#62;
&#160;&#160;&#160;&#160;&#60;/dish&#62;

&#160;&#160;&#160;&#160;&#60;dish&#160;&#160;id=14&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;:
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;etc
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;:
&#160;&#160;&#160;&#160;&#60;/dish&#62;
&#60;/message&#62;



Then the xmltoaster update statement [...]]]></description>
			<content:encoded><![CDATA[<p>We have reviewed how persistance is managed in v1.0.8.<br />
The xmltosql parser has been rewritten to support a more human readable psuedo-sql syntax in addition to the current XML configuration.<br />
</p>
<p style="margin-top:20px">
An example of updating a table with the new, simplified syntax:  If this is the xml message to save to the database&#8230;.<br />
<code><br />
&lt;message&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;dish&nbsp;&nbsp;id=12&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;dishname&gt;Dry&nbsp;&nbsp;Toast&lt;/dishname&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;dishtype&gt;MAIN&lt;/dishtype&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;prices&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;retail&gt;1.50&lt;/retail&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;wholesale&gt;0.05&lt;/wholesale&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/prices&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/dish&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;dish&nbsp;&nbsp;id=14&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;etc<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/dish&gt;<br />
&lt;/message&gt;<br />
</code>
</p>
<p style="margin-top:20px">
Then the xmltoaster update statement you would need is&#8230;<br />
<code><br />
&nbsp;update table menu using (update)<br />
&nbsp;set<br />
&nbsp;&nbsp;dishid = {message.dish.@id, key:1 },<br />
&nbsp;&nbsp;dishname = {message.dish.dishname, type:'string'},<br />
&nbsp;&nbsp;dishtype = {message.dish.type, type:'string'},<br />
&nbsp;&nbsp;price = {message.dish.prices.retail }<br />
&nbsp;;<br />
&nbsp;onError('Error updating the menu table!!.', abort, rollback);<br />
</code><br />
<br />
Easy, huh?</p>
]]></content:encoded>
			<wfw:commentRss>http://inverse2.com/?feed=rss2&amp;p=6</wfw:commentRss>
		</item>
	</channel>
</rss>

