-
1. Re: CXF - Response Schema validation failed
ffang Dec 3, 2010 11:16 AM (in response to jcs_jean-claude.souvignet)Hi,
The error means the response message is invalid against the xsd schema defined in the wsdl for your response.
Could you please append the wsdl and the response message?
Without it can't tell more about it.
Btw, a valid xml fragment in your soapUI doesn't mean it's valid against the xsd.
Freeman
-
2. Re: CXF - Response Schema validation failed
jcs_jean-claude.souvignet Dec 3, 2010 11:46 AM (in response to ffang)I attach a complete test case :
A maven project with wsdl, xsd, cxf-config, implementation class ...
I use eclipse, tomcat 5.5 and JVM SUN 1.6
Thanks for your help,
-
wsVal.zip 9.0 KB
-
-
3. Re: CXF - Response Schema validation failed
ffang Dec 3, 2010 12:04 PM (in response to jcs_jean-claude.souvignet)Well, from your wsdl/xsd and generated code, I can't see why you could get response like
checkMajReponse, it should be something like ckReponse element.
Any chance you append the request/response message?
Also I doubt that you have multiple version implementations for your endpoint, it may use "checkMajReponse" previously, somehow the mismatch cause problem.
How you deploy this endpoint? maybe a clean environment and redeploy this endpoint helps
Freeman
-
4. Re: CXF - Response Schema validation failed
jcs_jean-claude.souvignet Dec 3, 2010 12:15 PM (in response to ffang)Hi,
the test case is not related to the main post.
I do this light project (wsVal) to expose the problem simply.
Everything has been generated and the service work perfectly with
(in cxf-config.xml).
turn to "true" the schema-validation-enabled and you will see the error
org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1: Cannot find the declaration of element 'ckReponse'
I run this endpoint under Tomcat in my IDE (The maven project is a war project).
I send the error stack corresponding to the light test case send before.
Edited by: jcs on Dec 3, 2010 5:13 PM
-
errorValidResponse.txt 5.5 KB
-
-
5. Re: CXF - Response Schema validation failed
ffang Dec 3, 2010 12:47 PM (in response to jcs_jean-claude.souvignet)Hi,
You should add
<jaxws:schemaLocations>
<jaxws:schemaLocation>classpath:your_imported.xsd</jaxws:schemaLocation>
....
</jaxws:schemaLocations>
to the jaxws:endpoint in the cxf-config.xml
Freeman
-
6. Re: CXF - Response Schema validation failed
jcs_jean-claude.souvignet Dec 6, 2010 3:21 AM (in response to ffang)Hi,
I use
and the error persist :
org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1: Cannot find the declaration of element 'ckReponse'.
I try With jetty and tomcat but there are not difference : marshall error is raised.
Thanks in advance for new help
(wsVal.zip is updated project that expose this issu)
-
wsVal.zip 16.5 KB
-
-
7. Re: CXF - Response Schema validation failed
jcs_jean-claude.souvignet Dec 6, 2010 4:12 AM (in response to jcs_jean-claude.souvignet)It seems to be related to :
https://issues.apache.org/jira/browse/CXF-3095
Do there are a way to validate in request, and set response without validation ?
-
8. Re: CXF - Response Schema validation failed
jcs_jean-claude.souvignet Dec 7, 2010 6:10 AM (in response to jcs_jean-claude.souvignet)Hi,
I resolve temporary this point by using en interceptor that set up the schema to use for validation :
the interceptor is fr.service.interceptor.SetShemaInterceptor in the zip attached.
I set up this interceptor in the config bus :
-
-
In and out soap message are correctly validated.
For the issue in CXF, I think there are a bug in schema initialisation.
I hope this issue resolved in future version.
Bye
-
wsVal.zip 17.5 KB
-
-
9. Re: CXF - Response Schema validation failed
ffang Dec 9, 2010 6:45 PM (in response to jcs_jean-claude.souvignet)Hi,
I played with the testcase you append, and found that the problem which cause "Cannot find the declaration of element 'ckReponse'." is actually from your
testcase. As both service-req-10.xsd and service-rep-10.xsd are using same namespace, you should use xsd:include but not xsd:import.
So just change from
<xsd:schema>
<xsd:import namespace="http://www.service.fr/service/1/0" schemaLocation="../XSD/service-req-10.xsd"/>
<xsd:import namespace="http://www.service.fr/service/1/0" schemaLocation="../XSD/service-rep-10.xsd"/>
to
<xsd:schema targetNamespace="http://www.service.fr/service/1/0">
<xsd:include schemaLocation="../XSD/service-req-10.xsd"/>
<xsd:include schemaLocation="../XSD/service-rep-10.xsd"/>
in your service.wsdl.
And I've committed a testcase which verify multiple xsd files work, you can see the response message declared in another xsd files could be found with schema-validation-enabled
Freeman
Edited by: ffang on Dec 9, 2010 11:45 PM