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)); }
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)); } }