Exemplo n.º 1
0
        private SerializerProvider()
        {
            _serializers = new Dictionary <string, ISerializer>();
            var soapSerializer = new SoapEnvelopeSerializer();

            _serializers.Add(Constants.ContentTypes.Soap, soapSerializer);
            _serializers.Add(Constants.ContentTypes.Mime, new MimeMessageSerializer(soapSerializer));
        }
Exemplo n.º 2
0
        private static T SerializeToSoapEnvelope <T>(
            AS4Message message,
            CancellationToken cancellation,
            Func <MemoryStream, T> handling)
        {
            using (var messageStream = new MemoryStream())
            {
                var serializer = new SoapEnvelopeSerializer();
                serializer.Serialize(message, messageStream, cancellation);

                return(handling(messageStream));
            }
        }