POST Raw XML Payload application/xml with ES-EventType and EventId set in headers

Hello,

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 application/json, application/xml or 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-Allow-Origin: *

Access-Control-Expose-Headers: Location, ES-Position

Content-Type:

Server: Mono-HTTPAPI/1.0

Content-Length: 0

Connection: close

Looks to me from briefly looking over it that application/xml is
trying to route to vnd.eventstore.events+xml with the opposite likely
happening on the other side.

https://github.com/EventStore/EventStore/blob/release-v3.7.0/src/EventStore.Core/Services/Transport/Http/AutoEventConverter.cs#L87

Is the main issue. Can you put up an issue on it?

Cheers,

Greg

Issue: https://github.com/EventStore/EventStore/issues/908

Thanks,

Sam