Daniel Kulp wrote > Due to CXF's streaming, if there is any error writing out a message, there > is not much that can be done to properly recover. You can set a > property of: > > "org.apache.cxf.output.buffering", "true" > > on the endpoint to cause it to buffer the output while writing so if there > is a validation problem it can possibly send an OK fault. However, any > large messages will consume a LOT of memory. > > Normally, I just suggest to make sure you (as the developer) properly fill > in whatever data is needed and turn off the schema validation for the > outgoing messages. With the latest versions of CXF, the > schema-validation can be set for only the incoming messages (that you > don't have control over). (set the schema-validation property to "in") > > Dan > > > Hi Dan, > This behaviour was noted for jms services and not for ones exposed over > http. For webservices over http, the marshalling error is shown as part of > the Fault body, while for the same webservice, if I change the transport > to jms in the binding, the fault body that comes up is empty. > > Tried with the "org.apache.cxf.output.buffering" set as a jaxws property > in the endpoint configuration, but the issue persists. Would I be missing > something in the configuration here? > > > I'm including the server log below. > > The log shows the Marshalling Error: > 2 Jul, 2013 12:07:38 PM org.apache.cxf.phase.PhaseInterceptorChain > doDefaultLogging > WARNING: Interceptor for > {webservices/SampleService/standard/2013/06}SampleService#{webservices/SampleService/standard/2013/06}sampleOperation > has thrown exception, unwinding now > org.apache.cxf.interceptor.Fault: Marshalling Error: > cvc-complex-type.2.4.a: Invalid content was found starting with element > 'optionalValue'. One of '{mandatoryValue}' is expected. > at > org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:258) > at > org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169) > at > org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:123) > at > org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68) > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271) > at > org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77) > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271) > at > org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) > at > org.apache.cxf.transport.jms.JMSDestination.onMessage(JMSDestination.java:235) > at > org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:535) > at > org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:495) > at > org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) > at > org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) > at > org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058) > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050) > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947) > at java.lang.Thread.run(Thread.java:619) > Caused by: javax.xml.bind.MarshalException > - with linked exception: > [org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content > was found starting with element 'optionalValue'. One of '{mandatoryValue}' > is expected.] > at > com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:318) > at > com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:172) > at > org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:537) > at > org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:233) > ... 17 more > > > Parvathy > > On Jul 1, 2013, at 5:42 AM, ParvathyR <
> parvthi@ > > wrote: > >> Jeffrey Knight wrote >>> I'm pretty sure my wsdl and xsd are ok. It passes WSI-Compliance in >>> SoapUI. >>> >>> The issue seems to be that I'm neglecting to set a required property >>> on an object that then gets serialized. >>> So when my code returns and CXF tries to serialize it to XML, it fails >>> the validation on the way out. >>> But there's no record of what went wrong and the payload comes up blank. >>> >>> Would it help if I wrote up a test case? >>> >>> >>> On Thu, Mar 3, 2011 at 11:17 PM, Daniel Kulp < >> >>> dkulp@ >> >>> > wrote: >>>> >>>> This sounds like a problem with the wsdl/schema. The runtime should >>>> pick up >>>> the same schema on the incoming and outgoing sides. Thus, that >>>> doesn't >>>> sound >>>> like the issue. It really does sound like more of a wsdl/schema >>>> issues. >>>> Like Freeman suggested, check the use of imports where includes should >>>> be >>>> used >>>> and such. >>>> >>>> Dan >> >> Hi, >> We are facing the same issue too. We are on CXF2.4.3 and use SOAPUI as >> the >> client for testing. I tried the same scenario on CXF2.7.6 and faced the >> same >> issue there too. >> When schema validation fails for the response, the marshalling error gets >> logged in the error log but SOAPUI shows a blank response message. >> >> >> Parvathy >> >> >> >> -- >> View this message in context: >> http://cxf.547215.n5.nabble.com/schema-validation-enabled-true-tp3408876p5730112.html >> Sent from the cxf-user mailing list archive at Nabble.com. > > -- > Daniel Kulp > dkulp@ > - http://dankulp.com/blog > Talend Community Coder - http://coders.talend.com -- View this message in context: http://cxf.547215.n5.nabble.com/schema-validation-enabled-true-tp3408876p5730156.html Sent from the cxf-user mailing list archive at Nabble.com.