Soap body, namespace issue
I have a web service app on Apache Geronimo 2.1.3.
I am using JAX-WS, annotat开发者_Python百科ing POJOS, using SOAP 1.1. (using Sun JDK 1.5)
Various clients use the web services without a hitch.
One new client is not working. In working clients, only the child element under soapenv:Body has a namespace declaration, and the child's children elements have no namespace declaration. In the new client, ALL descendents of soapenv:Body, including the child's children, have namespace declarations.
In essence, this works:
<soapenv:Body>
<ns1:Echo>
<Message>Hello world</Message>
...
But this does not:
<ns1:Echo>
<ns1:Message>Hello world</ns1:Message>
...
Logging in the app would show that Message is null, instead of "Hello world"
Is this "bad" request OK? It looks like it confirms to WS-I Basic Profile?
The client program can't change. Is there a way for me to override something, to get both versions of this request to work?
Message
and ns1:Message
are different types, just like fictional java Classes Message
and ns1.Message
. The server expects a Message
element that is declared in the default namespace (there should be a xmlns="<my.default.namespace.name>"
somewhere) but it gets a <ns1:Message>
and simply ignores it.
If you can't force the client to send valid xml soap messages (according to the wsdl), you may try to change the server code so that it accepts <Message>
elements aswell as <ns1:Message>
elements as <ns1:Echo>
children. You'd have to declare types for the elements from the ns1
namespace and add a choice
element to the <ns1:Echo>
declaration.
精彩评论