Chem Swift
Posts: 0
Joined: Wed Jul 24, 2013 10:06 pm

REST Service Error

I get "Uncaught ReferenceError: Rest web service not defined error." How can I resolve this issue?

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

REST Service Error

Hi Chem,

Is there a Rest service in your app? Are there any other errors in console?
Could you give us a public link to a page with error?

Chem Swift
Posts: 0
Joined: Wed Jul 24, 2013 10:06 pm

REST Service Error

Hi Katya,

My issues are as follows:

  1. When I configured the web service and tested it, it worked correctly. I used the "Automatically Generate Service Response" tool to generate the response. In my page I clicked on the "data" tab and added the service and mapped it correctly. When I call the service on page load i get the Uncaught Reference error I mentioned.

  2. Every time I configure a service to load when the page is loaded and I save and refresh the page or I go back to the project list I lose all of the configurations I setup during page load. On page load I set it to execute a Javascript function call which then execute the web service calls.

    I like Appery but its frustrating having to configure web service calls multiple times per day. I've created versions for my project and in some versions some calls work while other versions they don't work. Any help would be greatly appreciated.

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

REST Service Error

Chem,

Without seeing the code it's difficult to suggest something.

Do you have a JS-code that you wrote in your app? If there is a syntax error, it can provoke a situation where the service object isn't created before call it.

Not sure I understand what kind of service configuration you mean. Can't you save event handler where the service call? You click the "Add event" button?

Chem Swift
Posts: 0
Joined: Wed Jul 24, 2013 10:06 pm

REST Service Error

Here is a problem I'm having. I've defined the web service but when I try to call it on load nothing happens. Here is a public URL http://appery.io/app/mobile-frame?src.... Screenshots are below. Can you help please?

Image Image

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

REST Service Error

Hi Chem,

We can't log in without credentials.
Try using Page Show event instead of Page Load.

Chem Swift
Posts: 0
Joined: Wed Jul 24, 2013 10:06 pm

REST Service Error

I moved the web service calls from the "Events" tab in the UI designer to the "onLoad" method in the page's javascript file. How do I enable the "Page Show" event from Javascript?

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

REST Service Error

Chem,

You don't need to edit page source code. You had to delete old event handler and create a new one.

Now if you edited file on Source tab you'd better delete it and call Undo in the folder properties. Otherwise the further actions in editor won't change the file.

Chem Swift
Posts: 0
Joined: Wed Jul 24, 2013 10:06 pm

REST Service Error

So basically I can't make any changes to the Javascript files Appery creates for me? For example "MyPage.js"? I can only make changes to the Javascript files I create? Also, when I create an event in the "Event" tab for example "Invoking a service", when I close the project and open a new project, then return to the previous project the events I defined are no longer in the "Events" tab. However, if I look at the Javascript file for the page for example "Mypage.js" I can see the service being called in the "onLoad" function. Is there a way to not have the services I defined in the "Events" tab not disappear?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST Service Error

You can make changes however, once you start editing the source directly, the visual part will no longer be updated. The issue is, you can write any JavaScript but it's impossible for us to know what to render/display.

Return to “Issues”