How to set STATUS CODE to 200 with SoapFaultException?

I am using Glassfish 3 with jax-ws (metro). I am writing a SOAPHandler that can raise a SOAPFaultException. I am using Silverlight on the client side. SOAPFault sets the response code to 500, but Silverlight cannot process it, and it needs to be set to 200. How can I change the status code to 200? If I use client side WPF, all is well.

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

Thank.

Answer:

In the Handler Close method, it works !:

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

+3
source share

Source: https://habr.com/ru/post/1791893/


All Articles