Mansoor Ahmad
Posts: 0
Joined: Mon May 12, 2014 2:44 pm

Rest Service is not working when configured with UI

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.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Rest Service is not working when configured with UI

Hello Mansoor,

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

Mansoor Ahmad
Posts: 0
Joined: Mon May 12, 2014 2:44 pm

Rest Service is not working when configured with UI

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.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Rest Service is not working when configured with UI

Mansoor,

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

Mansoor Ahmad
Posts: 0
Joined: Mon May 12, 2014 2:44 pm

Rest Service is not working when configured with UI

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

Mansoor Ahmad
Posts: 0
Joined: Mon May 12, 2014 2:44 pm

Rest Service is not working when configured with UI

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 ?

Mansoor Ahmad
Posts: 0
Joined: Mon May 12, 2014 2:44 pm

Rest Service is not working when configured with UI

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.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Rest Service is not working when configured with UI

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

Mansoor Ahmad
Posts: 0
Joined: Mon May 12, 2014 2:44 pm

Rest Service is not working when configured with UI

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.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Rest Service is not working when configured with UI

Mansoor,

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

Return to “Issues”