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. What's next? get this blog rss updates or register for mail updates!
2 comments:
I know this is an older post, yet it is still true to this day. At the moment I am in the process of writing a dynamic WCF C# client that has the requirement to connect to either a Java or C# web service, without knowing if it is a C# or Java service, all we know is the Data and Service contract layout. Getting Qualified and UnQualified returns was one of the issues to get rid of.
So thanks for the post!
Thanks a lot, you saved my day!!!
Post a Comment