Lewis Johnson
Posts: 0
Joined: Tue Jan 29, 2013 12:58 pm

Incorrect Format for response data

I'm currently initiating a service call to a URL to extract the following structured details (details extracted direct from Chrome when URl called). The structure isn't JSON or XML and i'm just wondering how i could parse data in this format in order to then use it within my app?

If i try to 'Automatically Create Service Response' it fails with an incorrect format which i was expecting once i saw the output.

I'm sure there is a way to process the data but i'm bit of a Java Script newbie and at the moment wouldn't know where to start or if the data could be parsed using jQuery. Any help would be greatly received!

Regards

Lewis

GetPaidAtWaveNumber("**************","*********","60","2013-01-29 05:41:29 PDT","","8345")
OK, "6CEBCK"
"Plate","State","StallNumber","VendorStallNumber","StartDateTime","EndDateTime"
"LB05OJZ","","","","2013-01-29 12:13:27 GMT","2013-01-29 13:43:27 GMT"
"LN12UNG","","","","2013-01-29 11:56:16 GMT","2013-01-29 11:57:16 GMT"
"S287SNF","","","","2013-01-29 11:08:13 GMT","2013-01-29 13:08:13 GMT"
"LD10JWX","","","","2013-01-29 10:51:19 GMT","2013-01-29 13:51:19 GMT"

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Incorrect Format for response data

Hello! Could you post service URL, service settings and request parameters you use to define the service?

Lewis Johnson
Posts: 0
Joined: Tue Jan 29, 2013 12:58 pm

Incorrect Format for response data

https://westminster.verrus.com/ParkEn...

This is the full string
user=westminsterPatrol
password=P4tr0lUp0uRz
GraceMinutes=60
method=GetPaidAtWaveNumber
WaveNumber=8345

The last parameter can change

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Incorrect Format for response data

Thank you. We'll test

Lewis Johnson
Posts: 0
Joined: Tue Jan 29, 2013 12:58 pm

Incorrect Format for response data

many thanks

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Incorrect Format for response data

On service Complete event run next JS:

var answer = jqXHR.responseText;
alert(answer);

You can parse data only manually, mapping won't work because structure isn't JSON or XML

Image

Lewis Johnson
Posts: 0
Joined: Tue Jan 29, 2013 12:58 pm

Incorrect Format for response data

Marina

Thanks for your response. I can see that the response is parsed to the Answer variable but how would i handle stripping out the header details and then handling each field of data from the separate rows?

I guess it would be with Java script to create an array for each response line? If i can do that would I be able to then map the data to some of the apps components, such as a grid?

Thanks

Lewis

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Incorrect Format for response data

Hello Lewis!

Tiggzi provides JSON or XML data only (http://docs.tiggzi.com/documentation/...). You can export CSV data to Database.

Lewis Johnson
Posts: 0
Joined: Tue Jan 29, 2013 12:58 pm

Incorrect Format for response data

OK, but if i can capture the returned data into a javascript variable could i just then use a text field to show the response in?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Incorrect Format for response data

As I mentioned before, Tiggzi works with JSON or XML data only. But you can try to convert your own CSV in XML using Yahoo pipes.

You should create rest service with following parameters:
URL: http://query.yahooapis.com/v1/public/yql
DataType:XML
and two Request parameters:
q: select * From csv where url="https://westminster.verrus.com/ParkEn..."
diagnostics: false

You would get this:
Image
You can use such Rest Service in Tiggzi.

Return to “Issues”