The envelope version of the incoming message (Soap12 (http://www.w3.org/2003/05/soap-envelope)) does not match that of the encoder (Soap11 (http://schemas.xmlsoap.org/soap/envelope/))
See original GitHub issueHi All,
Thanks for your efforts in putting this together. Trying it on a sample project have have run into the above error message. From my searching it appears that “BasicHttpBinding” is related to Soap 1.1 and wsBasicHttpBinding is for SOAP 1.2. By the looks of it, using System.ServiceModel does not support the ws binding.
The error happens at:
var requestMessage = _messageEncoder.ReadMessage(httpContext.Request.Body, 0x10000, httpContext.Request.ContentType);
in SoapEndpointMiddleware.cs
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:17 (6 by maintainers)
Top Results From Across the Web
c# - Issue with service reference
The envelope version of the incoming message (Soap11 (http://schemas.xmlsoap.org/soap/envelope/)) does not match that of the encoder (Soap12 ...
Read more >SOAP 1.2 WSDL · Issue #181 · DigDes/SoapCore
... envelope version of the incoming message (Soap11 (http://schemas.xmlsoap.org/soap/envelope/)) does not match that of the encoder (Soap12 ...
Read more >SOAP response error to source - Forums - Mirth Community
... envelope version of the incoming message (Soap11 (http://schemas.xmlsoap.org/soap/envelope/)) does not match that of the encoder (Soap12 ...
Read more >SOAP Version 1.2 Specification Errata
See Test Collection Errata; Errata for SOAP Version 1.2 schemas. ... xmlns:env="http://www.w3.org/2003/05/soap-envelope"> <env:Header> ...
Read more >SOAP Version 1.2 Part 1: Messaging Framework (Second ...
A normative XML Schema [XML Schema Part 1], [XML Schema Part 2] document for the "http://www.w3.org/2003/05/soap-envelope" namespace can be ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To Add some color into this issue as I’ve seen that it doesn’t seem to support custom binding. Code Example: // create Soap 1.2 Binding TextMessageEncodingBindingElement textBindingElement = new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressing10, System.Text.Encoding.UTF8); HttpTransportBindingElement httpBindingElement = new HttpTransportBindingElement(); httpBindingElement.AllowCookies = true; httpBindingElement.MaxBufferSize = int.MaxValue; httpBindingElement.MaxReceivedMessageSize = int.MaxValue; CustomBinding soap12Binding = new CustomBinding(textBindingElement, httpBindingElement); // service app.UseSoapEndpoint<SoapService>(“/SoapService.svc”, soap12Binding);
Now call that service from a client and the stack trace is… Microsoft.AspNetCore.Server.Kestrel[13] Connection id “0HLBJT99U8TBU”, Request id “0HLBJT99U8TBU:00000001”: An unhandled exception was thrown by the application. System.InvalidOperationException: This message cannot support the operation because it has been read. at System.ServiceModel.Channels.Message.EnsureReadMessageState() at System.ServiceModel.Channels.Message.GetReaderAtBodyContents() at SoapCore.SoapEndpointMiddleware.GetRequestArguments(Message requestMessage, OperationDescription operation, Dictionary`2& outArgs) at SoapCore.SoapEndpointMiddleware.<ProcessOperation>d__7.MoveNext() — End of stack trace from previous location where exception was thrown —
I implemented this kind of binding and now I am getting a different error.
crit: SoapCore.SoapEndpointMiddleware[0] An error occurred when trying to service a request on SOAP endpoint: /myendpoint.asmx System.InvalidOperationException: The body of the message cannot be read because it is empty. at System.ServiceModel.Channels.Message.GetReaderAtBodyContents() at SoapCore.SoapEndpointMiddleware.ProcessOperation(HttpContext httpContext, IServiceProvider serviceProvider) at SoapCore.SoapEndpointMiddleware.Invoke(HttpContext httpContext, IServiceProvider serviceProvider)