cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benson Margulies" <bimargul...@gmail.com>
Subject Debugging Xml Schema and validation
Date Tue, 18 Nov 2008 01:46:12 GMT
(Dan: I spoke too soon about having everything work).

Here we have a message.

Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><getComplexStruct
xmlns="http://apache.org/schema_validation/types"><in>Hello</in></getComplexStruct></soap:Body></soap:Envelope>

Validation fails, claiming that it doesn't know a definition for
getComplexStruct.

I dumped the XML derived from XMLSchema, here's the schema element,
and then, sure enough there it is. If it's there in the XML of the
schema, how can the validator lose track of it? More to the point, I
wonder how to figure out what it is thinking.


<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://apache.org/schema_validation"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:x1="http://apache.org/schema_validation/types"
attributeFormDefault="unqualified" elementFormDefault="qualified"
targetNamespace="http://apache.org/schema_validation/types">

...

<xsd:element name="getComplexStruct">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="in" type="string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

...

java.lang.AssertionError: Found message Unmarshalling Error:
cvc-elt.1: Cannot find the declaration of element 'getComplexStruct'.
	at org.junit.Assert.fail(Assert.java:74)
	at org.junit.Assert.assertTrue(Assert.java:37)
	at org.apache.cxf.systest.schema_validation.ValidationClientServerTest.testSchemaValidation(ValidationClientServerTest.java:121)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
	at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
	at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
	at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
	at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
	at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
	at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
	at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
	at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
	at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

Mime
View raw message