<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.4">Jekyll</generator><link href="https://chem-bla-ics.linkedchemistry.info/feed/by_tag/http.xml" rel="self" type="application/atom+xml" /><link href="https://chem-bla-ics.linkedchemistry.info/" rel="alternate" type="text/html" /><updated>2026-04-19T09:50:36+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/feed/by_tag/http.xml</id><title type="html">chem-bla-ics</title><subtitle>Chemblaics (pronounced chem-bla-ics) is the science that uses open science and computers to solve problems in chemistry, biochemistry and related fields.</subtitle><author><name>Egon Willighagen</name></author><entry><title type="html">Next generation asynchronous webservices</title><link href="https://chem-bla-ics.linkedchemistry.info/2008/10/31/next-generation-asynchronous.html" rel="alternate" type="text/html" title="Next generation asynchronous webservices" /><published>2008-10-31T00:00:00+00:00</published><updated>2008-10-31T00:00:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2008/10/31/next-generation-asynchronous</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2008/10/31/next-generation-asynchronous.html"><![CDATA[<p>Johannes joined a <a href="http://wiki.bioclipse.net/index.php?title=Outcome_of_the_Bioclipse_autumn_workshop_2006">Bioclipse Workshop</a> a long time
ago, and introduced the participants to the idea of using <a href="http://xmpp.org/">XMPP</a> (aka Jabber) for asynchronous web services.
<a href="http://en.wikipedia.org/wiki/SOAP_(protocol)">SOAP</a> is commonly user to run webservices over <a href="http://en.wikipedia.org/wiki/HTTP">HTTP</a>,
but via (SMTP) email and XMPP is possible too (see <a href="http://xmpp.org/extensions/xep-0072.html">SOAP over XMPP</a>). Using HTTP as transport
layer has problems. The biggest problem, is possibly that HTTP connections are timed out, e.g. by intermediate router. This makes it
rather unsuited for long running jobs. Workarounds are easy to come up with, and <em>polling</em> is a common solution.</p>

<p>Johannes ideas solve this limitation by using the general XMPP protocol for chatting:</p>

<dl>
<dt><span style="color:red; font-weight: bold">client</span></dt>
  <dd>he, can you do something for me?</dd>
<dt><span style="color:darkgreen; font-weight: bold">service</span></dt>
  <dd>sure, I can do <b>generate3Dcoordinates</b> and <b>generateSMILES</b>.</dd>
<dt><span style="color:red; font-weight: bold">client</span></dt>
  <dd>ah, nice! what input does <b>generate<a href="http://www.opensmiles.org/">SMILES</a></b> take? and the output?</dd>
<dt><span style="color:darkgreen; font-weight: bold">service</span></dt>
  <dd>input: <a href="http://en.wikipedia.org/wiki/Chemical_Markup_Language">CML</a>, output a simple string.</dd>
<dt><span style="color:red; font-weight: bold">client</span></dt>
  <dd>ok, here's the CML</dd>
<dt><span style="color:darkgreen; font-weight: bold">service</span></dt>
  <dd>I'm done now. sorry that it took 10 minutes, but I'm running Vista...</dd>
<dt><span style="color:red; font-weight: bold">client</span></dt>
  <dd>excellent, please send me the results</dd>
<dt><span style="color:darkgreen; font-weight: bold">service</span></dt>
  <dd>ok, here is the SMILES for <a href="http://en.wikipedia.org/wiki/Lacosamide">lacosamide</a>: <span class="chem:smiles">CC(=O)N[C@H](COC)C(=O)NCC1=CC=CC=C1</span></dd>
</dl>

<p>Well, the important bit is in the last line. A job may take lone, even on clusters. The client might have to reboot meanwhile (possibly
because of critical security updates)… the <em>service</em> will just continue, and send you a message when done. If you just happen to be
offline, it will send a message when you are back online.</p>

<p>Johannes ideas led to the <a href="http://xmpp.org/extensions/xep-0244.html">IO-DATA proposal</a> (XEP-0244), which is currently marked experimental
and being discussed on the <a href="http://mail.jabber.org/mailman/listinfo/ws-xmpp">ws-xmpp</a> mailing list. He gathered a few people around
him to get it going, resulting in working stuff! Yeah!</p>

<h2 id="chemistry-development-kit-xws">Chemistry Development Kit XWS</h2>

<p>Besides contributing to the proposal, I am also involved in this project by writing XMPP-webservices, for the
<a href="https://cdk.github.io/">CDK</a>. This brings me to <a href="https://cdk.svn.sourceforge.net/svnroot/cdk/cdk-xws/trunk@12888">cdk-xws</a>, which is
the project to bring CDK functionality online as webservices using IO-DATA.</p>

<p><img src="/assets/images/cdkxwsPsi.png" alt="" /></p>

<p>This shows three nodes, the first being the CDK service, with two functions, of which I only implemented one yet.</p>

<p>For the curious, this is what the XMPP messages look like:</p>

<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;iq</span> <span class="na">from=</span><span class="s">"egonw@ws1.bmc.uu.se/home"</span>
    <span class="na">id=</span><span class="s">"JSO-0.12.5-6"</span>
    <span class="na">to=</span><span class="s">"cdk.ws1.bmc.uu.se"</span>
    <span class="na">type=</span><span class="s">"set"</span><span class="nt">&gt;</span>
  <span class="nt">&lt;command</span> <span class="na">xmlns=</span><span class="s">"http://jabber.org/protocol/commands"</span>
           <span class="na">action=</span><span class="s">"execute"</span>
           <span class="na">node=</span><span class="s">"calculateMass"</span><span class="nt">&gt;</span>
    <span class="nt">&lt;iodata</span> <span class="na">xmlns=</span><span class="s">"urn:xmpp:tmp:io-data"</span>
            <span class="na">type=</span><span class="s">"input"</span><span class="nt">&gt;</span>
      <span class="nt">&lt;in&gt;</span>
        <span class="nt">&lt;smiles</span> <span class="na">xmlns=</span><span class="s">"urn:xws:cdk:input"</span><span class="nt">&gt;</span>CCC<span class="nt">&lt;/smiles&gt;</span>
      <span class="nt">&lt;/in&gt;</span>
    <span class="nt">&lt;/iodata&gt;</span>
  <span class="nt">&lt;/command&gt;</span>
<span class="nt">&lt;/iq&gt;</span>
<span class="nt">&lt;iq</span> <span class="na">from=</span><span class="s">"cdk.ws1.bmc.uu.se"</span>
    <span class="na">id=</span><span class="s">"JSO-0.12.5-6"</span>
    <span class="na">to=</span><span class="s">"egonw@ws1.bmc.uu.se/home"</span>
    <span class="na">type=</span><span class="s">"result"</span>
    <span class="na">xml:lang=</span><span class="s">"en"</span><span class="nt">&gt;</span>
  <span class="nt">&lt;command</span> <span class="na">xmlns=</span><span class="s">"http://jabber.org/protocol/commands"</span>
           <span class="na">node=</span><span class="s">"calculateMass"</span>
           <span class="na">sessionid=</span><span class="s">"XWS-1"</span>
           <span class="na">status=</span><span class="s">"completed"</span><span class="nt">&gt;</span>
    <span class="nt">&lt;iodata</span> <span class="na">xmlns=</span><span class="s">"urn:xmpp:tmp:io-data"</span>
            <span class="na">type=</span><span class="s">"output"</span><span class="nt">&gt;</span>
      <span class="nt">&lt;out&gt;</span>
        <span class="nt">&lt;mass&gt;</span>36.032207690364004<span class="nt">&lt;/mass&gt;</span>
      <span class="nt">&lt;/out&gt;</span>
    <span class="nt">&lt;/iodata&gt;</span>
    <span class="nt">&lt;note</span> <span class="na">type=</span><span class="s">"info"</span><span class="nt">&gt;</span>Done<span class="nt">&lt;/note&gt;</span>
  <span class="nt">&lt;/command&gt;</span>
<span class="nt">&lt;/iq&gt;</span>
</code></pre></div></div>]]></content><author><name>Egon Willighagen</name></author><category term="bioclipse" /><category term="xmpp" /><category term="soap" /><category term="http" /><category term="inchikey:VPPJLAIAVCUEMN-GFCCVEGCSA-N" /><summary type="html"><![CDATA[Johannes joined a Bioclipse Workshop a long time ago, and introduced the participants to the idea of using XMPP (aka Jabber) for asynchronous web services. SOAP is commonly user to run webservices over HTTP, but via (SMTP) email and XMPP is possible too (see SOAP over XMPP). Using HTTP as transport layer has problems. The biggest problem, is possibly that HTTP connections are timed out, e.g. by intermediate router. This makes it rather unsuited for long running jobs. Workarounds are easy to come up with, and polling is a common solution.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://chem-bla-ics.linkedchemistry.info/assets/images/cdkxwsPsi.png" /><media:content medium="image" url="https://chem-bla-ics.linkedchemistry.info/assets/images/cdkxwsPsi.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>