<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Paul Fremantle on Medium]]></title>
        <description><![CDATA[Stories by Paul Fremantle on Medium]]></description>
        <link>https://medium.com/@paulfremantle?source=rss-6c16b3931a91------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*kihAHlR2B2-J3NrV.</url>
            <title>Stories by Paul Fremantle on Medium</title>
            <link>https://medium.com/@paulfremantle?source=rss-6c16b3931a91------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 21:46:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@paulfremantle/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[IBM / Redhat and a few tunes….]]></title>
            <link>https://medium.com/@paulfremantle/ibm-redhat-and-a-few-tunes-de4f301b6c09?source=rss-6c16b3931a91------2</link>
            <guid isPermaLink="false">https://medium.com/p/de4f301b6c09</guid>
            <category><![CDATA[music]]></category>
            <category><![CDATA[red-hat]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[bluehat]]></category>
            <dc:creator><![CDATA[Paul Fremantle]]></dc:creator>
            <pubDate>Mon, 29 Oct 2018 00:05:41 GMT</pubDate>
            <atom:updated>2018-10-29T00:05:41.944Z</atom:updated>
            <content:encoded><![CDATA[<p>IBM is buying Redhat for $34bn. If you are into tech and software, this blog won’t be the one letting you know that! If you want a serious analysis of this, you might enjoy my colleague Tyler’s <a href="https://medium.com/@tylerjewell/ibm-acquires-red-hat-what-this-means-for-open-source-d236d680da5b">thoughts</a>.</p><p>Instead, I’m going to muse on Irish tunes. In particular “sets”. Those of you who know me might know that I play Irish traditional music, which a music designed for dancing. Just like a DJ mixes songs together to keep people on the dance floor, Irish musicians put together multiple tunes to make a “set” for a specific dance. The change of tune, possibly with a key change, can enliven the dance and give the dancers a boost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DNUalNtA3yFSKKujtzT70Q.jpeg" /><figcaption>Irish Music Session <a href="https://www.flickr.com/photos/master-phillip">https://www.flickr.com/photos/master-phillip</a></figcaption></figure><p>When you come to choose a set, you have two classic choices. One is to put together tunes that have different keys, different phrases and generally have a clear change. The other is to put together two similar tunes that have the same key and often have very similar phrasing.</p><p>Merging two companies can have the same approaches. Salesforce buying Mulesoft was very definitely the first: different companies with different capabilities. Hortonworks and Cloudera is very much the second approach — two companies with similar products, similar business models, aiming to provide a more seamless whole.</p><p>When you create a set with two similar tunes, there is a big danger. Irish tunes are played at speed from memory. Sometimes you get the two tunes confused. You play through the first tune, start the second tune, and a minute later you realise you’ve blown it. Your playing the first tune again. By now the other musicians are thoroughly confused. Some have joined you in playing tune 1, others are still on tune 2. Usually it all goes wrong and all the musicians stop, confused. Ugh.</p><p>Most of the products of Redhat have an equivalent from IBM Software Group. Cloud Orchestration, tick, Integration, tick, DevOps, tick, API Management, tick, App Server, tick. The list goes on. This is definitely the two tunes in the same key, just different.</p><p>What I see coming is years of confusion between the two overly similar tunes. Many of Redhat’s customers are also IBM customers. That should be a good thing — except that the customers who bought Redhat in many cases wanted to hedge their bets and avoid buying IBM. They will be wondering how reliant they are now on Big Blue.</p><p>Not to be overly pessimistic, I’ll just say: when you do get that set of two similar tunes working, it can be subtle and beautiful. So maybe this might just work that way. But I won’t be betting on it.</p><p>Overall, this sends a great message — the biggest software deal ever is an Open Source deal. I am a little saddened that Redhat is no longer independent. They showed that a truly Open model, not based on tricks like Open Core, can generate a genuinely successful company. I wish them luck in their new home.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de4f301b6c09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transforming SOAP backends in Ballerina (and integrating into Travis)]]></title>
            <link>https://medium.com/@paulfremantle/transforming-soap-backends-in-ballerina-and-integrating-into-travis-f9774cd06498?source=rss-6c16b3931a91------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9774cd06498</guid>
            <category><![CDATA[soap]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[ballerina]]></category>
            <category><![CDATA[rest]]></category>
            <dc:creator><![CDATA[Paul Fremantle]]></dc:creator>
            <pubDate>Mon, 07 May 2018 21:12:49 GMT</pubDate>
            <atom:updated>2018-05-07T21:18:42.731Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://ballerina.io/">Ballerina</a> is a new language that is designed with integration in mind.</p><p>I was at the KubeCon conference last week and someone asked me to demonstrate calling a SOAP endpoint from Ballerina. In about 10 minutes I managed to turn the SOAP service into a RESTful interface. Since then I did a small amount of refactoring which is what we’ll look at here. While there is work going on to add a SOAP connector to Ballerina, unless you need to support WS-Security, it is just fine using the XML and HTTP support. Here’s how.</p><p>First, let’s look at a sample backend SOAP service. This is a service I built a few years ago for exactly this purpose. I loosely based it on a real SOAP API (<a href="https://www.barclaycard.co.uk/business/accepting-payments/website-%20payments/web-developer-resources/smartpay#tabbox1">Barclaycard SmartPay</a>) but I simplified it a bit.</p><p>You can run the SOAP service using docker as follows:</p><pre>sudo docker run -d -p 8888:8080 pizak/pay</pre><p>This makes the SOAP service available on port 8888. You can find the WSDL on:</p><pre><a href="http://localhost:8888/pay/services/paymentSOAP?wsdl">http://localhost:8888/pay/services/paymentSOAP?wsdl</a></pre><p>The service has two methods, <strong>ping</strong> and <strong>authorise. </strong>The easiest way to find this out is to point <a href="https://soapui.org/">SOAPUI</a> at it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/1*zaf6Rp_iB-eFJvmG__vr3A.png" /><figcaption>SOAP UI view of the WSDL</figcaption></figure><p>Using SOAPUI, I created a sample message for the authorise method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Nxf3FloFRHjtk3qf5HxFg.png" /><figcaption>Sample XML message to call the Authorise method</figcaption></figure><p>This XML can be cut and paste straight into a Ballerina .bal file, and then turned into an inline XML:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYBNetQcggy5F6TCyPHbzQ.png" /><figcaption>Inline XML in Ballerina</figcaption></figure><p>The ‘?’ that SOAPUI produces can be replaced with variable substitution in Ballerina using ‘{{variable}}’ syntax:</p><p>For example:</p><pre>&lt;pay:cardnumber&gt;{{a.cardNumber}}&lt;/pay:cardnumber&gt;</pre><p>The fact XML is a genuine first class type in Ballerina really helps. For example if the tags don’t match, the Abstract Syntax Tree (AST) validation in the IDE plugin spots that. Here I’ve deliberated messed up the tags:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j1lB5YLxR3ol6ifVoPzsiA.png" /><figcaption>XML is really a first class type in Ballerina</figcaption></figure><p>I said I did a bit of refactoring. Here is a slightly neater version of the XML:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BULiU4uRpYeqmybh8RmgJA.png" /><figcaption>The XML re-factored to define the namespaces and separate the SOAP and XML body</figcaption></figure><p>Now we have an XML to send to the backend, we can very easily parse an incoming JSON to create it. First I created a record type to represent the incoming message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*e5Cyr3Ou4cHUCYC5DIQ6HQ.png" /><figcaption>Record definition in Ballerina</figcaption></figure><p>Ballerina supports direct <a href="https://ballerina.io/learn/by-example/http-data-binding.html">data type mapping</a> from incoming JSON:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z4kUQE9vUzDeBJKdLixInQ.png" /><figcaption>An HTTP service accepting JSON and binding to a record type.</figcaption></figure><p>The <a href="https://github.com/pzfreo/soap-to-rest/blob/master/soaprest/soap-to-rest.bal">rest of the code</a> is pretty straightforward, as you’ll see. Its based on calling an HTTP client and sending over the XML as a POST.</p><p>The response XML can be parsed very easily. One sneaky trick is to turn it into a JSON automatically and then navigate as if it were JSON:</p><pre>json j = x.toJSON({preserveNamespaces:false}).<br>     Envelope.Body.authoriseResponse;</pre><p>Once again I created a simple type AuthoriseResponse:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*fmLqCLavyqXDmVX4hybIeA.png" /><figcaption>Record type for the JSON response</figcaption></figure><p>Like XML, JSON is a native type, and this can be cast directly into a JSON object, and sent back to the calling HTTP client:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*jg-DeXFGQeXvlGueOJnskA.png" /><figcaption>Casting record types as JSON</figcaption></figure><p>Here is the generated sequence diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sew6zKBReeU-v59XdkG6EA.png" /><figcaption>Sequence diagram for soap-to-rest.bal</figcaption></figure><p>The final thing I’ve done is to put the whole into a <a href="https://ballerina.io/learn/how-to-structure-ballerina-code/#packages">package</a>, create a <a href="https://github.com/pzfreo/soap-to-rest/blob/master/soaprest/tests/soap-to-rest-test.bal">test</a> for it using <a href="https://ballerina.io/learn/how-to-test-ballerina-code/"><em>testerina</em></a>, and then finally setup a <a href="https://github.com/pzfreo/soap-to-rest/blob/master/.travis.yml">.travis.yml</a> so that <a href="https://travis-ci.com/">travis-ci.com</a> can build and test it every time I do a git push. <br>I figured out how to get Travis to build Ballerina by looking at the <a href="https://github.com/ballerina-guides">Ballerina By Guides</a> that <a href="https://github.com/kasun04">Kasun</a> has been so instrumental in. However, I added a bit of my own fun too — I quickly realised that because the backend SOAP service is dockerised I can even start this for the test:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dPwJ4P-lumfOMzNhMc7Bfw.png" /><figcaption>.travis.yml excerpt</figcaption></figure><p>Here you can see the successful build and test on Travis:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejhU73wR0TG9tQmUMHGynw.png" /><figcaption>CI for Ballerina using Travis</figcaption></figure><p>I hope you enjoyed seeing how effective Ballerina is at working with JSON, XML, HTTP and even SOAP.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9774cd06498" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>