Comments (3)
This is something related to the SOAP message processing/validation.
What makes the error happen is the SOAP message with the default namespace defined e.g.
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:int="..." **xmlns=**"...">
and content like
<soap:Header/>
<soap:Body>
<int:x>
<int:y>
**<z></z>**
as soon as I change the message to
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:int="..." **xmlns:mes=**"...">
<soap:Header/>
<soap:Body>
<int:x>
<int:y>
**<mes:z></mes:z>**
it gets processed successfully.
Although was not able to reproduce in a project created from scratch based on CoreWCF template.
from corewcf.
I'm running into this as well with Onvif messages:
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetCapabilities xmlns="http://www.onvif.org/ver10/device/wsdl">
<Category>All</Category>
</GetCapabilities>
</s:Body>
</s:Envelope>
CoreWCF fails with:
System.ObjectDisposedException: 'Message is closed.'
> CoreWCF.Primitives.dll!CoreWCF.Channels.BufferedMessage.Properties.get() Line 1615 C#
CoreWCF.Http.dll!CoreWCF.Channels.AspNetCoreReplyChannel.HandleRequest(Microsoft.AspNetCore.Http.HttpContext context) Line 127 C#
CoreWCF.Http.dll!CoreWCF.Channels.RequestDelegateHandler.HandleRequest(Microsoft.AspNetCore.Http.HttpContext context) Line 125 C#
CoreWCF.Http.dll!CoreWCF.Channels.ServiceModelHttpMiddleware.InvokeAsync(Microsoft.AspNetCore.Http.HttpContext context) Line 49 C#
CoreWCF.Primitives.dll!CoreWCF.Channels.MetadataMiddleware.BuildBranch.AnonymousMethod__2(Microsoft.AspNetCore.Http.HttpContext reqContext) Line 103 C#
CoreWCF.Primitives.dll!CoreWCF.Channels.MetadataMiddleware.InvokeAsync(Microsoft.AspNetCore.Http.HttpContext context) Line 53 C#
Microsoft.AspNetCore.Diagnostics.dll!Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(Microsoft.AspNetCore.Http.HttpContext context) Unknown
Microsoft.AspNetCore.HostFiltering.dll!Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware.Invoke(Microsoft.AspNetCore.Http.HttpContext context) Unknown
Microsoft.WebTools.BrowserLink.Net.dll!Microsoft.WebTools.BrowserLink.Net.BrowserLinkMiddleware.InvokeAsync(Microsoft.AspNetCore.Http.HttpContext context) Unknown
Microsoft.WebTools.BrowserLink.Net.dll!Microsoft.WebTools.BrowserLink.Net.VsContentMiddleware.InvokeAsync(Microsoft.AspNetCore.Http.HttpContext context) Unknown
Microsoft.AspNetCore.Watch.BrowserRefresh.dll!Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware.InvokeAsync(Microsoft.AspNetCore.Http.HttpContext context) Unknown
Microsoft.AspNetCore.Server.Kestrel.Core.dll!Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests<Microsoft.AspNetCore.Hosting.HostingApplication.Context>(Microsoft.AspNetCore.Hosting.Server.IHttpApplication<Microsoft.AspNetCore.Hosting.HostingApplication.Context> application) Unknown
Microsoft.AspNetCore.Server.Kestrel.Core.dll!Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequestsAsync<Microsoft.AspNetCore.Hosting.HostingApplication.Context>(Microsoft.AspNetCore.Hosting.Server.IHttpApplication<Microsoft.AspNetCore.Hosting.HostingApplication.Context> application) Unknown
Microsoft.AspNetCore.Server.Kestrel.Core.dll!Microsoft.AspNetCore.Server.Kestrel.Core.Internal.HttpConnection.ProcessRequestsAsync<Microsoft.AspNetCore.Hosting.HostingApplication.Context>(Microsoft.AspNetCore.Hosting.Server.IHttpApplication<Microsoft.AspNetCore.Hosting.HostingApplication.Context> httpApplication) Unknown
Microsoft.AspNetCore.Server.Kestrel.Core.dll!Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.KestrelConnection<Microsoft.AspNetCore.Connections.ConnectionContext>.ExecuteAsync() Unknown
Microsoft.AspNetCore.Server.Kestrel.Core.dll!Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.KestrelConnection<System.__Canon>.System.Threading.IThreadPoolWorkItem.Execute() Unknown
I'm using the sample app from this repo with WsHttpBinding (needed for Soap 1.2) and Onvif generated from WSDL using svcutil.exe -sc.
from corewcf.
So in my case, it turned out I was using incorrect binding:
var binding = new WSHttpBinding(SecurityMode.None);
binding.Security.Message.ClientCredentialType = MessageCredentialType.None;
I fixed it by using the following which also works on the client side:
var httpTransportBinding = new HttpTransportBindingElement
{
AuthenticationScheme = AuthenticationSchemes.Anonymous
};
var textMessageEncodingBinding = new TextMessageEncodingBindingElement
{
MessageVersion = MessageVersion.CreateVersion(EnvelopeVersion.Soap12, AddressingVersion.None)
};
var binding = new CustomBinding(textMessageEncodingBinding, httpTransportBinding);
from corewcf.
Related Issues (20)
- Starting with Release 1.6.0-alpha.14, getting an error at app.UseServiceModel
- [Bug]: IEndpointBehavior.AddBindingParameters not called when registered in AddServiceEndpoint's configureEndpoint method HOT 1
- [Bug]: CoreWCF.WebHttp 1.5.2 nuget missing HOT 1
- [Bug]: "AWAIT_TIME" of 23 Seconds during the execution of ConcurrencyBehavior.LockInstanceAsync method of CoreWCF.primitives HOT 5
- CoreWCF application takes > 10 seconds to exit when running on Linux HOT 4
- [Bug]: CoreWCF.ProtocolException: Content Type application/soap+xml; charset=utf-8 was sent to a service expecting text/xml; charset=utf-8. The client and service bindings may be mismatched. HOT 8
- [Bug]: Logging missing information HOT 3
- Add Core WCF to a existing MVC application. HOT 1
- [Bug]: Reference newer Nuget Microsoft.Extensions.Caching.Memory breaks Tcp-Server HOT 6
- [Bug]: Support reading messageType attribute for basicHttpBinding in config xml HOT 3
- [Bug]: CoreWCF.NetTcp.Tests.TransportFrameworkTests.RemoteEndpointMessageProperty test can fail due to concurrent tests running
- TestContainers integration
- [Bug]: GetMsmqFormatQueueName() fails for queue names containing a slash HOT 2
- ValidateMustUnderstand property is missed in ServiceBehaviorAttribute HOT 4
- [Bug]: NullReferenceException when excluding primitive type parameters from SOAP request, starting in v1.5.1 HOT 6
- [Bug]: Ntlm ClientCredential failed to validate in custom AuthenticationHandler/AuthorizationHandler HOT 1
- [Bug]: System.TimeoutException occurs when using TransferMode.Streamed without security (TcpClientCredentialType.None, SecurityMode.None) HOT 2
- [Bug]: This XML file does not appear to have any style information associated with it HOT 1
- Add UsernameToken digest password support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corewcf.