Beispiel #1
0
        public object DeserializeReply(System.ServiceModel.Channels.Message message, object[] parameters)
        {
            Message msg = RestoreMessageFormBase64Message(message);

            message = msg;
            return(clientFormatter.DeserializeReply(msg, parameters));
        }
Beispiel #2
0
 public object DeserializeReply(Message message, object[] parameters)
 {
     if (message is FakeMessage)
     {
         return(defaultReturnValue);
     }
     return(baseFormatter.DeserializeReply(message, parameters));
 }
Beispiel #3
0
 public object DeserializeReply(Message message, object[] parameters)
 {
     if (_controller != null)
     {
         _controller.Decode(_context, message);
     }
     return(_innerClientFormatter.DeserializeReply(message, parameters));
 }
        object IClientMessageFormatter.DeserializeReply(Message message, object[] parameters)
        {
            var result = _innerClientFormatter.DeserializeReply(message, parameters);

            for (int i = 0; i < parameters.Length; i++)
            {
                parameters[i] = Serializer.DeserializeBytes(parameters[i] as byte[]);
            }
            result = Serializer.DeserializeBytes(result as byte[]);

            return(result);
        }
        public object DeserializeReply(System.ServiceModel.Channels.Message message, object[] parameters)
        {
            object returnObject = null;

            if (_compression && !message.IsEmpty)
            {
                byte[] messageContent = null;

                // Read the reply messages data (with a XmlDictionaryReader) as a base64binary and store in the byte array
                using (XmlDictionaryReader xdr = message.GetReaderAtBodyContents())
                {
                    xdr.ReadStartElement("base64Binary");
                    messageContent = xdr.ReadContentAsBase64();
                }

                MemoryStream contentStream = new MemoryStream();

                // Send the message content byte array and the memory stream for decompression
                Unzip(messageContent, ref contentStream);

                // Reset the streams inner pointer to the start of the stream for deserialization
                contentStream.Seek(0, SeekOrigin.Begin);

                XmlSerializer deserializer = new XmlSerializer(_returnType);

                // Deserialize the stream containing the decompressed reply message data into the return object
                returnObject = deserializer.Deserialize(contentStream);

                contentStream.Dispose();
            }
            else
            {
                // Used defualt deserialization
                returnObject = _baseFormater.DeserializeReply(message, parameters);
            }

            return(returnObject);
        }
Beispiel #6
0
 public object DeserializeReply(Message message, object[] parameters)
 {
     return(_inner.DeserializeReply(message, parameters));
 }
Beispiel #7
0
        internal void AfterReply(ref ProxyRpc rpc)
        {
            if (!_isOneWay)
            {
                Message reply = rpc.Reply;

                if (_deserializeReply)
                {
                    if (WcfEventSource.Instance.ClientFormatterDeserializeReplyStartIsEnabled())
                    {
                        WcfEventSource.Instance.ClientFormatterDeserializeReplyStart(rpc.EventTraceActivity);
                    }

                    rpc.ReturnValue = _formatter.DeserializeReply(reply, rpc.OutputParameters);

                    if (WcfEventSource.Instance.ClientFormatterDeserializeReplyStopIsEnabled())
                    {
                        WcfEventSource.Instance.ClientFormatterDeserializeReplyStop(rpc.EventTraceActivity);
                    }
                }
                else
                {
                    rpc.ReturnValue = reply;
                }

                int offset = _parent.ParameterInspectorCorrelationOffset;
                try
                {
                    for (int i = _parameterInspectors.Length - 1; i >= 0; i--)
                    {
                        _parameterInspectors[i].AfterCall(_name,
                                                          rpc.OutputParameters,
                                                          rpc.ReturnValue,
                                                          rpc.Correlation[offset + i]);
                        if (WcfEventSource.Instance.ClientParameterInspectorAfterCallInvokedIsEnabled())
                        {
                            WcfEventSource.Instance.ClientParameterInspectorAfterCallInvoked(rpc.EventTraceActivity, _parameterInspectors[i].GetType().FullName);
                        }
                    }
                }
                catch (Exception e)
                {
                    if (Fx.IsFatal(e))
                    {
                        throw;
                    }
                    if (ErrorBehavior.ShouldRethrowClientSideExceptionAsIs(e))
                    {
                        throw;
                    }
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperCallback(e);
                }

                if (_parent.ValidateMustUnderstand)
                {
                    Collection <MessageHeaderInfo> headersNotUnderstood = reply.Headers.GetHeadersNotUnderstood();
                    if (headersNotUnderstood != null && headersNotUnderstood.Count > 0)
                    {
                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ProtocolException(SR.Format(SR.SFxHeaderNotUnderstood, headersNotUnderstood[0].Name, headersNotUnderstood[0].Namespace)));
                    }
                }
            }
        }
Beispiel #8
0
 public override object FromMessage(Message message)
 {
     return(formatter.DeserializeReply(message, null));
 }
 public object DeserializeReply(Message message, object[] parameters)
 {
     return(original.DeserializeReply(message, parameters));
 }
Beispiel #10
0
 object IClientMessageFormatter.DeserializeReply(Message message, object[] parameters)
 {
     return(innerClientFormatter.DeserializeReply(message, parameters));
 }
Beispiel #11
0
 public object DeserializeReply(Message message, object[] parameters)
 {
     return(clientMessageFormatter.DeserializeReply(message, parameters));
 }