Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Soap11WSAddressingAugust2004 failing #1294

Open
1 task done
erviem99 opened this issue Nov 22, 2023 · 3 comments
Open
1 task done

[Bug]: Soap11WSAddressingAugust2004 failing #1294

erviem99 opened this issue Nov 22, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@erviem99
Copy link

Duplicate ?

  • I have searched issues/discussions and did not find other issues/discussions reporting this bug.

Product version

1.5.1

Describe expected behavior

SOAP message should reach endpoint

Describe actual behavior

Internal error in CoreWCF while processing SOAP request

Which binding

CustomBinding

security

None

Which .NET version

.NET 6

Which os platform

Windows

Code snippet used to reproduce the issue

CustomBinding customBindingSoap11 = new CustomBinding(new BasicHttpBinding());
                var encoding = customBindingSoap11.Elements.Find<TextMessageEncodingBindingElement>();
                encoding.MessageVersion = MessageVersion.Soap11WSAddressingAugust2004;
...
                // Add the Service
                builder.AddService<SomeService>(serviceOptions =>
                {
                })
                // Add a BasicHttpBinding endpoint
                .AddServiceEndpoint<SomeService, ISomeService>(customBindingSoap11, "/someendpoint.asmx", endpoint =>
                {
                })

Stacktrace if any

fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HMVB55JE925V", Request id "0HMVB55JE925V:00000002": An unhandled exception was thrown by the application.
      System.ObjectDisposedException: Message is closed.
         at CoreWCF.Channels.BufferedMessage.get_Properties()
         at CoreWCF.Channels.AspNetCoreReplyChannel.HandleRequest(HttpContext context)
         at CoreWCF.Channels.RequestDelegateHandler.HandleRequest(HttpContext context)
         at CoreWCF.Channels.ServiceModelHttpMiddleware.InvokeAsync(HttpContext context)
         at CoreWCF.Channels.MetadataMiddleware.InvokeAsync(HttpContext context)
         at Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware.InvokeAsync(HttpContext context)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
@erviem99 erviem99 added the bug Something isn't working label Nov 22, 2023
@mconnew
Copy link
Member

mconnew commented Dec 14, 2023

The message gets closed when the Message has been consumed. This can happen if you have something like a message inspector which reads the message body. If you have an extensibility code doing this, you should create a BufferedCopy first, then from the BufferedCopy, make two messages, one to replace the original, and one to work on yourself. If you don't have any extensibility doing something like this, let me know.

@erviem99
Copy link
Author

I have commentet out everything I can think of including serilog and any endpoint behaviours and I still get the error:

fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HMVV2MQF205B", Request id "0HMVV2MQF205B:00000002": An unhandled exception was thrown by the application.
System.ObjectDisposedException: Message is closed.
at CoreWCF.Channels.BufferedMessage.get_Properties()
at CoreWCF.Channels.AspNetCoreReplyChannel.HandleRequest(HttpContext context)
at CoreWCF.Channels.RequestDelegateHandler.HandleRequest(HttpContext context)
at CoreWCF.Channels.ServiceModelHttpMiddleware.InvokeAsync(HttpContext context)
at Microsoft.WebTools.BrowserLink.Net.BrowserLinkMiddleware.InvokeAsync(HttpContext context)
at Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware.InvokeAsync(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

@CezaryKlus
Copy link

Hi, take a look at this one #1356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants