[Dev] [DAS] Configuring Cross Origin Resource Sharing in DAS

2015-09-03 Thread Madawa Soysa
Hi All,

I need to send JSON events from different domains to a DAS HTTP input
receiver. Since browsers does not allow cross origin scripting I user CORS
[1]  to send a
POST request to DAS input receiver. I get the following error when the
request is send.

XMLHttpRequest cannot load http://192.168.0.171:9763/endpoints/test. No
'Access-Control-Allow-Origin' header is present on the requested resource.

Even though the above error occurred, the events gets stored in the event
stream without a problem; but the client program do not get the 'success'
response. As I read at [2]
,
additional headers should be included in the server response. Is there a
way to configure this in DAS.

[1] - https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
[2] -
http://stackoverflow.com/questions/10636611/how-does-access-control-allow-origin-header-work
-- 

*_**Madawa Soysa*

Undergraduate,

Department of Computer Science and Engineering,

University of Moratuwa.


Mobile: +94 71 461 6050 <%2B94%2075%20812%200726> | Email:
madawa...@cse.mrt.ac.lk
LinkedIn  | Twitter
 | Tumblr 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DAS] Configuring Cross Origin Resource Sharing in DAS

2015-09-03 Thread Gimantha Bandara
Hi Madawa,

Can you please try to follow [1] and see if the issue can be fixed? This
will apply the CORS settings for the whole tomcat container.

[1]
https://docs.wso2.com/display/DAS300/CORS+Settings+for+the+Analytics+REST+API

On Thu, Sep 3, 2015 at 1:00 PM, Madawa Soysa 
wrote:

> Hi All,
>
> I need to send JSON events from different domains to a DAS HTTP input
> receiver. Since browsers does not allow cross origin scripting I user CORS
> [1]  to send
> a POST request to DAS input receiver. I get the following error when the
> request is send.
>
> XMLHttpRequest cannot load http://192.168.0.171:9763/endpoints/test. No
> 'Access-Control-Allow-Origin' header is present on the requested resource.
>
> Even though the above error occurred, the events gets stored in the event
> stream without a problem; but the client program do not get the 'success'
> response. As I read at [2]
> ,
> additional headers should be included in the server response. Is there a
> way to configure this in DAS.
>
> [1] - https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
> [2] -
> http://stackoverflow.com/questions/10636611/how-does-access-control-allow-origin-header-work
> --
>
> *_**Madawa Soysa*
>
> Undergraduate,
>
> Department of Computer Science and Engineering,
>
> University of Moratuwa.
>
>
> Mobile: +94 71 461 6050 <%2B94%2075%20812%200726> | Email:
> madawa...@cse.mrt.ac.lk
> LinkedIn  | Twitter
>  | Tumblr 
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Gimantha Bandara
Software Engineer
WSO2. Inc : http://wso2.com
Mobile : +94714961919
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DAS] Configuring Cross Origin Resource Sharing in DAS

2015-09-03 Thread Madawa Soysa
Hi Gimantha,

I tried that but the issue won't fix.

On 4 September 2015 at 01:19, Gimantha Bandara  wrote:

> Hi Madawa,
>
> Can you please try to follow [1] and see if the issue can be fixed? This
> will apply the CORS settings for the whole tomcat container.
>
> [1]
> https://docs.wso2.com/display/DAS300/CORS+Settings+for+the+Analytics+REST+API
>
> On Thu, Sep 3, 2015 at 1:00 PM, Madawa Soysa 
> wrote:
>
>> Hi All,
>>
>> I need to send JSON events from different domains to a DAS HTTP input
>> receiver. Since browsers does not allow cross origin scripting I user CORS
>> [1]  to
>> send a POST request to DAS input receiver. I get the following error when
>> the request is send.
>>
>> XMLHttpRequest cannot load http://192.168.0.171:9763/endpoints/test. No
>> 'Access-Control-Allow-Origin' header is present on the requested resource.
>>
>> Even though the above error occurred, the events gets stored in the event
>> stream without a problem; but the client program do not get the 'success'
>> response. As I read at [2]
>> ,
>> additional headers should be included in the server response. Is there a
>> way to configure this in DAS.
>>
>> [1] - https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
>> [2] -
>> http://stackoverflow.com/questions/10636611/how-does-access-control-allow-origin-header-work
>> --
>>
>> *_**Madawa Soysa*
>>
>> Undergraduate,
>>
>> Department of Computer Science and Engineering,
>>
>> University of Moratuwa.
>>
>>
>> Mobile: +94 71 461 6050 <%2B94%2075%20812%200726> | Email:
>> madawa...@cse.mrt.ac.lk
>> LinkedIn  | Twitter
>>  | Tumblr 
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Gimantha Bandara
> Software Engineer
> WSO2. Inc : http://wso2.com
> Mobile : +94714961919
>



-- 

*_**Madawa Soysa*

Undergraduate,

Department of Computer Science and Engineering,

University of Moratuwa.


Mobile: +94 71 461 6050 <%2B94%2075%20812%200726> | Email:
madawa...@cse.mrt.ac.lk
LinkedIn  | Twitter
 | Tumblr 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev