On Jul 29, 2008, at 8:47 AM, nicolas de loof wrote:
So according to the way the schema is defined, an element is part of
the
schema if it has no namespace in it's QName, am I right ?
As long as it's elementFormDefault=unqualified (which is the default
if not specified).
Now, what does the namespace attribute on <soap:body> change
regarding this
? Is this suppose to force the parser to check the incoming message
to match
the specified namespace, and to ignore all other elements, as it
seems to
behave ? The wsdl spec is not very explicit on what it is designed
for...
The namespace on the soap:body thing is really just used for Rpc/
Lit. In that case, the runtime needs to create a new wrapper element
which is the operation name plus that namespace. For doc/lit which
everything is completely controlled by the elements in the namespace,
it should be irrelevant.
Dan
Nicolas.
2008/7/29 Daniel Kulp <[EMAIL PROTECTED]>
No, it's the opposite. There isn't an "elementForm=Qualified" on
the
schema. Thus, those elements should have NO namespace
qualifications.
The first method sets the default namespace, so they end up
qualified which
is wrong. The correct message that CXF accepts should not have
those
elements qualified.
Dan
On Jul 29, 2008, at 8:22 AM, nicolas de loof wrote:
According to the wsdl, both <dossier> and <requeteConsSolde> are
defined
in
the schema with targetNamespace="http://localhost/pdr/services/"
Based on your comment, the first message (with namespace prefix
only on
the
requeteConsSolde element) should NOT be accepted by CXF, but the
second
one
(setting default namespace) should... but Stéphane gets the oposite
behaviour.
I don't know what the namespace attribute on <soap:body> bind tag
is for.
How is it suppose to change the way CXF (or jaxb?) parse the message
during
unmarshalling ?
2008/7/29 Philipp Leitner <[EMAIL PROTECTED]>
Correct me if I'm wrong, but isn't the second variant semantically
different to the first one? In the first variant, 'dossier' and
'canal'
are
in the default namespace, while they are in the '
http://localhost/pdr/services/' namespace in the second one (again,
correct me if I'm wrong, but this is what I think how xmlns="..."
works).
IIRC the old Axis was rather lenient in terms of Namespaces,
unlike newer
frameworks such as CXF. This may explain why the old Axis happily
accepted
your invocation, while CXF does not.
/philipp
On Jul 29, 2008, at 11:52 AM, ARDOUIN, Stéphane wrote:
Hi,
I have a difference of behavior about namespaces between Axis
1.1 and
CXF
2.0.8 that I'd like to understand.
For the WSDL I joined to this email, if I send the following
request,
the
behavior of the webservice implemented with CXF 2.0.8 is OK :
Request generated with soap-UI :
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="
http://localhost/pdr/services/">
<soapenv:Header/>
<soapenv:Body>
<ser:consulterSoldeRequete>
<dossier>0683690006</dossier>
<canal>SWI</canal>
</ser:consulterSoldeRequete>
</soapenv:Body>
</soapenv:Envelope>
Response (CXF) is OK :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/
">
<soap:Body>
<ns2:consulterSoldeReponse xmlns:ns2="http://localhost/pdr/services/
">
[...]
</ns2:consulterSoldeReponse>
</soap:Body>
</soap:Envelope>
But the following request, which worked for the webservice
implemented
with Axis 1.1 no longer works for the webservice implemented
with CXF
2.0.8
:
Request which was OK with Axis but KO with CXF 2.0.8 :
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<consulterSoldeRequete xmlns="http://localhost/pdr/services/">
<dossier>0683690006</dossier>
<canal>SWI</canal>
</consulterSoldeRequete>
</soapenv:Body>
</soapenv:Envelope>
The response (CXF) is KO : an applicative error is returned
because the
java objects dynamically provided by CXF contain null
attributes. The
software checks this attributes, and returns this error, saying
that
mandatory fields are missing in the request.
The difference lies in the fact that the second request doesn't
specify
the namespace in the same manner : it uses a default namespace.
But with
Axis 1.1, it didn't matter.
This is related to the following section of the WSDL :
<operation name="consulterSolde">
<input>
<soap:body namespace="http://localhost/pdr/services/"
use="literal"/>
</input>
<output>
<soap:body namespace="http://localhost/pdr/services/"
use="literal"/>
</output>
</operation>
Workaround :
If I remove the namespace in the soap:body element of the
operation in
the
binding section of the WSDL, and regenerate the webservice, the
second
request becomes OK.
Could you tell me if this is normal, or if you plan to handle
that in a
future release ?
Thank you in advance.
Stéphane Ardouin
<service_consulter.zip>
---
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog
---
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog