public void ProvideFault(Exception error, NDceRpc.ServiceModel.Channels.MessageVersion version, ref NDceRpc.ServiceModel.Channels.Message fault) { if (!HandleError(error)) { return; } var serializer = new NetDataContractSerializer(); var stream = new MemoryStream(); serializer.Serialize(stream, error); stream.Position = 0; fault.Fault.Detail = stream.ToArray(); }
public void AfterReceiveReply(ref NDceRpc.ServiceModel.Channels.Message reply, object correlationState) { var stream = new MemoryStream(reply.Fault.Detail); var serializer = new NetDataContractSerializer(); var exeption = (Exception)serializer.Deserialize(stream); throw exeption; }
//public CallbackServiceHost(Type service, Uri baseAddress,) // : this(Activator.CreateInstance(service), baseAddress.ToString()) //{ // //TODO: make it not singleton //} public CallbackServiceHost(InstanceContext serviceCtx, Uri baseAddress, NDceRpc.ServiceModel.CallbackBehaviorAttribute behaviour) : this(serviceCtx, baseAddress.ToString(), behaviour) { }