I looked at my request:
And at the schema:
And it seemed valid to me.
So I asked the service provider to show me an example of a working soap request. And so he did:
You can see that the difference is in the namespace of the inner "name" element: It is from the "http://someOrganization" namespace in my request but from the empty namespace in the working request. For those of you less familiar with xml namespaces: In the previous request "xmlns" defined a default namespace for all elements without prefixes; In this case only elements that explicitly use the "ns" prefix belong to the namespace.
After a short investigation the cause of this was identified. Let's take a second look at the schema (which is a part of the wsdl file):
elementFormDefault can have 2 values:
So my request was valid for the "qualified" option and the provider sample was valid for "unqualified". Since the wsdl contains "qualified" my request is correct after all.
However - as in many times with interoperability - there is a Gotcha:
Many web services frameworks poorly implement elementFormDefault
This effectively means that a server can use "unqualified" format even though the wsdl has "qualified".
The solutions can be:
1. Fix the server implementation
2. Manually change "qualified" to "unqualified" in the wsdl and recreate your client stubs.
For new services it is recommended to use "qualified" which is also the default for most new soap stacks.