Read XML from a http stream

I have a http connection that listen on status changes. It comes in an xml format. The problem is that the complete xml come in chunks. Some times it comes complete with start and end tag and sometimes it comes in two or three pieces. Can I somehow search for start tag eg wait until tag is received and then send a complete valid xml into the xml node.

an example

sometimes the xml is complete
like this

<book id="bk101">
      <author>Gambardella, Matthew</author>
      <title>XML Developer's Guide</title>
      <genre>Computer</genre>
      <price>44.95</price>
      <publish_date>2000-10-01</publish_date>
      <description>An in-depth look at creating applications 
      with XML.</description>
   </book>

and sometimes it come like this

payload 1

<book id="bk101">
      <author>Gambardella, Matthew</author>
      <title>XML Developer's Guide</title>
      <genre>Computer</genre>
      <price>44.95</price>

payload 2

<publish_date>2000-10-01</publish_date>
      <description>An in-depth look at creating applications 
      with XML.</description>
   </book>

Any suggestion how to solve this? tried a lot of things but no success.

Best regard Niclas

If you don't mind a short delay you could just join with a join node set to manual string. You can set the join node to timeout after x seconds.

Actually you should be able to use a split node set to split on </book> and check - handle as a stream, then you shouldn't get the delay.

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.