Want to integrate? The documentation is four PDF manuals totaling over 1,000 pages, spread across different portals, with critical details that are simply not written anywhere. Two examples we paid for in hours of debugging: the freight document (CT-e) and the manifest (MDF-e) implement the same distribution spec with incompatible envelopes (one wraps the payload and requires an author state code, the other rejects that field and wants the state code in the SOAP header). And the SOAP action must travel inside the Content-Type header; send a SOAPAction header like every SOAP tutorial on the internet tells you to, and the server refuses you without explaining why.
So we mapped all 29 webservices across the 4 document models into one Postman collection: ready-to-fire envelopes, per-host mTLS certificate setup documented, and the distribution services validated against the production government endpoints, not just written from the manuals.
Where you can make it better: Brazil has 27 states and several run their own authorizer URLs (Sao Paulo's retail invoices, for one). We cover the shared authorizer plus the national environment; state-specific URL mappings are the top open contribution. The collection is generated from a Python inventory file, so a PR is a 5-line diff, not JSON surgery.
Docs in Portuguese (the devs suffering with this are Brazilian), but I'll answer anything here in English.
We _still_ use TCP/IP and it's v4 is from 1981.
edit: I once looked deep into Remote PowerShell. How it's actually built. Dear. God. XML enveloped inside XML inside another XML wrapped around HTTP. Add some certificate based encryption for the HTTP envelope and some more encryption for the Kerberos messaging inside the serialized XML wrapped in envelopes and wrappings. Now THAT'S a communication protocol. :D
It's a perfectly fine protocol, with a rigid schema and mature code generation support for all relevant languages. It's not the sexiest protocol, but it gets the job done.
And what are the alternatives? JSON schema?
ASN.1? It's even more mature, and the de-facto DER/BER encoding is far more efficient to generate and parse than anything XML-based.
Heh, "relevant languages" is kind of an interesting term there. If the relevant language is Java then sure, it's fine.
Some popular modern languages (ie Go) don't have good SOAP support (yet). At least not to the point of being able to point them at WSDL/XSD specs and have everything auto-generated. :(
It's more than just a few days of effort though. Sme of the members of my team at work have been working on adding SOAP 1.1 support. It's a significant amount of time and effort though.
That's just no how the real world works. When this was launched Go probably wasn't a relevant language, Rust probably barely existed and the whole thing was designed for a corporate setting, where Java and .Net are the standards. All those who are asking "Why SOAP?" or suggests replacing it seems rather naive about how most corporate software is sold, designed, built and maintained, as well as expected lifetimes of solutions.
Yeah, fully agree. I was super surprised to find the SOAP support is practically non-existing too, as Go is really strong in lots of other areas. :(
That being said, SOAP's stronghold is clearly the Java ecosystem. Wonder if it's as popular in any other non-java-ecosystem based languages?
I really think outside of Java and c#, soap is totally dead.
Most places in my experience just write their own wrappers/frameworks to generate what they know works, and go to town. I’ve done it too.
Are you meaning in my comment, or in the GitHub repo the article references?
Asking because AFAIK the theory of having (accurate) vendor provided WSDL/XSD files is that you can generate a bunch of code (ie parsers, strong validation) that works with it, generate tests. There are additionally well developed SOAP specific GUIs (ie www.soapui.org) which will directly load the WSDL/XSD files and let you immediately make test network calls to validate things.
Though sure, you can do the above manually without WSDL/XSD files, but if you have accurate ones provided to you by vendors then it makes things a lot easier.
Which is also my experience too.
Or have you not dealt with decade+ long services with severe inertia/lockin? Because that is what lets them get away with this.
Correct, yes I haven't.
Other members of staff where I'm working are from Java backgrounds, and have described (in detail) WSDL/XSD (when things are accurate) in positive terms as I put above.
And yeah, I'm presently dealing with vendor specs/docs that don't match what's actually sent over the wire, and it's a huge pain in the arse. And the vendor doesn't give a shit, as like you allude to they're in the telco business so the lock in aspect you mention is correct to. :(
Working with enterprise software is in general a horrific experience, especially that which originated in the 90s at the peak of OOP dogma-cults and insane architecture-astronautism abstraction mixed with SOLIDly thick levels of bureaucracy.
My memories of COM, CORBA, DCE/RPC, XML, etc. are not great. Some of the stuff reads like satire today, but people were actually serious about it: https://en.wikipedia.org/wiki/Object_Management_Group (I recall an article in a physical magazine long ago which started with "The Object Management Group's Working Task Force, also known as OMGWTF...")
However in the age of AI I don't know if it matters too much that SOAP is the interchange. It is easy enough to build clients against it. It works. It's probably quite secure. Who cares?
this is hacker poetry
[1] The whole thing with wsdl is like an elaborate prank. Without fail, the WSDL files are impossible to obtain and don't reflect the service as deployed or documented. Documented equivalent forms will not be treated as equivalent. Two instances of a 'standard' service will not accept the same XML. And I only worked with simple SOAP services with straight forward payloads.
WSDL is in some ways more user-friendly than openapi schemas. They have a rich set of types that mostly just work as expected. When I try to generate models from an OpenAPI JSON file, I often find myself either overriding the models or making scripts/plugins to rewrite the json to fix types. An example of this is using proper decimals instead of doubles, which is crucial in my line of work.
It really depends on the service, does it make it easy to obtain the wsdl and more importantly does it honor the type conventions. There is no getting around the fact that services need to maintain consistent behavior and document that behavior, the wsdl is just a transport layer for that organizational commitment. If you have the commitment, then you have a good experience, if you don't, you don't, and whether you are using JSON or SOAP doesn't matter.
That‘s the question? And not why every single invoice has to go through the government?
I would call that developers loss of focus.
WS auth is horrible though and a bearer token (and tls) in the header is definitely the way to go.
No, XML is still not mature. They still need to fix the security issues everyone reimplements every time such as local file disclosure via DTDs, exploding documents due to entity expansion and so on. It basically doesn't handle untrusted input well, like SQL built from strings without parameter bindings.
I hope this is reasonable and doesn't use XML Security or similar extensions that add a whole stack of other security issues on top that everyone reimplements when adding SAML support.
Who is doing this reimplementation? You're supposed to be using mature, battle-tested libraries for parsing these formats. Writing your own parser for just about any format is a fool's errand when good implementations that have already addressed these issues exist. Even a simple format like JSON is not immune to performance, safety, and correctness pitfalls.
Using XML in a safe way requires you to study what is wrong with XML first. That is not what many people do.
The real difficulty was payers who did not follow the spec, semantically. Whether to include certain fields or not and different interpretations of fields/values was maddening.
I recoil in horror at SOAP, not because I don’t know it, but because I do.
For .Net at least SOAP support is built in, just standard .Net, no libraries required, just ask Visual Studio to load the WSDL and it will handle the rest.
I haven't used it myself, but a former colleague speaks fondly of gSOAP for integrating into C. When we've talked about it, his take is that using gSOAP would vastly reduce complexity and development time (compared to Java and REST), but this is an older gentleman who has been writing C since the 1980s.
It is a bit of an old-school experience, but all the important parts are there and get the work done.
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.
So it’s not a great “common” spec?
I read every invoice goes through a standard interface an improvement, no?
So sending an invoice means leaving an XML file in a folder, then polling the server and waiting a few hours to get a response in the form of another XML file in another folder.
You can also integrate via web service, but I think SFTP is still the most popular method, especially for its batching capabilities.
Every country should have something like this
As for performance, that was also rediscovered why none of them are great, thus gRPC rediscovering CORBA, COM and Sun RPC.
XML/SOAP based protocol was created with modern at the time .Net technologies, but nobody really cared about interoperability, so it screams "old .Net" now.
The actual XML formats contained in the messages can be anything that can be represented with an XML schema. Obviously some schemas are better designed than others, but having a standard way to represent complex business documents with well-defined composable components, nesting, and having sufficient flexibility to handle defined variations of those documents is generally a good thing.
If you compare a good XML-based API implementation with the disaster that is the v1/chat/completions JSON API, which is a monster to correctly deserialize into typed structs, you will understand why XML protocols can still be a good choice. The typical ad hoc JSON API has the advantage of being the lowest common denominator, and does not require the designer to think much about their schema before rushing to publish their API. JSON gives you lots of opportunities to make design mistakes whose costs will largely be supported by consumers of the API.
The SOAP spec itself is abandoned since 2007, but being built on other protocols such as XML, HTTP, TLS, TCP means it has benefited from the advances there. I don't see anything that is inherently outdated in the spec.
From my perspective, one of the biggest weaknesses is regarding the typical authentication mechanism with SOAP, but the spec itself does not prescribe any particular auth implementation. You can and should ignore WS-Security and choose a simple bearer token or better yet mTLS if you want to avoid text-based credentials being passed all over the place, often without any sane way to revoke or rotate them.
I see some comments about WSDL and Go: hooklift/gowsdl worked fine for us. We built a certificate automation platform in Go which interfaces with multiple CAs through their APIs, and one of them handed us a WSDL file for their SOAP API.
Other than some quirks with how the API handles namespaces and attributes which I believe are due to a misconfigured XML parser on the backend, hooklift/gowsdl worked great. The generated structs and functions worked fine after massaging some of the serialization annotations to deal with the quirks.
This CA later told us they were going to replace their quirky but perfectly functional SOAP API with a "REST API", which given that the cert issuance process requires state, doesn't seem consistent as REST is a stateless protocol. I think there is a tendency to call any JSON API a "REST API" to lend it credence. My response was that they would be better served correctly configuring their XML parser to handle namespaces as per their own WSDL definitions so that using the WSDL to generate the code works without a bunch of tweaks. I would much rather use a well-designed SOAP API than an ad hoc JSON API strung together with liberal amounts of vibe coding, which is the current trend.
This CA also had a unique authentication mechanism by requiring the credentials to be placed in the body of each and every XML document sent to the API, in plain text. So anything or anyone that needs to process, log or debug any XML document also gets a copy of the credentials. Also the same password used to log in to the web interface. Don't do that.