02-04-2014 06:15 AM
Hi There,
Currently I'm trying to do a ajax call from a.domain.com (a website) to b.domain.com (nuxeo). In order to do this I extended the CORS with the following extension:
<?xml version="1.0"?>
<component name="nl.me.CORS-configuration">
<extension target="org.nuxeo.ecm.platform.web.common.requestcontroller.service.RequestControllerService" point="corsConfig">
<corsConfig name="CORS-API-CONFIG"
allowOrigin="https://a.domain.com https://b.domain.com";
allowSubdomains='true'>
<pattern>/nuxeo/api/v1/path/.*</pattern>
</corsConfig>
</extension>
</component>
The GET method works fine:
jQuery.ajax({
type: 'get',
url: 'https://dm.openworkplace.nl/nuxeo/api/v1/path/default-domain/@children',
crossDomain: true,
xhrFields: {
withCredentials: true
}
}
);
However the post method does not work from a.domain.com, it does work from b.domain.com (nuxeo instance). It does not return a answer at all...
jQuery.ajax({
type: 'POST',
contentType: "application/json",
dataType: "json",
url: 'https://b.domain.com/nuxeo/api/v1/path/default-domain',
data: '{"entity-type": "document", "name":"newDoc", "type": "File","properties": { "dc:title": "Specifications", "dc:description": "Created via a so cool and simple REST API", "common:icon": "/icons/file.gif", "common:icon-expanded": null, "common:size": null}}',
crossDomain: true,
xhrFields: {
withCredentials: true
});
The same command on the b.domain.com (with the nuxeo instance) works fine.
The server.log does not show anything.
Do you see if I'm doing anything wrong?
Thanks in advance, Bauke
02-04-2014 10:07 AM
Have you tried adding supportedMethods="GET, POST"
to the <corsConfig>
element?
02-04-2014 10:12 AM
Haven't tried it yet, but according the documentation
02-04-2014 11:49 AM
I'm sorry Florent but it didn't work
03-04-2014 04:15 AM
An additional question on this. Could it be that Nuxeo is running on ssl?
03-18-2014 09:36 AM
That could be a factor yes. Could you try without SSL first?
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.