Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Problem with JSON and Cassini
sebhof
#1 Posted : Tuesday, April 7, 2009 10:52:32 PM(UTC)
Groups: Member
Joined: 4/7/2009(UTC)
Posts: 2
Location: Germany

Hello

I'd like to run a ASP.NET application with the Cassini webserver. The ContentType = "text/json";

My problem is, the application doesn't run. Instead cassini want to download a file. In my case a *.aspx-file.
This file is responsible for the userlogin in this application.

Do you know this problem? Why doesn't work cassini with json?

Many thanks!
sebhof
Ultidev Team
#2 Posted : Wednesday, April 8, 2009 11:49:44 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hello, Sebhof.

What you are describing sounds more like a browser misbehaving, rather than web server. The only way a web server (or a web app) can force a browser to bring up File|Save dialog is if the response has a content-disposition header, something like "Content-Disposition = attachment; filename=test.txt". Otherwise it's up to the browser to decide whether it can render the content as a page, or try to save the response as a file. In general, browsers do treat unfamiliar content types as files. So if, say, browser does not know what to do with text/json response content generated by a URL ending wish .ASPX, it will try to save it as a file, which is exactly what you are describing. To confirm or disprove this theory, would it be possible to point the same browser to a URL generating text/json content generated by another web server and see whether results are different?

Please let us know what you have found.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
sebhof
#3 Posted : Wednesday, April 8, 2009 11:37:24 PM(UTC)
Groups: Member
Joined: 4/7/2009(UTC)
Posts: 2
Location: Germany

Hello

thank you for the help.

I tested the application by the IIS Webserver and the app run without any problems.

Many thanks!
sebhof
Ultidev Team
#4 Posted : Thursday, April 9, 2009 7:02:21 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Sebhof,

Do we understand this correctly that when you point the browser to the JSON app hosted by UltiDev Cassini, you still have a problem, and when you point it the same browser to the same app hosted by IIS, it works fine?

If that's the case we could help you troubleshoot the issue with Cassini. To do that we would need to see the difference between the responses generated by IIS and Cassini. To see the difference, the Fiddler - an HTTP traffic monitoring tool is a great help. Once you install and run it on the same machine as your browser, you can point the browser to your applications (using URLs with either machine name or real IP instead of loopback addresses like localhost and 127.0.0.1) to see both requests and responses traced in the Fiddler. If you could use Fiddler to archive two round-trips to the same Jason URL - one for IIS and another for Cassini, you (or us) should be able to tell what is different in where the problem is.

Please let us know what you have found.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest (3)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.