JavaFX 2 - ObservableList<Message> to TableView - tableview

Hope I will get my question as clear as possible. I am working on a small java application using the JavaFX library for the gui. am doing a POP Connection and storing Messages as ObservableList. For this I am using javax.mail. I am passing this observablelist to a tableview and with the following i am passing the required values to the TableColumns:
fromColumn.setCellValueFactory(
new PropertyValueFactory<Message,String>("from")
);
subjectColumn.setCellValueFactory(
new PropertyValueFactory<Message,String>("subject")
);
dateColumn.setCellValueFactory(
new PropertyValueFactory<Message,String>("sentDate")
);
Subject and sentDate are beeing read-in perfectly. But unfortunately "from" is adding object-references to TableColumn, since the From-Attribute in the Message-Class is a InternetAdress-Object and its toString()-method isnt returning a string but probably a reference. And the result is the follwoing being shown in fromColumn:
[Ljavax.mail.internet.InternetAddress;#3596cd38
Anybody knows the solution how I could get the String-Value of the InternetAdress being showed in the mentioned Column?
Thanks in Advance

I think you need to define a custom cell value factory to get at the address information in the format you need rather than using the PropertyValueFactory.
The following sample is for a read only table - if the message data in the table needs to be editable, then the solution will be significantly more complicated.
fromColumn.setCellValueFactory(new Callback<CellDataFeatures<Message, String>, ObservableValue<String>>() {
#Override public ObservableValue<String> call(CellDataFeatures<Message, String> m) {
// m.getValue() returns the Message instance for a particular TableView row
return new ReadOnlyObjectWrapper<String>(Arrays.toString(m.getValue().getFrom()));
}
});
Here is an executable sample (plus sample data files) which demonstrate use of the custom cell value factory. Place the sample data files in the same directory as the application java program and ensure your build system copies the sample files to the build output directory which contains the compiled class file for the application. You will need the javamail jar files on your path to compile and run the application.
import java.io.*;
import java.util.Arrays;
import java.util.logging.*;
import javafx.application.Application;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.beans.value.ObservableValue;
import javafx.collections.*;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.control.TableColumn.CellDataFeatures;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import javafx.util.Callback;
import javax.mail.*;
import javax.mail.internet.MimeMessage;
public class MailTableSample extends Application {
private TableView<Message> table = new TableView<Message>();
public static void main(String[] args) { launch(args);}
#Override public void start(Stage stage) {
stage.setTitle("Table View Sample");
final Label label = new Label("Mail");
label.setFont(new Font("Arial", 20));
table.setEditable(false);
TableColumn subjectColumn = new TableColumn("Subject");
subjectColumn.setMinWidth(100);
subjectColumn.setCellValueFactory(
new PropertyValueFactory<Message, String>("subject")
);
TableColumn sentDate = new TableColumn("Sent");
sentDate.setMinWidth(100);
sentDate.setCellValueFactory(
new PropertyValueFactory<Message, String>("sentDate")
);
TableColumn fromColumn = new TableColumn("From");
fromColumn.setMinWidth(200);
fromColumn.setCellValueFactory(new Callback<CellDataFeatures<Message, String>, ObservableValue<String>>() {
#Override public ObservableValue<String> call(CellDataFeatures<Message, String> m) {
try {
// m.getValue() returns the Message instance for a particular TableView row
return new ReadOnlyObjectWrapper<String>(Arrays.toString(m.getValue().getFrom()));
} catch (MessagingException ex) {
Logger.getLogger(MailTableSample.class.getName()).log(Level.SEVERE, null, ex);
return null;
}
}
});
table.setItems(fetchMessages());
table.getColumns().addAll(fromColumn, subjectColumn, sentDate);
table.setPrefSize(600, 200);
final VBox vbox = new VBox();
vbox.setSpacing(5);
vbox.setPadding(new Insets(10));
vbox.getChildren().addAll(label, table);
stage.setScene(new Scene(vbox));
stage.show();
}
private ObservableList<Message> fetchMessages() {
ObservableList<Message> messages = FXCollections.observableArrayList();
try {
Session session = Session.getDefaultInstance(System.getProperties());
for (int i = 0; i < 3; i++) {
InputStream mboxStream = new BufferedInputStream(
getClass().getResourceAsStream("msg_" + (i+1) + ".txt")
);
Message message = new MimeMessage(session, mboxStream);
messages.add(message);
}
} catch (MessagingException ex) {
Logger.getLogger(MailTableSample.class.getName()).log(Level.SEVERE, null, ex);
}
return messages;
}
}
msg_1.txt
From cras#irccrew.org Tue Jul 23 19:39:23 2002
Received: with ECARTIS (v1.0.0; list dovecot); Tue, 23 Jul 2002 19:39:23 +0300 (EEST)
Return-Path: <cras#irccrew.org>
Delivered-To: dovecot#procontrol.fi
Received: from shodan.irccrew.org (shodan.irccrew.org [80.83.4.2])
by danu.procontrol.fi (Postfix) with ESMTP id 434B423848
for <dovecot#procontrol.fi>; Tue, 23 Jul 2002 19:39:23 +0300 (EEST)
Received: by shodan.irccrew.org (Postfix, from userid 6976)
id 175FA4C0A0; Tue, 23 Jul 2002 19:39:23 +0300 (EEST)
Date: Tue, 23 Jul 2002 19:39:23 +0300
From: Timo Sirainen <tss#iki.fi>
To: dovecot#procontrol.fi
Subject: [dovecot] first test mail
Message-ID: <20020723193923.J22431#irccrew.org>
Mime-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
Content-Type: text/plain; charset=us-ascii
X-archive-position: 1
X-ecartis-version: Ecartis v1.0.0
Sender: dovecot-bounce#procontrol.fi
Errors-to: dovecot-bounce#procontrol.fi
X-original-sender: tss#iki.fi
Precedence: bulk
X-list: dovecot
X-IMAPbase: 1096038620 0000010517
X-UID: 1
Status: O
lets see if it works
msg_2.txt
From cras#irccrew.org Mon Jul 29 02:17:12 2002
Received: with ECARTIS (v1.0.0; list dovecot); Mon, 29 Jul 2002 02:17:12 +0300 (EEST)
Return-Path: <cras#irccrew.org>
Delivered-To: dovecot#procontrol.fi
Received: from shodan.irccrew.org (shodan.irccrew.org [80.83.4.2])
by danu.procontrol.fi (Postfix) with ESMTP id 8D21723848
for <dovecot#procontrol.fi>; Mon, 29 Jul 2002 02:17:12 +0300 (EEST)
Received: by shodan.irccrew.org (Postfix, from userid 6976)
id 8BAD24C0A0; Mon, 29 Jul 2002 02:17:11 +0300 (EEST)
Date: Mon, 29 Jul 2002 02:17:11 +0300
From: John Smith <jsmithspam#yahoo.com>
To: dovecot#procontrol.fi
Subject: [dovecot] Dovecot 0.93 released
Message-ID: <20020729021711.W22431#irccrew.org>
Mime-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
Content-Type: text/plain; charset=us-ascii
X-archive-position: 2
X-ecartis-version: Ecartis v1.0.0
Sender: dovecot-bounce#procontrol.fi
Errors-to: dovecot-bounce#procontrol.fi
X-original-sender: tss#iki.fi
Precedence: bulk
X-list: dovecot
X-UID: 2
Status: O
First alpha quality release, everything critical is now implemented. From
now on it's mostly stabilization and optimization. Features that can't break
existing code could still be added, especially SSL and authentication stuff.
msg_3.txt
From cras#irccrew.org Wed Jul 31 22:48:41 2002
Received: with ECARTIS (v1.0.0; list dovecot); Wed, 31 Jul 2002 22:48:41 +0300 (EEST)
Return-Path: <cras#irccrew.org>
Delivered-To: dovecot#procontrol.fi
Received: from shodan.irccrew.org (shodan.irccrew.org [80.83.4.2])
by danu.procontrol.fi (Postfix) with ESMTP id F141123829
for <dovecot#procontrol.fi>; Wed, 31 Jul 2002 22:48:40 +0300 (EEST)
Received: by shodan.irccrew.org (Postfix, from userid 6976)
id 42ED44C0A0; Wed, 31 Jul 2002 22:48:40 +0300 (EEST)
Date: Wed, 31 Jul 2002 22:48:39 +0300
From: Timo Sirainen <tss#iki.fi>
To: dovecot#procontrol.fi
Subject: [dovecot] v0.95 released
Message-ID: <20020731224839.H22431#irccrew.org>
Mime-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
Content-Type: text/plain; charset=us-ascii
X-archive-position: 3
X-ecartis-version: Ecartis v1.0.0
Sender: dovecot-bounce#procontrol.fi
Errors-to: dovecot-bounce#procontrol.fi
X-original-sender: tss#iki.fi
Precedence: bulk
X-list: dovecot
X-UID: 3
Status: O
v0.95 2002-07-31 Timo Sirainen <tss#iki.fi>
+ Initial SSL support using GNU TLS, tested with v0.5.1.
TLS support is still missing.
+ Digest-MD5 authentication method
+ passwd-file authentication backend
+ Code cleanups
- Found several bugs from mempool and ioloop code, now we should
be stable? :)
- A few corrections for long header field handling
Sample program output:

This is a Java 8 version of jewelsea's solution but in awesome lambdas:
fromColumn.setCellValueFactory(m -> {
// m.getValue() returns the Message instance for a particular TableView row
return new ReadOnlyObjectWrapper<String>(Arrays.toString(m.getValue().getFrom()));
}
});
Lol, gotta love lambdas

Using the above mentioned solution, wether I use it as it is or I accept the advices of Eclipse i add a try/catch and a further return value, which looks like this at the end:
fromColumn.setCellValueFactory(new Callback<CellDataFeatures<Message, String>, ObservableValue<String>>() {
public ObservableValue<String> call(CellDataFeatures<Message, String> m) {
// m.getValue() returns the Message instance for a particular TableView row
try {
return new ReadOnlyObjectWrapper<String>(Arrays.toString(m.getValue().getFrom()));
} catch (MessagingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
});
The result is the same, I am getting a (visual) empty tableview. This means that even the tablecolumns are empty using this setCellFactury()-solution. Well, as workaround I could define a class where I could store al the three values as a String and then pass it to setCellValueFactory() using PropertyValueFactory, but I hope to get it done properly.
Any further advices?
best regards

Related

Selenide. download() returns FileNotFoundException: Failed to download file

I want to check downloading a file using Selenide download() method, but catch FileNotFoundException and error 'Intercepted 1 responses', though file was downloaded.
I have button, click on which results in downloading a zip file. Element doesn't have href attribute.
I use Selenide 5.0.0, chromdriver.exe 2.43
I have following settings
Configuration.proxyEnabled = true;
Configuration.fileDownload = FileDownloadMode.PROXY;
Following code invoke error
public static SelenideElement actionButton() {return $(By.xpath("//div[#class='task-list_container_scroll-view']/div[1]/div[#class='ng-star-inserted'][1]//common-task-view//span[#role='button']"));}
File file = actionButton().download(10000);
java.io.FileNotFoundException: Failed to download file {By.xpath:
//div[#class='task-list_container_scroll-view']/div[1]/div[#class='ng-star-inserted'][1]//common-task-view//span[#role='button']}
in 10000 ms.Intercepted 1 responses. 200 "" {Server=nginx/1.13.12,
Cache-Control=private, Access-Control-Allow-Origin=*,
Access-Control-Allow-Methods=POST, GET, OPTIONS, DELETE, PUT,
Connection=keep-alive, Expires=Thu, 01 Jan 1970 00:00:00 GMT,
Access-Control-Max-Age=3600,
X-Application-Context="frontend":staging:80, Content-Length=1271853,
Date=Wed, 31 Oct 2018 12:41:32 GMT,
Access-Control-Allow-Headers=Content-Type, x-requested-with,
X-Custom-Header, accept, authorization} application/octet-stream
(1202830 bytes)
at com.codeborne.selenide.impl.DownloadFileWithProxyServer.firstDownloadedFile(DownloadFileWithProxyServer.java:94)
at
com.codeborne.selenide.impl.DownloadFileWithProxyServer.clickAndInterceptFileByProxyServer(DownloadFileWithProxyServer.java:49)
at
com.codeborne.selenide.impl.DownloadFileWithProxyServer.download(DownloadFileWithProxyServer.java:33)
at
com.codeborne.selenide.commands.DownloadFile.execute(DownloadFile.java:51)
at
com.codeborne.selenide.commands.DownloadFile.execute(DownloadFile.java:18)
at
com.codeborne.selenide.commands.Commands.execute(Commands.java:144)
at
com.codeborne.selenide.impl.SelenideElementProxy.dispatchAndRetry(SelenideElementProxy.java:99)
at
com.codeborne.selenide.impl.SelenideElementProxy.invoke(SelenideElementProxy.java:65)
at com.sun.proxy.$Proxy11.download(Unknown Source)
you should use try catch because of your project setting, use this:
try {
$("selector").download();
}catch(FileNotFoundException e){}
Try this:
Configuration.fileDownload = FileDownloadMode.FOLDER;

Laravel 5.4 Mailables adding email addresses together

Consider this sample of code that takes an array of addresses and sends each of them an email using the mailables feature.
//In my controller
$email = new EmailToWinners($sender_name, $letter);
foreach ($recipients as $recipient){
Mail::to($recipient)->send($email);
}
//In my App\Mail\EmailToWinner
public function build()
{
return $this->view('emails.winner-email');
}
The emails all get sent fine but when I was testing this I noticed, it's stacking the emails up.
So I get this in the logs.
[2017-02-16 15:58:59] local.DEBUG: Message-ID: <250443348fee18f568f4f263153d5101#testing.dev>
Date: Thu, 16 Feb 2017 15:58:59 +0000
Subject: Email To Winner
From: Example Dev <example#me.dev>
To: 1#example.com
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
[2017-02-16 15:58:59] local.DEBUG: Message-ID: <1b5f39ef0cc17d4d8573019f3d5ec808#testing.dev>
Date: Thu, 16 Feb 2017 15:58:59 +0000
Subject: Email To Winner
From: Example Dev <example#me.dev>
To: 1#example.com, 2#example.com
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
[2017-02-16 15:58:59] local.DEBUG: Message-ID: <ddf6c62a7f881f9381693435b48ef5a3#testing.dev>
Date: Thu, 16 Feb 2017 15:58:59 +0000
Subject: Email To Winner
From: Example Dev <example#me.dev>
To: 1#example.com, 2#example.com, 3#example.com
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
If you look at the emails. The first email shows to
1#example.com
The second shows to
1#example.com, 2#example.com
The third shows 1#example.com, 2#example.com, 3#example.com
So the first person gets 3 emails.
What am I doing wrong?
You can pass to to method a collection of users:
Mail::to($recipients)->send(new EmailToWinners());
From Lavavel Mail Docs:
The to method accepts an email address, a user instance, or a collection of users. If you pass an object or collection of objects, the mailer will automatically use their email and name properties when setting the email recipients, so make sure these attributes are available on your objects
I think you need to make a new email object for each recipient like this.
foreach ($recipients as $recipient){
Mail::to('$recipient')->send(new EmailToWinners($sender_name, $letter));
}

Email delivery (spam?) - Email not received with some ISP emails

I'm having a problem with some emails not being delivered with some ISP email address
Common email example reported by users : "xx#free.fr", "#bellsouth.net"
I don't really have a way to "test" why they don't get the emails. I told them to verify spam folder and they aren't there.. I have test account for popular email service "gmail, hotmail" and they work fine.
The emails I'm sending are common emails from my domain website (registration, confirm account, forgot password). I don't send any bulk email. I'm using goDaddy as hosting service.
I have set up SPF on my domain, and the email are sent with PHP(codeIgniter) - See bottom for how the mail is sent with code
Here is an example of mail that I sent that is blocked by theses ISP:
Delivered-To: tdfdestgmfdsailmaxmt123okdddf3#gmail.com
Received: by 10.112.159.166 with SMTP id xd6csp1482168lbb;
Wed, 17 Dec 2014 10:27:57 -0800 (PST)
X-Received: by 10.50.61.238 with SMTP id t14mr9680303igr.34.1418840877015;
Wed, 17 Dec 2014 10:27:57 -0800 (PST)
Return-Path: <admin#maximumtrainer.com>
Received: from p3nlsmtpcp01-03.prod.phx3.secureserver.net (p3nlsmtpcp01-03.prod.phx3.secureserver.net. [184.168.200.142])
by mx.google.com with ESMTP id hh16si4059486icb.62.2014.12.17.10.27.56
for <tdfdestgmfdsailmaxmt123okdddf3#gmail.com>;
Wed, 17 Dec 2014 10:27:56 -0800 (PST)
Received-SPF: pass (google.com: domain of admin#maximumtrainer.com designates 184.168.200.142 as permitted sender) client-ip=184.168.200.142;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of admin#maximumtrainer.com designates 184.168.200.142 as permitted sender) smtp.mail=admin#maximumtrainer.com
Received: from p3plcpnl0063.prod.phx3.secureserver.net ([184.168.200.112])
by p3nlsmtpcp01-03.prod.phx3.secureserver.net with : CPANEL :
id UiR51p01s2S0Aj401iR5yP; Wed, 17 Dec 2014 11:25:05 -0700
Received: from p3plcpnl0063.prod.phx3.secureserver.net ([184.168.200.112]:34603 helo=maximumtrainer.com)
by p3plcpnl0063.prod.phx3.secureserver.net with esmtpa (Exim 4.84)
(envelope-from <admin#maximumtrainer.com>)
id 1Y1JKF-0001bp-W0
for tdfdestgmfdsailmaxmt123okdddf3#gmail.com; Wed, 17 Dec 2014 11:27:56 -0700
User-Agent: CodeIgniter
Date: Wed, 17 Dec 2014 18:27:55 +0000
From: "Maximum Trainer" <admin#maximumtrainer.com>
To: tdfdestgmfdsailmaxmt123okdddf3#gmail.com
Subject: =?utf-8?Q?Bienvenue?=
Reply-To: "admin#maximumtrainer.com" <admin#maximumtrainer.com>
X-Sender: admin#maximumtrainer.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <5491cb2be1fa8#maximumtrainer.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - p3plcpnl0063.prod.phx3.secureserver.net
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - maximumtrainer.com
X-Get-Message-Sender-Via: p3plcpnl0063.prod.phx3.secureserver.net: authenticated_id: admin#maximumtrainer.com
X-Source:
X-Source-Args:
X-Source-Dir:
CodeIgniter sender function:
function send_confirmation_mail($email, $first_name, $confirm_code) {
$CI =& get_instance();
$CI->load->library('email'); // load library
$CI->email->from ( 'admin#maximumtrainer.com', 'Maximum Trainer' );
$CI->email->to ( $email );
$CI->email->subject ( lang('email_activate_title') );
$link = base_url(). index_page(). lang('url_confirm_user'). "/". $confirm_code;
$message = lang('email_hello'). $first_name. ", \r\n".
lang('email_activate_thank_you'). "\r\n\r\n".
lang('email_activate_click_link'). "\r\n".
$link. "\r\n\r\n".
lang('email_activate_farewwell'). "\r\n".
lang('email_linkMT');
$CI->email->message( $message );
if ( ! $CI->email->send()) {
$CI->messages->add("error send_confirmation_mail", "error");
return false;
}
return true;
}
Server config :
$config['useragent'] = 'CodeIgniter';
$config['protocol'] = 'smtp';
#$config['mailpath'] = '/usr/sbin/sendmail';
$config['smtp_host'] = 'p3plcpnl0063.prod.phx3.secureserver.net';
$config['smtp_user'] = 'yyyyyy#maximumtrainer.com';
$config['smtp_pass'] = 'xxxxxxx';
$config['smtp_port'] = 25; #465 to test doesnt seem to work
$config['smtp_timeout'] = 5;
$config['wordwrap'] = FALSE;
$config['wrapchars'] = 76;
$config['mailtype'] = 'text';
$config['charset'] = 'utf-8';
$config['validate'] = FALSE;
$config['priority'] = 3;
$config['crlf'] = "\r\n";
$config['newline'] = "\r\n";
$config['bcc_batch_mode'] = FALSE;
$config['bcc_batch_size'] = 200;
Are there any services to diagnose what could be the cause of the problem? I can't register for free with these email providers in order to test.

How to prevent pdf cache all browsers?

Even when the physical path is filled out on the navigation bar of all browsers it's showing a cached file.
The PROBLEM(with big letters because it's a big problem for us now) is that I already has cleared the client browser cache through a remote connection and I also already has applied a recycle on server application pool, but I'm still facing the same old problem :/ Someone facing something similar?
The following list include the actions applied until now that has not solved the problem:
01 - Response header:
protected override void OnActionExecuting(ActionExecutingContext filterContext)
{
filterContext.RequestContext.HttpContext.Response.ClearHeaders();
filterContext.RequestContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache);
filterContext.RequestContext.HttpContext.Response.Cache.AppendCacheExtension("no-store, must-revalidate");
filterContext.RequestContext.HttpContext.Response.AppendHeader("Pragma", "no-cache");
filterContext.RequestContext.HttpContext.Response.AppendHeader("Expires", "0");
filterContext.RequestContext.HttpContext.Response.AppendHeader("Last-Modified", "Wed, 08 Jan 2014 15:39:15 GMT");
filterContext.RequestContext.HttpContext.Response.AppendHeader("If-Modified-Since", "Tue, 07 Jan 2014 15:39:15 GMT");
base.OnActionExecuting(filterContext);
}
02 - Data annotation:
[OutputCache(NoStore = true, Duration = 0, Location = OutputCacheLocation.None, VaryByParam = "none")]
public ActionResult Avaliacao(int id)
{...
}
03 - Timestamp:
var _contents = memStream.GetBuffer();
memStream.Close();
return File(_contents, "application/pdf",
"RelatorioMensal-" + participante.Numero.GetValueOrDefault().ToString("00000") + "-" +
lote.Id.ToString("0000") + "-" + DateTime.Now.Ticks.ToString() + ".pdf");
04 - Application pool recycling
05 - Cache rule filter for .pdf files on IIS set to Prevent all caching
06 - Output cache setting: Enable cache and Enable kernel cache unchecked for testing purposes
07 - Clear cache through the code:
OutputCacheAttribute.ChildActionCache = new MemoryCache("NewDefault");
Ps.: I'm a MCSD - Web applications but don't tell it to anyone until I get this "simple" problem solved. Thanks ;)

Can't specify StatusMessage in HttpStatusCodeResult

I have the following Controller method.
public ActionResult Save(IEnumerable<Model> models)
{
try
{
SaveModels(models);
}
catch (ApplicationException ex)
{
return new HttpStatusCodeResult(500, "error");
}
return new EmptyResult();
}
This will always return "Internal Server Error" as HTTP status description, no matter what message I give to the constructor.
Fiddler output:
HTTP/1.1 500 Internal Server Error
Server: ASP.NET Development Server/10.0.0.0
Date: Tue, 12 Apr 2011 12:44:09 GMT
X-AspNet-Version: 4.0.30319
X-AspNetMvc-Version: 3.0
Cache-Control: private
Content-Length: 0
Connection: Close
If I change the Status Code to 501 I get Not Implemented over the wire, same with 200 OK. And if I select a non-existant status code, like 535 it will just return the status code without any description. I can't see that I'm doing anything wrong according to the documentation and examples I've found from other people using this .
Can anyone see what I'm doing wrong?
I just had the same issue and based on #Mikael's comment, I tried deploying my application to an actual IIS server, and yes, you can specify the actual Status Description and it will be returned to the client side.
Why is it different with Cassini, I'm not really sure about.

Resources