Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
djd
New Contributor
Posts: 3
Registered: ‎03-12-2010
My Device: curve
My Carrier: rogers

Widgets + XMLHttpRequest + basic auth

Hi.

 

Went through the archives, and found the issue/bug regarding XMLHttpRequests and authorization headers not working. I've been working on a widget that pulls twitter feeds, and  it seems to work for me, most of the time using:

 

 var auth = Base64.encode(user + ':' + pswd);
 request.open("GET", page);
 request.setRequestHeader("Authorization","Basic " + auth);

 

75% of the time this works. the other 25% of the time, the connection times out. sometimes i will have partial data in request.responseText, sometimes none. and even if i do get all of the data, when i update the page, sometimes not all of the graphics are loaded. (lots of little x's Smiley Wink )

 

Using: Widget SDK 1.0 beta3, Windows XP SP3 with the BlackBerry Smartphone Simulator v2.13.0.88. (model:9500)

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Widgets + XMLHttpRequest + basic auth

Hi djd,

 

Can you also post the OS version number 5.0.0.X ?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Developer
Posts: 10
Registered: ‎12-02-2009
My Device: Not Specified

Re: Widgets + XMLHttpRequest + basic auth

I dont think the problem is solved with the Widget SDK Beta 3, but rather in the platfom OS you are using in the simulator. I am using Beta 3 and the Widget can still not set the Authorization header in the xmlhttp request. Verified on physical device BlackBerry 9700 v5.0.0.321.

 

So be aware your Widget will probably not work on most BlackBerry 5.0 devices out there...

 

There is an issue (#WEBAPI-21) reported to RIM on this, but still not flagged as solved. Or has anyone seen an official OS release solving this problem?

 

/olle

djd
New Contributor
Posts: 3
Registered: ‎03-12-2010
My Device: curve
My Carrier: rogers

Re: Widgets + XMLHttpRequest + basic auth

> Can you also post the OS version number 5.0.0.X ?

 

OS Version of the simulator is 5.0.0.451

djd
New Contributor
Posts: 3
Registered: ‎03-12-2010
My Device: curve
My Carrier: rogers

Re: Widgets + XMLHttpRequest + basic auth

> Verified on physical device BlackBerry 9700 v5.0.0.321.

 

tried to install this simulator, to check, but i get an "internal error" "Access violation writing to 0x000000008" when running the simulator... i seem to get that with a lot of the simulators, actually...