Dan, I do not do any schema validation so I can't help you on this one. Someone more experienced with JAXB and CXF is going to have to respond.
Eric On Thu, 2007-09-27 at 18:40 +0200, Daniel Dienhardt wrote: > Thanks for that nice example, > > I tried to enable schema validation, but it did not work. > > my beans.xml: > > <jaxws:endpoint id="myService" implementor="#myServiceImpl" > address="/MyService"> > <jaxws:schemaLocations> > <jaxws:schemaLocation> > classpath:com/mycompany/test/MyService.xsd > </jaxws:schemaLocation> > </jaxws:schemaLocations> > <jaxws:properties> > <entry key="schema-validation-enabled" value="true" /> > </jaxws:properties> > </jaxws:endpoint> > > I added a restriction to SomeType/id and it was correctly rejected with > invalid data -- but also with correct data this is the stack trace: > > INFO: Interceptor has thrown exception, unwinding now > org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1: Cannot > find the declaration of element 'SomeOperationResponse'. > at > org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:179) > at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:42) > at > org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:84) > at > org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68) > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) > at > org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:74) > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) > at > org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:73) > at > org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:79) > at > org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:236) > at > org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:141) > at > org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:278) > at > org.apache.cxf.transport.servlet.CXFServlet.doPost(CXFServlet.java:256) > > > Do you have any idea what I'm doing wrong? > > Thanks in advance > > Daniel Dienhardt > > moraleslos schrieb: > > Thanks Eric. > > > > Just what I needed! I'll use your sample as a template. Thanks again! > > > > -los > > > > > > > > BigEHokie wrote: > >> Here's just a quick sample. > >> > >> I'm not stating this is the proper or correct way to do anything. > >> However, this is how we are currently using CXF. > >> > >> The CXF guys can provide you with better direction on how you SHOULD be > >> creating your services. They might tell you this approach is a bad > >> approach. > >> > >> Eric > >> > >> On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote: > >>> Hi-- > >>> > >>> Having gone through the Spring Web Services (SWS) manifesto about > >>> contract-first as well as their sample examples, I wonder how CXF matches > >>> up > >>> with SWS. I know that CXF allows contract-first development, but is it > >>> as > >>> simple as SWS? For example, with SWS, all I need to do is define the XSD > >>> for my types (the messages and such being passed or returned). I can > >>> then > >>> have SWS generate the WSDL using basic conventions and the XSDs defined. > >>> The > >>> only other thing to do is to implement the endpoints (Java) that will > >>> handle > >>> the service. From looking through the CXF site, it looks that if you do > >>> contract-first, you must define the WSDL along with the XSDs and Java > >>> service implementations (probably using JSR-181). Is this the case? > >>> > >>> Thanks in advance! > >>> > >>> -los > >> > >> > > > > >
