3

I use Glassfish 3 with jax-ws (metro). I write a SOAPHandler which can throw SOAPFaultException. I use Silverlight on the client side. SOAPFault set response code to 500, but Silverlight can't handle it, and it need to be set 200. How can I change the status code to 200? If I use WPF in the client side everything is good.

Here is the solution for WCF: http://msdn.microsoft.com/en-us/library/ee844556(v=vs.95).aspx but it not help...

Thanks.

Answer:

In Handler Close method it's works!:

context.put(MessageContext.HTTP_RESPONSE_CODE, new Integer(200)); context.setScope(MessageContext.HTTP_RESPONSE_CODE, MessageContext.Scope.APPLICATION);

OneTwo
  • 31
  • 4
  • In Handler Close method it's works!: context.put(MessageContext.HTTP_RESPONSE_CODE, new Integer(200)); context.setScope(MessageContext.HTTP_RESPONSE_CODE, MessageContext.Scope.APPLICATION); – OneTwo Feb 14 '11 at 08:22
  • Plus information: In visual studio Debug menu in Exception you should uncheck System.ServiceModel FaultException and FaultException'1 than you can check exceptions in e.Error in completed delegates. – OneTwo Feb 14 '11 at 18:06

1 Answers1

0

I found that this answer helped me: http://mark.mymonster.nl/2011/02/10/make-use-of-wcf-faultcontracts-in-silverlight-clients/

Dave
  • 41
  • 3
  • Yes I know how can solve this problem in WCF, but I talked about jax-ws. On the comments a I wrote down the solution! – OneTwo Feb 15 '11 at 19:36