-
Notifications
You must be signed in to change notification settings - Fork 388
Implement custom message class #1119
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
Implement custom message class #1119
Conversation
…y runs that code if it's needed
fix for header value
…ct to compile on github
* only fetch MessageHeaderAttribute once per property/field of parametertype * use GetCustomAttributes instead of using linq to filter through all CustomAttributes when searching for ServiceFilters
|
@akshaybheda I know you've asked about performance before. Do you have a good scenario for doing some benchmarks on this? Seems to me that the perf is better but I'd like to be sure that it also applies to a real scenario. |
|
Let me find some time and do some testing around this |
src/SoapCore/XDocumentXmlReader.cs
Outdated
| { | ||
| public class XDocumentXmlReader : XmlReader | ||
| { | ||
| private readonly XDocument _document; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never used
src/SoapCore/Extensibility/AuthorizeOperationMessageProcessor.cs
Outdated
Show resolved
Hide resolved
| if (supportXmlDictionaryReader) | ||
| { | ||
| reader = XmlDictionaryReader.CreateTextReader(ms, readEncoding, ReaderQuotas, dictionaryReader => { }); | ||
| using (var xdReader = XmlDictionaryReader.CreateTextReader(stream, readEncoding, ReaderQuotas, dictionaryReader => { })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: you can simplify the using
akshaybheda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did look at some of the changes and added some comments
|
Thank you for taking the time. I also managed to get ParsedMessage working for the response, which resulted in higher memory usage and no speed improvement, so I'll give up on that idea. I also tried rewriting the DefaultOperationInvoker to use expression trees, but that didn't result in a noticeable win. Maybe with more complex operations... I put that implementation in a gist, in case you want to try it out for your scenario Rewriting the invocation code to use source generators would most likely be a big benefit, but that would be a big project and would not work for netstandard 2.0. |
akshaybheda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good to me


Proof-of-concept-branch with additional performance work
Right now this is only used for reading the Request message. If it is going to be used for the Response message I have to figure out how this relates to CustomMessage. Should I merge the two implementations? Probably...
This branch uses a custom implementation of Message to make working with it more efficient. I also had to implement a custom XmlReader since the one returned by
XDocument.GetReader()doesn't support binary data.All tests pass, but nasty edge case bugs are still possible.
develop
This branch