public static IEndpointConventionBuilder UseSoapEndpoint <T>(this IEndpointRouteBuilder routes, string path, SoapEncoderOptions[] encoders, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null) { return(routes.UseSoapEndpoint(typeof(T), path, encoders, serializer, caseInsensitivePath, soapModelBounder, null)); }
public static IApplicationBuilder UseSoapEndpoint <T>(this IApplicationBuilder builder, string path, Binding binding, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null) { var element = binding.CreateBindingElements().Find <MessageEncodingBindingElement>(); var factory = element.CreateMessageEncoderFactory(); var encoder = factory.Encoder; return(builder.UseSoapEndpoint <T>(path, encoder, serializer, caseInsensitivePath, soapModelBounder)); }
public SoapEndpointMiddleware(ILogger <SoapEndpointMiddleware> logger, RequestDelegate next, Type serviceType, string path, MessageEncoder encoder, SoapSerializer serializer, bool caseInsensitivePath, ISoapModelBounder soapModelBounder = null) { _logger = logger; _next = next; _endpointPath = path; _messageEncoder = encoder; _serializer = serializer; _pathComparisonStrategy = caseInsensitivePath ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; _service = new ServiceDescription(serviceType); _soapModelBounder = soapModelBounder; }
public static IApplicationBuilder UseSoapEndpoint <T_MESSAGE>(this IApplicationBuilder builder, Type type, string path, Binding binding, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null, WsdlFileOptions wsdlFileOptions = null) where T_MESSAGE : CustomMessage, new() { var elements = binding.CreateBindingElements().FindAll <MessageEncodingBindingElement>(); var encoderOptions = new SoapEncoderOptions[elements.Count]; for (var i = 0; i < encoderOptions.Length; i++) { var encoderOption = new SoapEncoderOptions { MessageVersion = elements[i].MessageVersion, WriteEncoding = Encoding.UTF8, ReaderQuotas = XmlDictionaryReaderQuotas.Max }; if (elements[i] is TextMessageEncodingBindingElement textMessageEncodingBindingElement) { encoderOption.WriteEncoding = textMessageEncodingBindingElement.WriteEncoding; encoderOption.ReaderQuotas = textMessageEncodingBindingElement.ReaderQuotas; } encoderOptions[i] = encoderOption; } return(builder.UseSoapEndpoint <T_MESSAGE>(type, path, encoderOptions, serializer, caseInsensitivePath, soapModelBounder, binding, wsdlFileOptions)); }
public static IApplicationBuilder UseSoapEndpoint <T>(this IApplicationBuilder builder, string path, MessageEncoder encoder, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null) { if (soapModelBounder == null) { return(builder.UseMiddleware <SoapEndpointMiddleware>(typeof(T), path, encoder, serializer, caseInsensitivePath)); } return(builder.UseMiddleware <SoapEndpointMiddleware>(typeof(T), path, encoder, serializer, caseInsensitivePath, soapModelBounder)); }
public static IApplicationBuilder UseSoapEndpoint(this IApplicationBuilder builder, Type type, string path, SoapEncoderOptions encoder, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null, Binding binding = null) { return(builder.UseSoapEndpoint(type, path, new[] { encoder }, serializer, caseInsensitivePath, soapModelBounder, binding)); }
public static IApplicationBuilder UseSoapEndpoint(this IApplicationBuilder builder, Type type, string path, Binding binding, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null) { var elements = binding.CreateBindingElements().FindAll <MessageEncodingBindingElement>(); var encoders = new MessageEncoder[elements.Count]; for (int i = 0; i < encoders.Length; i++) { var factory = elements[i].CreateMessageEncoderFactory(); encoders[i] = factory.Encoder; } return(builder.UseSoapEndpoint(type, path, encoders, serializer, caseInsensitivePath, soapModelBounder, binding)); }
public static IEndpointConventionBuilder UseSoapEndpoint(this IEndpointRouteBuilder routes, Type type, string pattern, SoapEncoderOptions[] encoders, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null, Binding binding = null, WsdlFileOptions wsdlFileOptions = null) { return(UseSoapEndpoint <CustomMessage>(routes, type, pattern, encoders, serializer, caseInsensitivePath, soapModelBounder, binding, wsdlFileOptions)); }
public static IApplicationBuilder UseSoapEndpoint <T, T_MESSAGE>(this IApplicationBuilder builder, string path, SoapEncoderOptions[] encoders, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null) where T_MESSAGE : CustomMessage, new() { return(builder.UseSoapEndpoint <T_MESSAGE>(typeof(T), path, encoders, serializer, caseInsensitivePath, soapModelBounder, null)); }
public static IEndpointConventionBuilder UseSoapEndpoint <T>(this IEndpointRouteBuilder routes, string path, Binding binding, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null, WsdlFileOptions wsdlFileOptions = null) { return(routes.UseSoapEndpoint(typeof(T), path, binding, serializer, caseInsensitivePath, soapModelBounder, wsdlFileOptions: wsdlFileOptions)); }
public static IEndpointConventionBuilder UseSoapEndpoint <T, T_MESSAGE>(this IEndpointRouteBuilder routes, string path, SoapEncoderOptions[] encoders, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null, WsdlFileOptions wsdlFileOptions = null) where T_MESSAGE : CustomMessage, new() { return(routes.UseSoapEndpoint <T_MESSAGE>(typeof(T), path, encoders, serializer, caseInsensitivePath, soapModelBounder, null, wsdlFileOptions)); }
public static IApplicationBuilder UseSoapEndpoint <T>(this IApplicationBuilder builder, string path, SoapEncoderOptions encoder, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null, WsdlFileOptions wsdlFileOptions = null) { return(builder.UseSoapEndpoint(typeof(T), path, new[] { encoder }, serializer, caseInsensitivePath, soapModelBounder, null, wsdlFileOptions)); }
public SoapEndpointMiddleware(ILogger <SoapEndpointMiddleware> logger, RequestDelegate next, Type serviceType, string path, SoapEncoderOptions[] encoderOptions, SoapSerializer serializer, bool caseInsensitivePath, ISoapModelBounder soapModelBounder, Binding binding, bool httpGetEnabled, bool httpsGetEnabled) { _logger = logger; _next = next; _endpointPath = path; _serializer = serializer; _pathComparisonStrategy = caseInsensitivePath ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; _service = new ServiceDescription(serviceType); _soapModelBounder = soapModelBounder; _binding = binding; _httpGetEnabled = httpGetEnabled; _httpsGetEnabled = httpsGetEnabled; _messageEncoders = new SoapMessageEncoder[encoderOptions.Length]; for (var i = 0; i < encoderOptions.Length; i++) { _messageEncoders[i] = new SoapMessageEncoder(encoderOptions[i].MessageVersion, encoderOptions[i].WriteEncoding, encoderOptions[i].ReaderQuotas); } }
public SoapEndpointMiddleware(ILogger <SoapEndpointMiddleware> logger, RequestDelegate next, Type serviceType, string path, MessageEncoder encoder, SoapSerializer serializer, bool caseInsensitivePath, ISoapModelBounder soapModelBounder, Binding binding) : this(logger, next, serviceType, path, new MessageEncoder[] { encoder }, serializer, caseInsensitivePath, soapModelBounder, binding) { }
public static IEndpointConventionBuilder UseSoapEndpoint(this IEndpointRouteBuilder routes, Type type, string pattern, SoapEncoderOptions[] encoders, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null, Binding binding = null) { var options = new SoapOptions { Binding = binding, CaseInsensitivePath = caseInsensitivePath, EncoderOptions = encoders, Path = pattern, ServiceType = type, SoapSerializer = serializer, SoapModelBounder = soapModelBounder }; var pipeline = routes .CreateApplicationBuilder() .UseMiddleware <SoapEndpointMiddleware>(options) .Build(); return(routes.Map(pattern, pipeline) .WithDisplayName("SoapCore")); }
public static IApplicationBuilder UseSoapEndpoint <T_MESSAGE>(this IApplicationBuilder builder, Type type, string path, SoapEncoderOptions[] encoderOptions, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null, Binding binding = null, WsdlFileOptions wsdlFileOptions = null) where T_MESSAGE : CustomMessage, new() { var options = new SoapOptions { Binding = binding, CaseInsensitivePath = caseInsensitivePath, EncoderOptions = encoderOptions, Path = path, ServiceType = type, SoapSerializer = serializer, SoapModelBounder = soapModelBounder, WsdlFileOptions = wsdlFileOptions }; return(builder.UseMiddleware <SoapEndpointMiddleware <T_MESSAGE> >(options)); }
public static IEndpointConventionBuilder UseSoapEndpoint(this IEndpointRouteBuilder routes, Type type, string path, Binding binding, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null) { var elements = binding.CreateBindingElements().FindAll <MessageEncodingBindingElement>(); var encoderOptions = new SoapEncoderOptions[elements.Count]; for (var i = 0; i < encoderOptions.Length; i++) { var encoderOption = new SoapEncoderOptions { MessageVersion = elements[i].MessageVersion, WriteEncoding = Encoding.UTF8, ReaderQuotas = XmlDictionaryReaderQuotas.Max }; if (elements[i] is TextMessageEncodingBindingElement textMessageEncodingBindingElement) { encoderOption.WriteEncoding = textMessageEncodingBindingElement.WriteEncoding; encoderOption.ReaderQuotas = textMessageEncodingBindingElement.ReaderQuotas; } encoderOptions[i] = encoderOption; } return(routes.UseSoapEndpoint(type, path, encoderOptions, serializer, caseInsensitivePath, soapModelBounder, binding)); }
public static IApplicationBuilder UseSoapEndpoint(this IApplicationBuilder builder, Type type, string path, Binding binding, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null, WsdlFileOptions wsdlFileOptions = null) { return(builder.UseSoapEndpoint <CustomMessage>(type, path, binding, serializer, caseInsensitivePath, soapModelBounder, wsdlFileOptions)); }
public static IApplicationBuilder UseSoapEndpoint <T>(this IApplicationBuilder builder, string path, Binding binding, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null) { return(builder.UseSoapEndpoint(typeof(T), path, binding, serializer, caseInsensitivePath, soapModelBounder)); }
public static IApplicationBuilder UseSoapEndpoint(this IApplicationBuilder builder, Type type, string path, MessageEncoder[] encoders, SoapSerializer serializer = SoapSerializer.DataContractSerializer, bool caseInsensitivePath = false, ISoapModelBounder soapModelBounder = null, Binding binding = null) { var options = new SoapOptions { Binding = binding, CaseInsensitivePath = caseInsensitivePath, MessageEncoders = encoders, Path = path, ServiceType = type, SoapSerializer = serializer, SoapModelBounder = soapModelBounder }; return(builder.UseMiddleware <SoapEndpointMiddleware>(options)); }