SOAP 1.2 strikes me as really reasonable - it's a mature format with interop to several languages and has schema validation.

The inconsistencies you describe above are probably due to each org in the government implementing the common spec independently of the others, and introducing differences without even knowing. Documentation is key here, but as with any large system, there can be gaps.

It's really cool that you mapped it all.

And kudos to Brazil for creating a common computerized platform.

I once had to write some middleware for some warehouses based of an erp/crm subsidiary of the megacorp that rhymes with whoracle, the documentation was sparse specifically for the field I needed to modify, and once I got it working I saved 40MB of memory per PHP process by nuking the client side validator, fun times! The thrill of cobbling that together started me down the dark path to working for an API gateway appliance company, the darkness was immeasurable.