Oh it's a pain. I was there too.
Well, the idea with metadata for transactions, sessions, etc. - a good idea. For journaling, at least.
The problem is setting up what matches the various corporate policies and SOA infrastructure.
There is a direct connection between the best design and the maximum interoperability in the case of HTTP.
The safe way is encoding the metadata in the message itself. Not very nice, and this solution looks a bit like SOAP, where you have an envelope with headers for all messages.
I ended up using the X-header for information such as transaction id. However, as you mentioned, proxies / b2b gateways, etc. They can reset headers, itβs not obvious that you can restore them with all assigned development frameworks, COTS applications, etc. Therefore, if you do so, you should avoid having the metadata mandatory to get the solution working - just "nice to have."
Cookies are nothing but pain. They can be annoying or sometimes even useful when interacting with the browser, but in a SOA script this would be a bad idea. Many things can go wrong, and itβs a pain to debug cross-organizations.
I would also avoid using query strings along with POST or PUT data. This is possible according to the HTTP specifications. but not when it comes to random implementation.
source share