Business Entity - Tables with Hyphens (OE 11.6.2)

Posted by Matheus R. Mokwa on 08-Jun-2016 07:49

I'm trying to create a rest call via business entity with a table that contains a hyphen in its name (e.i.: SUB-FAMILIA).

The business entity compiles fine (i'm using the default code, didn't change anything) but when I try to acess my rest url it returns this:

  1. Request Method:
    GET
  2. Status Code:
    200 OK

But the response is always empty (a blank page) even though there is records in the table.

Any clues or work around?

Obs: In others tables it works like a charm.

All Replies

Posted by Brian K. Maher on 08-Jun-2016 08:06

Look at the agent.log file to see what it has to say.
 

Posted by Ramadevi Dhavala on 08-Jun-2016 08:55

Hi,

Unfortunately, this is a know issue from Progress developer studio. Our development team is working on it to fix it for later releases.

Thanks & Regards,

Rama

Posted by Matheus R. Mokwa on 08-Jun-2016 09:01

Is there any workaround? Changing my table name would affect the whole system and would take a lot of effort..

Maybe an ETA?

Posted by egarcia on 08-Jun-2016 09:11

Hello,

I do not know the error message(s) that you are getting.

However, I wonder if using SERIALIZE-NAME would help.

Regards.

Posted by Ramadevi Dhavala on 09-Jun-2016 01:34

Hi,

The problem is during ‘.pidl’ file generation, the special character ‘-‘ is being ignored. Replacing the table name with correct name in .pidl will resolve the issue.

As a workaround please follow the below steps:

If you have already published your service,

1. From the Progress Developer Studio, go to the project explorer.

2. Click on ‘View Menu’ icon. From the drop down list select ‘Customize View…’.

3. ‘Available Customizations’ window will be opened. From that window, deselect ‘resources’ checkbox. So that ‘.services’ folder inside project explorer will be visible.

4. Expand “project Name”-> .services -> AppServer. There you can see the respective ‘.pidl’ file for each business entity.

5. Select your ‘BusinessEntity.pidl’ and open it with text editor.

6. Find the table name without ‘-‘ and replace it with the exact name (with ‘–‘).

7. Right click on OE Web Server and select ‘Clean’ operation.

8. Once the republish is completed, accessing your rest service from your rest client will display the proper data from the database.

Caution: Every time the ‘.pidl’ will get regenerated if the verb associations are changed from the REST Resource URI Editor. In this case again we have to replace the table names and republish the services.

Hope this will solve your problem,

Thanks & Regards,

Rama

Posted by Matheus R. Mokwa on 09-Jun-2016 07:09

Followed the steps in the above comment, and it's working now.

Thanks Rama.

Edit:

Looking further in the .pidl file I could understand the problem better. The problem, itself has nothing to do with the table name, but with the name of the temp-table/data-set that are genereted by the business entity.

So with you want to make you business entity works with a database table that contains hyphen, you just need to change the names of the temp-table and dataset in the BE. (e.i.: ttSUB-FAMILIA => ttSUBFAMILIA, and dsSUB-FAMILIA => dsSUBFAMILIA).  This way you don't need to change your .pidl file.

Att

Matheus Mokwa

This thread is closed