No data from Business Entity via REST Service

Posted by bcprogress on 04-May-2014 16:34

Hi all!


I want to integrate a Business Entity into a Rollbase Application. I defined and exported the Service in OE Architect. I was also able to define the Object in Rollbase via the JSON-description. Basically I did everything like it is described in this video, but I don't get any data.

Tech Tip: The Progress OpenEdge Adapter for Rollbase,
https://www.youtube.com/watch?v=Hdko-w5Cfzo

I can access the full JSON-description.
-> http://localhost:8980/CustomerService/static/mobile/CustomerService.json

But when I try to get the data in the browser I don't get anything!!
-> http://localhost:8980/CustomerService/rest/CustomerService/beCustomer2
The result is just an empty page.

In Rollbase I get the message "HTTP call failed, response=Not Found when.

I checked the following log-files, but can't find any information which gives me an hint what is missing or wrong.

- restbroker1.server.log
- oerm.log
- CustomerService.log
- localhost_access_log.2014-05-04.txt

If anybody has an idea what to do this would be very nice!

best regards,
Marc

Posted by bcprogress on 02-Jun-2014 06:30

Dear all!

It worked when I created the Business Entity via the Express Setup. But I am still keen why it didn't work when I created the Business Entity manually.

I'll get back on that.

thanx everybody!

Marc

Posted by egarcia on 07-May-2014 15:04

Hello,

Could you clarify how you created the Business Entity?

If you created the Business Entity using the Express Project support or as a Business Entity from a database table, your Business Entity would include code to access the database.

However, if you created the Business Entity from a DataSet definition, then the .cls file would include entry points for the CRUD operations but you would need to supply the code.

Could you post your Business Entity?

Also, as a test, you could try changing the Resource URI in the Object definition to get some data from the following test URL :

oemobiledemo.progress.com/.../Customer

I hope this helps.

All Replies

Posted by Bill Wood on 04-May-2014 17:06

Did you deploy the class files to the AppServer? The rest service seems to have been deployed and it is showing the "static" JSDO catalog. This is just a file served up by Tomcat. The dynamic / AppServer calls are not working (I think that does give the Not Found error).

Is the appserver started and does it seem to have the cls files Published and Synchronized on it ?

I assume the JSDO catalog says that the resource is there at the endpoint t you are trying. =

Posted by Phillip Molly Malone on 04-May-2014 20:02

What was in the AppServer log? Any evidence that the BE was called when you did your test? Use some message statements to put messages to the AppServer log file to see if its being called. Without being an expert of Rollbase, I would imagine until the web browser returns the data you expect, RB won't work.

Also, when you call the Service from the browser, have a Javascript console open and see if there are any errors/messages in the log. I normally use Chrome which means opening the Developer tools and going to the console. This will help in debugging.

Should also note that I believe by default, the business entity code is called as a singleton class. If you make changes to your BE and publish them to the AppSErver, you should stop and start any agents that might of run the class before as it will not look at the new code if a version of the class is already running.

HTH and let us know how this goes.

Posted by Bill Wood on 06-May-2014 15:34

Just a 'plus 1' to Phillip's comment about getting this working first from your browser and verifying that the browser>REST>OE AppServer all work (without Rollbase).  If those don't return data, then Rollbase is not going to have better luck.

One note is that if you are in PDSOE, then the Publish should automatically reset the AppServer agents and you don't explicitly need to stop/start them to clear the cache.

Posted by mihai_neagoe on 07-May-2014 05:36

Hi Marc,

The problem in Rollbase could be from the Resource URI in Object definition.

Can you check if the are no '//' or duplicate resources in the generated link?

Posted by bcprogress on 07-May-2014 14:43

Hi all!

Thanks for your suggestions!

I don't get anything in the Logfile of the Appserver nor in the Logfile of the broker. So I checked what I can see in the Javascript console. There it gives me a "HTTP/1.1 404 Not Found".  So I checked if the delpoyment of the REST-Service is correct. And everything seems to be in the right place like described here,

documentation.progress.com/.../wwhelp.htm

@mihai_neagoe

Are you talking about the URI in the object definition of Rollbase or an URI which is located in one of the definition files of the REST-Service?

The problem is that I also don't get data when I call the Service via this URL,

http://localhost:8980/CustomerService/rest/CustomerService/beCustomer2

If anyone can give me any more hints what I can do this would be great!

cheers,

Marc

Posted by egarcia on 07-May-2014 15:04

Hello,

Could you clarify how you created the Business Entity?

If you created the Business Entity using the Express Project support or as a Business Entity from a database table, your Business Entity would include code to access the database.

However, if you created the Business Entity from a DataSet definition, then the .cls file would include entry points for the CRUD operations but you would need to supply the code.

Could you post your Business Entity?

Also, as a test, you could try changing the Resource URI in the Object definition to get some data from the following test URL :

oemobiledemo.progress.com/.../Customer

I hope this helps.

Posted by bcprogress on 02-Jun-2014 06:30

Dear all!

It worked when I created the Business Entity via the Express Setup. But I am still keen why it didn't work when I created the Business Entity manually.

I'll get back on that.

thanx everybody!

Marc

Posted by Anil Kumar on 02-Jun-2014 06:59

Hi Marc,

The Business Entity that got generated after selecting a temp-table or the dataset do not posses complete/working business logic in the CRUD (Create, Read, Update and Delete) methods, instead it will have the method stubs defined in it. However, when we generate a Business Entity by selecting a Database table (through 'Select database table' option in Business Entity wizard) then all the methods will have complete business logic which is ready with all CRUD operations without any additional code (this file is similar to that of Business Entity created from the Express setup).

Thanks and Regards,

Anil Kumar.

This thread is closed