The JAXB part looks OK, and this is confirmed by your statement
that unmarshalling works. It seems that this is more of an CXF issue
than a JAXB problem.
-W
On 7/6/09, javamustang <max.laenzlinger_at_gmx.ch> wrote:
>
>
> Hello all,
> I made a REST Service with CXF, because it can validate incoming xml
> against
> a xsd. Problem is, Validation works fine, but the setters of the complex
> incoming type are not called. (without validation the unmarshalling works)
> Many thanks for all ideas.
>
> -----------------------
> SERVICE:
> ...
> @POST
> @Produces("application/xml")
> @Consumes("application/xml")
> public TestResponse test (TestRequest testRequest)
> ...
>
> -----------------------
> TestRequest.java:
>
> @XmlRootElement (name="serviceRequest", namespace =
> "http://www.example.org/books" )
>
> public class TestRequest
> {
> private String testdata;
> ...
> }
>
> -----------------------
> DATA:
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <b:serviceRequest xmlns:b="http://www.example.org/books">
> <b:testdata>hello</b:testdata>
> </b:serviceRequest>
>
> -----------------------
> XSD:
>
> <?xml version="1.0" encoding="utf-8"?>
> <xs:schema targetNamespace="http://www.example.org/books"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
> <xs:element name="serviceRequest" >
> <xs:complexType>
> <xs:sequence>
> <xs:element name="testdata">
> <xs:simpleType>
> <xs:restriction
> base="xs:string">
> <xs:length
> value="5"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> --
> View this message in context:
> http://www.nabble.com/Unmarshalling-with-namespace-xsd-validation-tp24354306p24354306.html
> Sent from the java.net - jaxb users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>