Page 1 of 1

Rest Service is not working when configured with UI

Posted: Wed Jun 25, 2014 2:53 pm
by Mansoor Ahmad

Hi,

I am using this external API to get some html code in response :

link : http://www.senubo.com/smslive/appapi2...

html response is coming when i hit this url and even when i create a simple REST service but when I configure this service as a data source with some page, the service fails all the time.

Do you have any idea what is the issue here ?

Thanks.


Rest Service is not working when configured with UI

Posted: Wed Jun 25, 2014 3:12 pm
by Evgene Karachevtsev

Hello Mansoor,

You should use Appery.io proxy for such a service:
http://devcenter.appery.io/documentat...


Rest Service is not working when configured with UI

Posted: Wed Jun 25, 2014 3:16 pm
by Mansoor Ahmad

Hi,

I am using this proxy and as I said this service works when i test it using service test option in services menu, but wen I configure this service as a data source with some page then service fails.

Thanks.


Rest Service is not working when configured with UI

Posted: Wed Jun 25, 2014 3:35 pm
by Evgene Karachevtsev

Mansoor,

Please clarify what error do you have in browser console? Please send us screenshot with it.


Rest Service is not working when configured with UI

Posted: Thu Jun 26, 2014 9:44 am
by Mansoor Ahmad

Image

Service settings screen shot Num : 1
Image

Service response parameter screen shot Num : 2

Image

Service test screen shot num : 3
Service runs successfully when I test it manually as shown in above screen shot

Image

Screen Shot num : 4 , When I call that above service from page ..It fails all the time as log is showing at the time when service fail method calls.

This service is returning an html code.

Thanks


Rest Service is not working when configured with UI

Posted: Thu Jun 26, 2014 11:16 am
by Mansoor Ahmad

Please let me know as well that what can be the reason of service failure when you call it from a page ? And from where i can track the service failure reasons ?


Rest Service is not working when configured with UI

Posted: Thu Jun 26, 2014 11:45 am
by Mansoor Ahmad

Hi,

I found the error of service failure.

the value of 'textStatus' parameter in the failure callback of service is " textStatus: parsererror " , So i suppose the reason is because response is in HTML not in json,xml,string format etc so it cause parse error may be.

So, can you please tell me is there any way (in Appery framework) that i can by-pass this process? or i can just have the response as it is without parsing?

Thanks.


Rest Service is not working when configured with UI

Posted: Thu Jun 26, 2014 3:04 pm
by Evgene Karachevtsev

Hello Mansoor,

Because html is the reply, you should call this service this way:

codewindow.open("http://www.senubo.com/smslive/appapi2.php?key=JKHF83298Y3YCB52IFPP0C&command=getform&userid=5&projectid=136&formid=11&returnattach=1&returnsubmit=1");/code


Rest Service is not working when configured with UI

Posted: Thu Jun 26, 2014 3:09 pm
by Mansoor Ahmad

okay Thanks for the reply.

Well, Other workaround will be to get response in json (html wrapped with json) ? if i want to proceed it with normal service call process ? right ?

Thanks.


Rest Service is not working when configured with UI

Posted: Thu Jun 26, 2014 4:11 pm
by Evgene Karachevtsev

Mansoor,

Yes, you may do this way and map response to the html component.