8.3 REST Service

If you think that something doesn't work in Aware IM post your message here
Post Reply
UnionSystems
Posts: 197
Joined: Fri Jun 17, 2016 7:10 am
Location: Brisbane Australia
Contact:

8.3 REST Service

Post by UnionSystems »

Found a possible issue with the REST publication service in 8.3 build 2630 (also observed this issue in previous 8.3 builds). This issue was not evident in 8.1.

If an attribute being returned by the service contains a '#' character the XML or JSON result is split at the '#' character and the '#' character is not returned.

For example if you return an attribute of string 123456 AwareIM REST returns XML of

Code: Select all

<Object>
<Attribute>123456</Attribute>
</Object>
But if there is a '#' character in that string like 123#456 AwareIM REST returns

Code: Select all

<Object>
<Attribute>123</Attribute>
<Attribute>456</Attribute>
</Object>
We would expect to get

Code: Select all

<Object>
<Attribute>123#456</Attribute>
</Object>
Same problem occurs when AwareIM REST returns a JSON result for an attribute that contains a '#' character. In that case the JSON is

Code: Select all

{
"Attribute": [123, 
456]}
Attached BSV (XML.bsv) demonstrates the problem. Note to view REST output you need to PUBLISH the BSV then you can browse REST output at http://localhost:8080/AwareIM/REST/XML/Test

Note in this test BSV we've named the object 'Object' and the test attribute 'Attribute'.
AWS Linux, Windows Server, AIM 8.4 & 8.6
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: 8.3 REST Service

Post by Jaymer »

Dave,
I'd have to check a 8.1 project from 1.5 yrs ago, but I think I had a similar problem then. If I was sending an SMS msg and the user entered "my # is 111-2222" then it would crap out when sending. I had to escape it I think. Might help you get thru it [for now] using a REPLACE_PATTERN.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
UnionSystems
Posts: 197
Joined: Fri Jun 17, 2016 7:10 am
Location: Brisbane Australia
Contact:

Re: 8.3 REST Service

Post by UnionSystems »

Thanks Jaymer,

Appreciate your prompt response, typical of your generosity to this forum.

We've explored escaping the '#' in our content but we are actually passing through HTML and Javascript code in the REST response. The content uses # for RGB colour codes and in javascript Jquery $(#ID) references so its hard for us to quickly escape #. Our hope is that AwareIM can accept transmission of #.

We are crossing fingers this is remedied in Vlad's next 8.3 AwareIM release :-)
AWS Linux, Windows Server, AIM 8.4 & 8.6
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: 8.3 REST Service

Post by aware_support »

This will be fixed in the next build
Aware IM Support Team
UnionSystems
Posts: 197
Joined: Fri Jun 17, 2016 7:10 am
Location: Brisbane Australia
Contact:

Re: 8.3 REST Service

Post by UnionSystems »

Thanks
AWS Linux, Windows Server, AIM 8.4 & 8.6
UnionSystems
Posts: 197
Joined: Fri Jun 17, 2016 7:10 am
Location: Brisbane Australia
Contact:

Re: 8.3 REST Service

Post by UnionSystems »

This has been fixed but we have discovered the same issue occurs in 8.4 with another character ‘^’

If an attribute being returned by the service contains a '^' character the XML or JSON result is split at the '^' character and the '^' character is not returned.

For example if you return an attribute of string 123456 AwareIM REST returns XML of

Code: Select all

<Object>
<Attribute>123456</Attribute>
</Object>
But if there is a '^' character in that string like 123^456 AwareIM REST returns

Code: Select all

<Object>
<Attribute>123</Attribute>
<Attribute>456</Attribute>
</Object>
We would expect to get

Code: Select all

<Object>
<Attribute>123^456</Attribute>
</Object>
AWS Linux, Windows Server, AIM 8.4 & 8.6
intra
Posts: 279
Joined: Thu Oct 11, 2012 1:30 pm
Location: Australia

Re: 8.3 REST Service

Post by intra »

What might be good in this suituation is being able to user define the REST result delimiter to give a little more flexibility when it comes to provider result responses.

I think I came across this one for one of my data sources so I wrote a plugin in favour of using the native Awareim REST method.
Avid Linux user....
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: 8.3 REST Service

Post by Jaymer »

This concept of a ^ symbol was also discussed here, FYI:
https://www.awareim.com/forum/viewtopic ... 57&p=52367

Had not heard of this before that post.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply