Exception Shielding problem

Nov 2, 2007 at 7:59 AM
Hi, guys.
We are working on a multi-layer project and use WCF for communication at a certain level. While trying to figure out what's ExceptionShielding about we created a little prototype application where we made some test .....Everything went well and all possible scenarios were covered so we tried to integrate all that into our project. But we got into a problem.The thing is that the reply message just doesn't get back to client app. if operation is not marked with corresponding Fault attribute. While debugging, seems like Exception Handler works as expected...Catches the Exception...Creates a FaultContractWrapperException with correct FaultContractType...creates the reply message .....when exiting last ExceptionShielding method nothing happens.....the client is still waiting for reply and just hangs.....In the prototype application, in the same conditions , the client received a non generic FaultException with Message property mapped correctly....and that 's what we liked.....Can anyone give us some ideas???
Appreciate any help. Thanks.
Nov 2, 2007 at 8:46 AM
Got some new information:
When operation is not market with Fault attribute , HandleError(Exception error) method of ExceptionShieldingErrorHandler class is called twice......and the first time its called 'error' argument is a MessageSecutityException instance with following Message: "No signature message parts were specified for messages with the action"
Feb 1, 2008 at 8:15 PM
I am experiencing this same issue. My Contract seems to be correctly marked with faults. Configuration seems ok. It was working at one time. If I comment out the ExceptionShielding policy and just throw a normal fault exception it works... but if I try an translate an exception to fault using the EMAB it tanks with the error:

System.ServiceModel.Security.MessageSecurityException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

No signature message parts were specified for messages with the 'http://tempuri.org/ITestServiceContract/ThrowServiceFault' action.


Here is the contract im testing with:

ExceptionShielding("ServicePolicy")
ServiceContract
public interface ITestServiceContract
{
OperationContract
string SuccessfulCall();

OperationContract
FaultContract(typeof(ServiceFault))
string ThrowServiceFault();

OperationContract
FaultContract(typeof(ServiceFault))
string ThrowBusinessExceptionToServiceFault();

OperationContract
string ThrowUnhandledException();

}
Jun 18, 2008 at 11:27 PM
Hi,

Can you provide a stand-alone example? How are you hosting your service?

Fernando


jferguson wrote:
I am experiencing this same issue. My Contract seems to be correctly marked with faults. Configuration seems ok. It was working at one time. If I comment out the ExceptionShielding policy and just throw a normal fault exception it works... but if I try an translate an exception to fault using the EMAB it tanks with the error:

System.ServiceModel.Security.MessageSecurityException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

No signature message parts were specified for messages with the 'http://tempuri.org/ITestServiceContract/ThrowServiceFault' action.


Here is the contract im testing with:

ExceptionShielding("ServicePolicy")
ServiceContract
public interface ITestServiceContract
{
OperationContract
string SuccessfulCall();

OperationContract
FaultContract(typeof(ServiceFault))
string ThrowServiceFault();

OperationContract
FaultContract(typeof(ServiceFault))
string ThrowBusinessExceptionToServiceFault();

OperationContract
string ThrowUnhandledException();

}



Jun 27, 2008 at 9:03 PM
Edited Aug 25, 2008 at 6:23 PM
I had the similar issue... What I did was that, I did not update the service reference on the client side after adding follwing on the service interface on the service side. 

[ServiceModel.

FaultContract(typeof(ValidationFault))]

 


Fix: I did update the service reference on the client side to fix it.


It might of help to you...

http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=25236