Skip to Main Content

ORDS, SODA & JSON in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XMLHttpRequest crossdomain error when using restful GET glassfish

FrédéricBMay 30 2012 — edited May 31 2012
Hi,
I try to make a XMLHttpRequest call from my apache server to the apex listener under glassfish with a simple RESTFUL ressource named departement.
We use apache for static page and some php page. I put a Header set Access-Control-Allow-Origin * in my httpd-vhosts.conf to allow cross domain call.

When I make my call I get the following error:
XMLHttpRequest cannot load http://192.168.100.24:8080/apex/localite?departement=61. Origin http://sirius:8888 is not allowed by Access-Control-Allow-Origin.

Of course I could put allow my static page under the same virtual server of GlassFish and this case have only one domain, but it has many other constraints.

In my test I use the EXTJS class in the following manner

var store = Ext.create('Ext.data.Store', {
autoLoad: true,
autoSync: true,
model: 'Departement',
proxy: {
limitParam: undefined,
startParam: undefined,
pageParam: undefined,
noCache: false,
api: {
create : 'http://192.168.100.24:8080/apex/localite?departement=61',
read : 'http://192.168.100.24:8080/apex/localite?departement=61',
update : 'http://192.168.100.24:8080/apex/localite/inse'//,
//destroy : '/controller/destroy_action'
},
type: 'rest',
url: 'http://192.168.100.24:8080/apex/localite?departement=61',
reader: {
type: 'json',
root: 'items'
},
writer: {
type: 'json'
}
}
});

Any help would be welcome. If anyone had an example of using ExtJS form with RESTful apex listener it would be a dream !

Frédéric

Comments

Sharmela-Oracle

Hi,

Set UseCanonicalName to off and check if it helps.

-Sharmela

1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 28 2012
Added on May 30 2012
1 comment
1,209 views