Page 1 of 2

REST Service always fires Error Event

Posted: Tue Sep 17, 2013 10:48 pm
by Manuel Martinez

Hello, I am testing a REST Service, when the data is sent to the Service everything is going fine, but when the service returns the xml, I always get the Error event fired, even when the data was already stored correctly in the service.
Can you give me advice to solve this issue?
Thanks in advance,
Manuel


REST Service always fires Error Event

Posted: Tue Sep 17, 2013 10:55 pm
by Alena Prykhodko

Hello Manuel!

Could you please tell steps to reproduce this Service?
And what exact error do you get?


REST Service always fires Error Event

Posted: Tue Sep 17, 2013 11:06 pm
by Manuel Martinez

Hi Alena!
I am using this URL with HTTP GET Method
http://pontiac.marzaconsulting.com/we...

The Request are already mapped from components in my appery page (Inputs and a Geolocation response data)

When I test the Service the response in text/xml buth I always receive the Error Event, instead of a Success event because the data is already stored in the service database.

Any comment would be very appreciated,
Manuel


REST Service always fires Error Event

Posted: Wed Sep 18, 2013 4:11 am
by maxkatz

The callbacks (success/error, complete) will be called regardless whether the data is saved somewhere. These are just standard jQuery callbacks. Check the response that you get.


REST Service always fires Error Event

Posted: Wed Sep 18, 2013 4:25 am
by Manuel Martinez

Hello Max, thank you, but how can i get the success event fired? The response i get is correct but the event fired is always the error event, i will appreciate your comments


REST Service always fires Error Event

Posted: Wed Sep 18, 2013 4:29 am
by maxkatz

What response do you get?


REST Service always fires Error Event

Posted: Wed Sep 18, 2013 3:45 pm
by Manuel Martinez

Se ha guardado la informacion de tu ubicación

This is the XML response I am trying to store in a localStorage variable, but cannot do it because the REST service always came with the error events instead of the Success event, how can I solve this?

Thanks,
Manuel


REST Service always fires Error Event

Posted: Wed Sep 18, 2013 3:48 pm
by maxkatz

I think you get the error because it's not a valid XML response. Try running your code in complete callback. It is always invoke after either success or error.


REST Service always fires Error Event

Posted: Thu Sep 19, 2013 1:06 am
by Manuel Martinez

Hi guys,
I have chabged my webservice in order to get a well formatted xml response this is the sample of the new response.

La información se envió correctamente

Buy unfortunately whe I make no callbacks, the localstorage variable is not with the value of the XmlSting "Aviso"

Can you post a little code snippet of how to handle the webservices responses and store them in localStorage variables.
I also tried to store the response ina component (input) but had the same luck, the response is not stored in the input.

I hope you can help me, if I can achieve this, I will have several projects all based in appery.

This is the complete URL that I call to invoke the webservice.

http://pontiac.marzaconsulting.com/we...

I appreciate your help and support.
Regards,
Manuel


REST Service always fires Error Event

Posted: Thu Sep 19, 2013 3:41 am
by maxkatz

With the new response, which callback function is being called: error or success?