Beispiel #1
0
        protected override void OnWriteStartEnvelope(XmlDictionaryWriter writer)
        {
            var namespaces = NamespaceManager ?? Namespaces.CreateDefaultXmlNamespaceManager();

            writer.WriteStartDocument();
            var prefix = Version.Envelope.NamespacePrefix(namespaces);

            writer.WriteStartElement(prefix, "Envelope", Version.Envelope.Namespace());
            writer.WriteXmlnsAttribute(prefix, Version.Envelope.Namespace());

            var xsdPrefix = Namespaces.AddNamespaceIfNotAlreadyPresentAndGetPrefix(namespaces, "xsd", Namespaces.XMLNS_XSD);

            writer.WriteXmlnsAttribute(xsdPrefix, Namespaces.XMLNS_XSD);

            var xsiPrefix = Namespaces.AddNamespaceIfNotAlreadyPresentAndGetPrefix(namespaces, "xsi", Namespaces.XMLNS_XSI);

            writer.WriteXmlnsAttribute(xsiPrefix, Namespaces.XMLNS_XSI);
        }
Beispiel #2
0
        public SoapEndpointMiddleware(ILogger <SoapEndpointMiddleware <T_MESSAGE> > logger, RequestDelegate next, SoapOptions options)
        {
            _logger                 = logger;
            _next                   = next;
            _options                = options;
            _endpointPath           = options.Path;
            _serializer             = options.SoapSerializer;
            _serializerHelper       = new SerializerHelper(_serializer);
            _pathComparisonStrategy = options.CaseInsensitivePath ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
            _service                = new ServiceDescription(options.ServiceType);
            _soapModelBounder       = options.SoapModelBounder;
            _binding                = options.Binding;
            _httpGetEnabled         = options.HttpGetEnabled;
            _httpsGetEnabled        = options.HttpsGetEnabled;
            _xmlNamespaceManager    = options.XmlNamespacePrefixOverrides ?? Namespaces.CreateDefaultXmlNamespaceManager();
            Namespaces.AddDefaultNamespaces(_xmlNamespaceManager);

            _messageEncoders = new SoapMessageEncoder[options.EncoderOptions.Length];

            for (var i = 0; i < options.EncoderOptions.Length; i++)
            {
                _messageEncoders[i] = new SoapMessageEncoder(options.EncoderOptions[i].MessageVersion, options.EncoderOptions[i].WriteEncoding, options.EncoderOptions[i].ReaderQuotas, options.OmitXmlDeclaration, options.IndentXml);
            }
        }