Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 20 of 36 total
Thread Dataset load response error
Sun, Nov 8 2015 11:47 AMPermanent Link

Uli Becker

> Sorry I can't help further, but I don't use ewbserver (I use either php or B4J as the back end). I'm not even 100% sure what it is...

Cross origin is not the issue in this case - it's just the wrong
Database.BaseURL. See my answer to Riaz' first question.

BTW: "Enable Cross-Origin Resource Sharing" is an option in EWB-Server.

Uli
Sun, Nov 8 2015 11:53 AMPermanent Link

Uli Becker

Riaz,

> thanks for the reply,  tried that, still same error

I just created a small project and have no problems to load your data
with the built in Webserver of EWB. The project is attached. Please try it.

Uli




Attachments: Test Newsgroup.zip
Sun, Nov 8 2015 12:12 PMPermanent Link

Uli Becker

Riaz,

hmm... Just tried the sample project with Chrome and got the same error.
Debugging with F12 shows:

"XMLHttpRequest cannot load
http://epos4u.4irc.com:6005/datasets?method=rows&dataset=butts. The
'Access-Control-Allow-Origin' header contains multiple values
'http://localhost, http://localhost', but only one is allowed. Origin
'http://localhost' is therefore not allowed access."

Running the same project with IE works fine.

Sorry, no idea...

Uli
Sun, Nov 8 2015 12:12 PMPermanent Link

Riaz

Uli,

thank you for your help, just tried your example, still the same here

even uploaded to test server http://www.epos4bars.com/riaz/project1.html

even went out on my phone and not connected to my network, still same

i just can't seem to get passed this, its strange it works for you and not me

i honestly have no idea where to go from here, once i can pass this i will be ok

thanks Uli

Riaz
Sun, Nov 8 2015 12:32 PMPermanent Link

Raul

Team Elevate Team Elevate

On 11/8/2015 9:36 AM, Riaz wrote:
> i am trying again with ewb, played with ewb1 now ewb2
> i have a problem with the following error
> Error: Dataset load response error ( cannot connect to server)
> this works ok http://epos4u.4irc.com:6005/datasets?method=rows&dataset=butts
>
> i am using the following, had it working on ewb1

Looks like a resource origin error :

Using browser debug tools (F12 usually) is see that request goes out OK
to "http://epos4u.4irc.com:6005/datasets?method=rows&dataset=butts"

However the Chrome internal error is :

"test.html:1 XMLHttpRequest cannot load
http://epos4u.4irc.com:6005/datasets?method=rows&dataset=butts. The
'Access-Control-Allow-Origin' header contains multiple values
'http://localhost, http://localhost', but only one is allowed. Origin
'http://localhost' is therefore not allowed access."


Looking at response headers they are this (there is dupe entry there for
"Access-Control-Allow-Origin" for some reason) :

Access-Control-Allow-Origin:http://localhost
Access-Control-Allow-Origin:http://localhost
Cache-Control:no-cache
Connection:Keep-Alive
Content-Length:23352
Content-Type:application/json; charset=utf-8
Date:Sun, 8 Nov 2015 17:14:32 GMT
From:sch@epos4u.com
Server:Elevate Web Builder Web Server

Firefox shows it as :

Access-Control-Allow-Origin: http://localhost, http://localhost
Cache-Control: no-cache
Connection: Keep-Alive
Content-Length: 23352
Content-Type: application/json; charset=utf-8
Date: Sun, 8 Nov 2015 17:12:24 GMT
From: sch@epos4u.com
Server: Elevate Web Builder Web Server

I ran a quick test here and seeing same data so issue appears to be with
EWB Web server actually (how it populates the
"Access-Control-Allow-Origin" header ) - Tim has to take a look.

IMHO only workaround short term is to host the EWB app on the same
server for now  (and obviously all of this works in IDE as long as data
and app are served up by IDE web server).

Raul
Sun, Nov 8 2015 12:48 PMPermanent Link

Uli Becker

Correction: It *is* a cross origin error as you supposed.

Uli
Sun, Nov 8 2015 1:09 PMPermanent Link

Riaz

Raul,

thank you for your help

i had this working in EWB 1, then gave up as it went to EWB 2, after paying my 12 months subscription and then finding out i had to pay for EWB 2

so after a long time, i finally paid again for EWB 2 which is still being developed in in beta stages

all i want to do, is show some data from my network using my internet and i am struggling with stage 1

i honestly thought this not would be the issue with EWB 2 hence waited ages thinking there will be a great guide and videos as promised

i have tried, firefox, chrome and to be honest, it should work on any browser, tried it on my samsung s6 , iphone 6s

sorry for having a moan, just so annoying not been able to get past stage 1, and i really do not want to see the project running in IDE

Thanks Raul
Sun, Nov 8 2015 1:12 PMPermanent Link

squiffy

Telemix Ltd.

Avatar

Not sure if this will help, but ...

try setting all these headers if you can :

Access-Control-Allow-Origin,"*"
Access-Control-Allow-Methods : GET,POST,OPTIONS
Access-Control-Allow-Headers : Origin, X-Requested-With, Content-Type, Accept

Only reason I suggest it is that I set all those on mine for my app, and it works fine across servers.
Sun, Nov 8 2015 1:14 PMPermanent Link

squiffy

Telemix Ltd.

Avatar

I'd missed the other answers before I posted. Not sure my comment is relevant now.
Sun, Nov 8 2015 1:20 PMPermanent Link

squiffy

Telemix Ltd.

Avatar

This doesn't strictly address your issue, but ..

I've written 2 apps now in EWB 2 that rely heavily on calls to servers for json data. Now I can't speak for using ewbserver but I recommend using the TServerRequest component to ask for data and use it's onComplete callback to process it and populate your datasets.

If this is an option then I can help you with some sample code.

As I say, it doesn't address your issue directly but as I have a pretty heavyweight app doing this to almost extreme levels I can vouch for its ability.

Let me know.
« Previous PagePage 2 of 4Next Page »
Jump to Page:  1 2 3 4
Image