How to Search the stream in Message Browser for a EnsLib.HTTP.GenericMessage

Ensemble 2014.1.5

Inbound EnsLib.HTTP.GenericMessage

<?xml version="1.0" ?>
<!-- type: EnsLib.HTTP.GenericMessage id: 349 -->
<HTTPMessage xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Stream>
{ "patient": { "identifier": "E23456778", "token": "PQOIWUE)&!@TT$1234706125" } }
</Stream>
<Type>
GC
</Type>
<HTTPHeaders>
<HTTPHeadersItem HTTPHeadersKey="CharEncoding" xsi:nil="true"></HTTPHeadersItem>
<HTTPHeadersItem HTTPHeadersKey="HTTPVersion">
1.1
</HTTPHeadersItem>
<HTTPHeadersItem HTTPHeadersKey="HttpRequest">
POST
</HTTPHeadersItem>
<HTTPHeadersItem HTTPHeadersKey="IParams">
0
</HTTPHeadersItem>
<HTTPHeadersItem HTTPHeadersKey="RawParams" xsi:nil="true"></HTTPHeadersItem>
<HTTPHeadersItem HTTPHeadersKey="TranslationTable">
RAW
</HTTPHeadersItem>
<HTTPHeadersItem HTTPHeadersKey="URL">
/web/rest/FR_PATWIS_PATIENTLOOKUP
</HTTPHeadersItem>
<HTTPHeadersItem HTTPHeadersKey="accept-encoding">
gzip,deflate
</HTTPHeadersItem>
<HTTPHeadersItem HTTPHeadersKey="connection">
Keep-Alive
</HTTPHeadersItem>
<HTTPHeadersItem HTTPHeadersKey="content-length">
104
</HTTPHeadersItem>
<HTTPHeadersItem HTTPHeadersKey="content-type">
application/json
</HTTPHeadersItem>
<HTTPHeadersItem HTTPHeadersKey="host">
fchensprt01.s1.fchhome.com:28072
</HTTPHeadersItem>
<HTTPHeadersItem HTTPHeadersKey="user-agent">
Apache-HttpClient/4.1.1 (java 1.5)
</HTTPHeadersItem>
</HTTPHeaders>

</HTTPMessage>

 

I am trying to figure out what criteria to use to search for 1) the token exists 2) a specific value.

I have found that the "stream" values are not searchable.  SO I was thinking I would be able to search the whole message body but not seeing how to do that. Any help would be appreciated?  I also tried looking at using the SQL tool but again the data is in the Stream.

  • 0
  • 0
  • 245
  • 0
  • 2

Answers

Here's how to view stream properties in SQL.  Alternatively you can use %CONTAINS to search the stream.

Another way would be writing an sql procedure that gets stream, converts it to object  and checks if it has the token. Would be slow though. Maybe do a simple [ check first and then pass only those rows that have the token into sql procedure?

Can you parse the stream when you receive the message?

Here is the SQL search that works:

SELECT SUBSTRING(StreamGC,1)
FROM EnsLib_HTTP.GenericMessage
WHERE SUBSTRING(StreamGC,1)['token'