rafek1241 / rebus.serializer.xml Goto Github PK
View Code? Open in Web Editor NEWXML serializer built on top of NewtonSoft.JSON for ReBus library
License: MIT License
XML serializer built on top of NewtonSoft.JSON for ReBus library
License: MIT License
Give a possibility for the user to decide how namespace should be stored in a serialized message. Deserialization should remain the same and use all possibilities.
Possible strategies:
In NServiceBus deserialization order of xml attributes in root container is important.
Expected:
<Messages xmlns:xsi="..." xmlns:xsd="..." xmlns="..." xmlns:baseType="..." xmlns:baseType1="..">
Actual:
<Messages xmlns:baseType="..." xmlns:baseType1=".." xmlns:xsi="..." xmlns:xsd="..." xmlns="..." >
if the deserialized type cannot be mapped to the exact type we should try out the base types from XML root container attributes.
It's dependent of #2 .
Create documentation for XML serialization package.
newtonsoft.json
is being used, and how it can be used?Actual:
<RootContainer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/sometype">
....
</RootContainer>
Expected:
<RootContainer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/sometype" xmlns:baseType="NServiceBus.ICommand" xmlns:baseType1="NServiceBus.IMessage">
....
</RootContainer>
Explanation:
NServiceBus in older versions (I don't know how it works now) parsed XML objects to specific classes by using XML namespaces from their root container attributes. I want to have it to give a possibility for NServiceBus to read that messages.
Currently, there is an options class that contains all settings and it is included in the extension method. It should be possible to set it up fluently by method chaining.
Current:
//rebus configuration
...
.Serialization(
r => r
.UseXmlSerializing(
logger,
new XmlSerializingOptions()
{
IncludeNamespace = true,
DefaultNamespacePrefix = "http://tempuri.net"
}
)
)
Expected:
.Serialization(
r => r
.UseXmlSerializing()
.WithLogger(logger)
.IncludeNamespace()
.WithNamespacePrefix("http://tempuri.net")
)
and
var config = new XmlSerializerConfig()
.WithLogger(logger)
.IncludeNamespace()
.WithNamespacePrefix("http://tempuri.net");
...
.Serialization(r=> r.UseXmlSerializing(config))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.