I want to allow an external system to post callback responses to ES and their payload is xml. Adding the headers needed by ES can be added using nginx, so now I am troubleshooting getting ES to accept the raw xml payload. Is there currently a way to get ES to accept application/xml content type and ES fields are specified in the headers? Then the data can be viewed from the atom feed and user interface like when using the ES xml specified payload? text/xml is working, but does not seem to be enhanced from the read side as much as using application/vnd.eventstore.events+xml . It seems https://github.com/EventStore/EventStore/blob/699c17fc01ab633ceb14fac7a6e8ecd2c5535c18/src/EventStore.Core/Services/Transport/Http/AutoEventConverter.cs would be place to start, but I was wondering if someone might be able to point me in the right direction before I start modifying ES source.
There seems to be some differences between text/xml and application/xml. It seems they should be the same when reviewing: https://groups.google.com/forum/#!searchin/event-store/application$2Fxml/event-store/hLFyG32Yui8/NHql6R4rw-QJ
POSTing to a stream with the media type
text/xmlassume a single event is contained in the body. Event ID and expected version can be specified via headers on the request, or an idempotent URI can be posted to allow for retries if client-side ID generation is not possible
It seems ES is able to parse more of the data when using Content-Type: application/vnd.eventstore.events+xml, application/vnd.eventstore.events+xml, or application/json when posting. Is there a way to add this for text/xml and application/xml when ES fields are specified in the headers?
Here are some examples:
[vagrant@localhost ~]$ echo “abc” | curl -i -H “ES-EventType: SomeEvent” -H “ES-EventId: C322E299-CB73-4B47-97C5-5054F9207461” -H “Content-Type: application/xml” -d @- http://127.0.0.1:2113/streams/newstream
HTTP/1.1 400 Write request body invalid.
Access-Control-Allow-Methods: POST, DELETE, GET, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-Forwarded-Host, X-PINGOTHER, Authorization, ES-LongPoll, ES-ExpectedVersion, ES-EventId, ES-EventType, ES-RequiresMaster, ES-HardDelete, ES-ResolveLinkTo, ES-ExpectedVersion
Access-Control-Expose-Headers: Location, ES-Position