REST BC No Access-Control-Allow-Origin

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

REST BC No Access-Control-Allow-Origin

OpenESB Community Forum mailing list
Hi friends

Does anyone know how to implement CORS in my component?

 ("Access-Control-Allow-Origin", "*");
 ( "Access-Control-Allow-Headers", "Cache-Control, Pragma, Origin,
Authorization, Content-Type, X-Requested-With");
("Access-Control-Allow-Credentials", "true");
("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT, OPTIONS,
X-XSRF-TOKEN");
("Access-Control-Max-Age", "1209600");

thanks



--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: REST BC No Access-Control-Allow-Origin

Paul Perez
Administrator
Hi Marcelo

I'm certainly ridiculous but what does CORS means for you

Best regards

Paul

-----Original Message-----
From: User <[hidden email]> On Behalf Of marcelo.moscoso
via User
Sent: 22 March 2018 15:01
To: [hidden email]
Cc: marcelo.moscoso <[hidden email]>
Subject: [User] REST BC No Access-Control-Allow-Origin

Hi friends

Does anyone know how to implement CORS in my component?

 ("Access-Control-Allow-Origin", "*");
 ( "Access-Control-Allow-Headers", "Cache-Control, Pragma, Origin,
Authorization, Content-Type, X-Requested-With");
("Access-Control-Allow-Credentials", "true");
("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT, OPTIONS,
X-XSRF-TOKEN"); ("Access-Control-Max-Age", "1209600");

thanks



--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/

www.pymma.com The best services on OpenESB
Reply | Threaded
Open this post in threaded view
|

Re: REST BC No Access-Control-Allow-Origin

OpenESB Community Forum mailing list
Hi Paul, CORS is HTTP Access Control (CORS),

when my app access jquery ajax to my Rest BC service in the browser I get
the following error:

Response to preflight request doesn't pass access control check: No
'Access-Control-Allow-Origin'

my question is how I return in the response service rest bc  in the header
Access-Control-Allow-Origin: *

read some filters in:

http://grepcode.com/file/repo1.maven.org/maven2/net.open-esb.admin/openesb-rest-api-core/1.0.2/net/openesb/rest/api/provider/CorsResponseFilter.java


I do not know how to apply it   :(

please help




--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: REST BC No Access-Control-Allow-Origin

vishnu.piskala
Hi

You should be able to send these properties in REST BC Response as HTTP Headers using NMR properties. See this link:

https://docs.oracle.com/cd/E19182-01/821-0540/ug_restbc-nmprops_t/index.html

Look for Response Metadata --> HTTP Response Headers under REST BC. Assign a property in BPEL Mapper and then edit the source code to assign more properties. I think you should be able to assign more than one properties using array syntax. I'm not sure about the exact syntax.

Regards
Vishnu


-----Original Message-----
From: User <[hidden email]> On Behalf Of marcelo.moscoso via User
Sent: Friday, March 23, 2018 3:24 AM
To: [hidden email]
Cc: marcelo.moscoso <[hidden email]>
Subject: Re: [User] REST BC No Access-Control-Allow-Origin

Hi Paul, CORS is HTTP Access Control (CORS),

when my app access jquery ajax to my Rest BC service in the browser I get the following error:

Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin'

my question is how I return in the response service rest bc  in the header
Access-Control-Allow-Origin: *

read some filters in:

http://grepcode.com/file/repo1.maven.org/maven2/net.open-esb.admin/openesb-rest-api-core/1.0.2/net/openesb/rest/api/provider/CorsResponseFilter.java


I do not know how to apply it   :(

please help




--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: REST BC No Access-Control-Allow-Origin

OpenESB Community Forum mailing list
thank you, I'm trying,
I already have the message in the header !!!!!!          , but the problem
persists,


xmlns:sxnmp="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/NMProperty"

        <assign name="Assign1">
            <copy>
                <from variable="OperacionIn" part="part1"/>
                <to variable="OperacionOut" part="part1"/>
            </copy>
            <copy>
                <from>'{"Access-Control-Allow-Origin":"*"}'</from>
                <to variable="OperacionOut"
sxnmp:nmProperty="org.glassfish.openesb.rest.response.headers"/>
            </copy>
        </assign>


I think I need one more parameter, I'll keep trying, soon the solution

<http://openesb-community-forum.794670.n2.nabble.com/file/t317629/access-allow-origin.png>

<http://openesb-community-forum.794670.n2.nabble.com/file/t317629/error-browser.png>





--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/