Jump to content
Software FX Community

Failed to download Chart - ProtocolError Unathorized (401)


stevenjg
 Share

Recommended Posts

I'm using ChartFX for Visual Studio 2005 with the OLAP extension in the .Net renderer mode.  I can view charts rendered as images no problem but the minute i put it into renderer mode i get the "Failed to download Chart - ProtocolError Unathorized (401)"

I've checked permissions in IIS and on the file system and everything seems in order - i've exhausted every avenue available without coming up with a solution!

Has anyone seen this issue before or have any suggestion on how to resolve it?

CheersSteven 

Link to comment
Share on other sites

The .NET security settings need to be set to Full Trust if you are using the .NET Client Control (in your client browser) otherwise the control can not access the authentication information needed to retrieve the chart's data. 

If you are using Form Authentication the following  KB article should get you in the right direction:

Q7621009. How to use Chart FX and Forms Authentication to secure your charts

In order to use Form Authentication with Chart FX using PSS, you need to configure your application and PSS so that they can share login information.


URL: http://support.softwarefx.com/Article.aspx?KBID=7621009&Product=CfxNet70&Embed=0&_r=1

 

ChartFXSample.zip

Link to comment
Share on other sites

Hmm. Somehow it seems that the authentication info is not being sent back. Check this KB article out:

Q7621004. The Chart FX PSS Service in a nutshell
This article explains how the Chart FX PSS Service works and how it can be configured.
URL: http://support.softwarefx.com/ShowArticle.aspx?Type=KB&Product=CfxNet70&Source=http://support.softwarefx.com/kb/762/1/004.htm?_r=1

In particular, I want you to change the EventLogLevel (in config file) to "Trace" and Restart the PSS service. The hit the page in question and go to the Windows Event Log and see the messages from PSS. Attach them here.

One more thing. To make sure you are indeed using PSS (default) check the ource of your HTML page and look for the Chart FX <OBJECT> tag. It should be pointing its datapath property to a url starting with chartfx70/PSS. If this is not the Cosme, then you have a problem with PSS not functioning correctly. The article above should give you the info you need to figure out why. Let me know if you can't get it to work.

Link to comment
Share on other sites

Hi Frank,

This is getting very confusing now!

If i access the application using localhost and also use the PSS service i get nothing on the screen whatsoever, the tag in the page is:

<script src="/chartfx70/pss/ChartFX.aspx?id=1-050217441&type=js&mime=application%2fx-javascript"></script><script>cfx_replaceChart1();</script>

If i access the application using localhost and don't use the PSS service i get a correctly rendered chart, the tag in the page is:

<script src="/chartfx70/temp/CFT0502_05535607BDA.js"></script><script>cfx_replaceChart1();</script>

Great i think to myself i'll just turn off the PSS service and use the temporary files method - problem is though when i access the application from another machine and have to use the server address i get the "Failed to download Chart - ProtocolError Unathorized (401)" error message.

 If i turn the PSS service back on at this point i'm back to a blank screen!!

The output from the trace command when the PSS service is on is as follows:

Save State 050217410 (SWANT\comic|125.2.1.105)Save State 050217411 (SWANT\comic|125.2.1.105)Save Output 050217411(SWANT\comic|125.2.1.105)_jsSave Output 050217410(SWANT\comic|125.2.1.105)_.netSave Output 050217410(SWANT\comic|125.2.1.105)_.net 

Kind RegardsSteven 

Link to comment
Share on other sites

Ok.

When you turn off PSS and you go to the Temp Folder chartfx70/temp/ you need to make sure that everyone has access to this folder.

To test this, past the following in your browser's address bar:

http://<your server name>/chartfx70/temp/CFT0502_05535607BDA.js

If you get 401 (or a prompt for User/Password) then you know you don't have access.

Also try the same thing turning PSS on and hitting:

http://<your server name>/chartfx70/pss/ChartFX.aspx?id=1-050217441&type=js&mime=application%2fx-javascript

Looking at your log, it seems that this last request never reaches PSS. There should be a corresponding "Load Output" entry there with the same user (SWANT\comic).

Link to comment
Share on other sites

I can request both URLs and be able to download the JS files fine.

I've sorted the PSS service now so that it does produce the Load Output step (Load Output 050309360(|125.2.1.105)_.net) but this produces the "Failed to download Chart - ProtocolError Unathorized (401)" error in the chart viewer control - the same error i get when not using the PSS Service.  It's almost as if the .Net control can't load the .chw chart into the viewer as specified in the JS file?

function cfx_replaceChart1() {document.write('<object codetype="application/octet-stream" id="Chart1" classid="/chartfx70/download/ChartFX.NetIEClient.dll#ChartFX.NetIEClient.Chart" standby="Downloading Chart FX control please wait ..."  WIDTH="100%" HEIGHT="90%" >');document.write('<param name="Cookies" value="QQBTAFAALgBOAEUAVABfAFMAZQBzAHMAaQBvAG4ASQBkAD0AMAB1AHgAcgA0AHUAegByAHkAZQBqAHMAaAAwADUANQB5AHMAdgB4AGQAdwA0ADUAOwA="/>');document.write('<param name="DataPath" value="/chartfx70/temp/CFV0502_0549371947F.chw"/>');document.write('[Chart FX: .NET Active client requires Internet Explorer and .NET Framework 2.0 or greater installed on the client computer.]');document.write('</object>');} 

 

 

Link to comment
Share on other sites

Just to add a bit more clarification to the current position:

- The PSS Service now works correctly- Viewing a chart using the PSS Service or temp files method using http://localhost does work- Viewing a chart using the PSS Service or temp files method via http://machine-name or http://IPaddress does NOT workThe .Net chart viewer control does display so we must assume that the JS file has been loaded correctly as cfx_replaceChart1() is called.  It appears that when the .Net control tries to load the .chw file into the viewer that is where the 401 is occuring.  I can however request the .chw fine via the browser using both localhost and the machine name so i've no idea why i'm getting this 401 error!?

Link to comment
Share on other sites

There is no user in the LoadOutput trace:

Load Output 050309360(|125.2.1.105)

Notice that in the SaveOutput there was a user (SWANT\comic)

Save Output 050217410(SWANT\comic|125.2.1.105)

For some reason the Client Control is not sending the Windows user to the server.Like I mentioned before Full Trust is required on order for the Client Control to obtain the credentials from the browser. Other than that I don't know what could be failing.

When you send the request for the PSS file from the browser's address bar. Do you get a Load Output trace with the right user?

You said this was windows authentication. Are you getting a logging dialog when you hit this page? How about when you hit the PSS directly?

 

Link to comment
Share on other sites

The missing user was my fault, i was trying to remove all authentication to see if that would help the issue - it didn't!

Here are two different sets of trace outputs:

Does Not Work / Accessed Application via http://server_name
Load Output 050409311(SWANT\comic|125.2.1.105)_js
Activating license *******************(RP) 
Save Output 050409310(SWANT\comic|125.2.1.105)_.net
Save Output 050409311(SWANT\comic|125.2.1.105)_js
Save State 050409311 (SWANT\comic|125.2.1.105)
Save State 050409310 (SWANT\comic|125.2.1.105)

(* replaces real licence number)

Does Work / Accessed Application via http://localhost
Load Output 050409340(SWANT\comic|127.0.0.1)_.net
Load Output 050409341(SWANT\comic|127.0.0.1)_js
Save Output 050409340(SWANT\comic|127.0.0.1)_.net
Save Output 050409340(SWANT\comic|127.0.0.1)_.net
Save Output 050409341(SWANT\comic|127.0.0.1)_js
Save State 050409341 (SWANT\comic|127.0.0.1)
Save State 050409340 (SWANT\comic|127.0.0.1)

Now there are a few differences between the two trace outputs the obvious being the presence of a "Activating license" statement in the one that doesn't work?

The other notable differences are that the Save Output for .net (italicised) in the localhost trace appears twice and the Load Output for .net (italicised) doesn't appear in the other trace at all!

Do you get any clues from that?

Also, yes i do get prompts to authenticate when accessing the application and the PSS service directly.
 

Link to comment
Share on other sites

- Activating license occurs only once. Unless you see any errors on that particular event log that is normal.

LoadOutput is not beign called for http://sever_name. Chart FX makes no distinction between local host and server_name. IE and the .NET Framework do. You need to double check the following:

1) Are the security settings for the .NET Framework 2.0 the same (Full Trust) for Internet, Intranet and Local Machine zones?

2) Is the user information beign sent to server_name? Try addind server_name to your trusted sites.

 

Link to comment
Share on other sites

Hi Frank,

To answer your questions:

1) Yes

2) server_name is already in the trusted sites list 

I've just been looking through the IIS logs (see attached) for the two scenarios (localhost/server_name) and it seems that when accessed by server_name the .net control doesn't get loaded, a 401.2 is generated.  Interestingly, when accessed by localhost the .net control is accessed twice without credentials and generates a 401.2 followed by a 401.1 but then uses the credentials on the third attempt and serves up the .net control correctly.  I can't see any reason for it to be different when accessed by server_name!?

Steven 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...