Service not returning Fault when Exception is thrown
Hello,
I have some strange behavioral in my test-services when throwing an exception:
The message handler (DoAHandler) in Service C is throwing an exception, but not sending a fault over the response port. As the handler is marked 'Exclusive', it can never receive any messages again.
See Code:
publicclassTestServiceCService :DsspServiceBase
{
////// _state///privateTestServiceCState _state =newTestServiceCState();////// _main Port///[
ServicePort("/testservicec", AllowMultipleInstances=false)]privateTestServiceCOperations _mainPort =newTestServiceCOperations();////// Default Service Constructor///public TestServiceCService(DsspServiceCreationPort creationPort) :base(creationPort){
}
////// Service Start///protectedoverridevoid Start(){
base.Start(); // Add service specific initialization here.}
[
ServiceHandler(ServiceHandlerBehavior.Exclusive)]publicvirtualIEnumerator<ITask> DoAHandler(DoA doA){
LogInfo(
"Getting call from a, throwing Exception"); thrownewException("Test-Exception");doA.ResponsePort.Post(
DefaultUpdateResponseType.Instance);}
}
The DoAHandler is invoked by demanding the state of Service A (e.g. via the web-browser):
public
classTestServiceAService :DsspServiceBase{
///<summary>/// _state///</summary>privateTestServiceAState _state =newTestServiceAState();///<summary>/// _main Port///</summary>[
ServicePort("/testservicea", AllowMultipleInstances=false)]privateTestServiceAOperations _mainPort =newTestServiceAOperations();[Partner("C", Contract = c.Contract.Identifier, CreationPolicy =PartnerCreationPolicy.UseExistingOrCreate)]
private c.TestServiceCOperations _cPort =new c.TestServiceCOperations();
///<summary>
/// Default Service Constructor///</summary>public TestServiceAService(DsspServiceCreationPort creationPort) :base(creationPort){
}
///<summary>/// Service Start///</summary>protectedoverridevoid Start(){
base.Start(); // Add service specific initialization here.}
[ServiceHandler(ServiceHandlerBehavior.Concurrent)]
publicvirtualIEnumerator<ITask> GetHandler(Get get)
{
yieldreturnArbiter.Choice(
_cPort.DoA(),
delegate(DefaultUpdateResponseType resp)
{
LogInfo("Receifed positive answer from Service C");
},
delegate(Fault f)
{
LogError("Received fault from Service C");
}
);
get.ResponsePort.Post(_state);
yieldbreak;
}
}
The interesting thing is that Service A receives no answer at all!
I also created other services, where an fault is sent back when an exception is thrown, so I have no idea what I have done wrong in this case!
Can someone help?

