5

I'll start with the behavior we are looking to have:

  1. Take in a file (be it JSON or XML, but right now we would prefer XML although we have control over this),
  2. Parse it to find the "type" of the file
  3. Transform the file to match one of a few different XML formats
  4. Send it off to a pre-determined endpoint and back to the caller

Our initial research made it look like BizTalk with an Azure logic app would be a good fit for this, but now that I'm working on a Proof of Concept I am running into roadblocks, namely:

  • BizTalk is seemingly not supported in the latest version of Azure (2015-08-01-preview)
    • I read this in the comments section of one of the articles I read, but cannot find the reference now, is this true?
  • Parsing XML is not supported (I read in one of the 100 articles I've read on this that non-JSON requests are treated as binaries that cannot be parsed in a logic app), which would mean we have to transform our existing XML into JSON to call into Azure, only to transform it back into XML

I've been able to create a logic app, expose an endpoint, call it with a JSON body, and have the logic app parse that JSON and conditionally perform actions, and once I figured out how to do all of that, it was pretty impressive.

So my question is two-fold:

  1. Is our situation a good candidate for an Azure Logic App (or perhaps a different type of Azure app)?
  2. If so, is BizTalk the proper way to transform our files into the needed output XML formats?
    1. From what I'm seeing online, there isn't a way to create BizTalk transform files in VS 2015?

      BizTalk server projects are not compatible with Visual Studio 2015 or Visual Studio 2013.

Sven Grosen
  • 5,616
  • 3
  • 30
  • 52
  • What about this solution? https://azure.microsoft.com/en-gb/documentation/articles/app-service-logic-transform-xml-documents/ ? – wuerzelchen Mar 22 '16 at 13:20
  • @wuerzelchen That's the BizTalk solution I mentioned: you can't create maps in VS 2015 and it doesn't seem to be supported in the latest schema version of Azure. – Sven Grosen Mar 22 '16 at 13:30
  • You are avoiding the bigger issue, and that is: XML is dead. Don't use it. More and more services online expect JSON, and holding on to a dinosaur like XML will probably work for you for now, but is not a format for the future. Depending on how the lifetime of your app is, I would simply move over to JSON and be done with it. – Pedro G. Dias Mar 22 '16 at 14:57
  • 1
    @PedroG.Dias we are dealing with a highly regulated industry and regardless of our input format (we are fine dealing with JSON internally, and would actually prefer it), we will NEED to produce XML to satisfy third-party requirements. – Sven Grosen Mar 22 '16 at 15:06
  • @PedroG.Dias What an outrageous and ignorant comment. Whilst web developers may think JSON is _Mana from Heaven_, everyone in the EAI world uses XML and XSLT. The EAI world is very different from web development; has been around a lot longer than JSON has; isn't about to crumble anytime soon; and requires specialist tooling and technology. –  Feb 08 '17 at 04:31
  • @SvenGrosen You ever get a solution to this? I'm stuck on this now. Seems [BizTalk Transform Service](https://social.technet.microsoft.com/wiki/contents/articles/31327.azure-logic-apps-basic-transformation-hello-world.aspx#Create_BizTalk_Transformation_API) is still missing –  Feb 08 '17 at 04:45
  • @MickyD we can agree to disagree. JSON AND BSON have grown past what you're calling toys for web developers. Need schemas? Check. Need binary? Check. Try looking at any and all API providers out there, amazon, ibm, even good old Microsoft are abandoning xml and making json their primary data transfer format in all their systems. For some older systems, xml is the only choice, but given a selection, go json every single time. Soap died years ago and is only used in legacy systems. For all intents and purposes, xml as a data carrier is dead even though of course many xml systems still exist. – Pedro G. Dias Feb 08 '17 at 04:46
  • @PedroG.Dias Unless you know what EAI is (you've fallen into the SOAP trap already), your comments on this matter are moot. Incidentally, Microsoft have not abandoned EAI; XML nor XSLT as all are available in the brand-spanking new Azure BizTalk Services which supports much of the EAI features from BizTalk on-prem. QED –  Feb 08 '17 at 04:47
  • 1
    @MickyD we abandoned Azure and developed in house – Sven Grosen Feb 08 '17 at 13:44
  • That's a shame Sven. :( We're now dreading the day god forbid Microsoft ever wants to take on the electronic health care industry such as HL7.org; CDA; SNOMED; Docle and NEHTA in the hope that a 30 year old industry will use their narrow view, undisiplined, unregulated, unproven greenfield plan that of JSON everywhere. For now we're all still laughing here at work over the recent comments. Wishing you well. :) –  Feb 08 '17 at 14:29

3 Answers3

3

We recently shipped Preview of [Enterprise Integration Pack] (EIP) for Logic Apps. As part of this release, a bunch of xml processing capabilities have been added to Logic Apps.

  1. [JSON to XML] and vice versa: You can use the json() and xml() functions that are natively available in Logic Apps definition.
  2. XML Transform: You can now use the new XML Transform action which is based upon XSLT 1.0.

Beyond these, Logic Apps also has HTTP requests/response capabilities which can be used to call HTTP endpoints.

Hope this helps.

Thanks, Vinay

  • Does EIP for Logic Apps XSLT support all the features of BizTalk .TRFM files? Otherwise its not helpful –  Feb 08 '17 at 04:28
  • @Vinay: 1. json(xml(sting)) works fine so the question what are advantages to solution 2. XM-Transfrom with integration. I don't have any integration account so no way to test at the moment. What are advantages using solution2? I would happy for some feedback to this question. – ingo_ww Aug 09 '22 at 09:59
2
  1. Receive XML POST request.
  2. Transform the XML. - Use content as triggerBody() and map using XSLT. You can set the XML format here.

    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0">
    <xsl:template match="/">
    <Header>
    <Something>
    <xsl:value-of select="soap-env:Envelope/soap-env:Body/a:Something/@value"/>
    </Something>
    </Header>
    </xsl:template>
    </xsl:stylesheet>
    
  3. Transform XML to JSON - Use content body('transform_XML') and map using XML to Json.

    {"Something": "{{content.Something.Value}}"
    
  4. Parse JSON - Use content body('transform_XML_to_JSON')
  5. HTTP Response - set the values you want returned as body('Parse_JSON')['Value'] into the Body.

    <Header>
    <Something>
    <value = "body('Parse_JSON')['Value']"/>
    </Something>
    </Header>
    
  6. You can also create a blob with this and send to a data factory.

Watsyyy
  • 125
  • 10
0

You can also use Function Apps w/NewtonSoft (JSON.net). Logic Apps are amazing, but they are not the sandwich AND the chips... at least not quite yet.

You should be able to nest a Function App in a Logic App. Use NewtonSoft (In Function App) to support the parsing XML>JSON, JSON>XML