You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Adrian C <ad...@gmail.com> on 2008/06/11 16:59:59 UTC
JAXB 2.0 schema validation
Hi,
I have a consumer of a web service which is created using
org.apache.cxf.jaxws.JaxWsProxyFactoryBean via spring. I seem to be having
an issue where the validation things that optional elements are mandatory!
Am getting:
org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-complex-type.2.4.b:
The content of element 'KKK' is not complete. One of
'{"http://www.sample.com/ws/de":YYY, "http://www.sample.com/ws/de":XXX}' is
expected.
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:207)
at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:63)
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:220)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:170)
at $Proxy44.createIdentity(Unknown Source)
Does anyone have any ideas what is going on!? This seems to be only on the
client side!
Am using cxf 2.0.5 and it's jaxb jars (jaxb 2.0.x)
Thanks
--
View this message in context: http://www.nabble.com/JAXB-2.0-schema-validation-tp17779938p17779938.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: JAXB 2.0 schema validation
Posted by Adrian Corcoran <ad...@gmail.com>.
yeah well what is weird here is that on the server side it releases what is
optional and what is not ... however on the client side it doesn't. The jaxb
source has the annotations to mark what is required...
On Wed, Jun 11, 2008 at 5:26 PM, Daniel Kulp <dk...@apache.org> wrote:
>
> Looking at your spring config, it doesn't look like you are using a
> wsdlLocation. Thus, the schema that you are validating against is one that
> is generated from the JAXB beans. Since the schema -> JAXB beans -> schema
> is a lossy process, the resulting schema may not match the exact schema that
> your service is providing.
>
> Dan
>
>
>
> On Jun 11, 2008, at 10:59 AM, Adrian C wrote:
>
>
>> Hi,
>>
>> I have a consumer of a web service which is created using
>> org.apache.cxf.jaxws.JaxWsProxyFactoryBean via spring. I seem to be having
>> an issue where the validation things that optional elements are mandatory!
>>
>> Am getting:
>> org.apache.cxf.interceptor.Fault: Marshalling Error:
>> cvc-complex-type.2.4.b:
>> The content of element 'KKK' is not complete. One of
>> '{"http://www.sample.com/ws/de":YYY, "http://www.sample.com/ws/de":XXX}'
>> is
>> expected.
>> at
>>
>> org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:207)
>> at
>> org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:63)
>> 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:220)
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
>> at
>> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>> at
>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:170)
>> at $Proxy44.createIdentity(Unknown Source)
>>
>> Does anyone have any ideas what is going on!? This seems to be only on the
>> client side!
>>
>> Am using cxf 2.0.5 and it's jaxb jars (jaxb 2.0.x)
>>
>> Thanks
>>
>> --
>> View this message in context:
>> http://www.nabble.com/JAXB-2.0-schema-validation-tp17779938p17779938.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
> ---
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
>
>
>
>
Re: JAXB 2.0 schema validation
Posted by Adrian C <ad...@gmail.com>.
I had another look at this again this morning. If I just use jabx by itself
(i.e. marhsall with a JAXBContext - this is one that I newInstance up) then
the validation works as expected, however with cxf validation fails on valid
messages.
Of course as you say when I set the wsdlLocation then this works as
expected.
dkulp wrote:
>
>
> Looking at your spring config, it doesn't look like you are using a
> wsdlLocation. Thus, the schema that you are validating against is
> one that is generated from the JAXB beans. Since the schema -> JAXB
> beans -> schema is a lossy process, the resulting schema may not match
> the exact schema that your service is providing.
>
> Dan
>
>
>
> On Jun 11, 2008, at 10:59 AM, Adrian C wrote:
>
>>
>> Hi,
>>
>> I have a consumer of a web service which is created using
>> org.apache.cxf.jaxws.JaxWsProxyFactoryBean via spring. I seem to be
>> having
>> an issue where the validation things that optional elements are
>> mandatory!
>>
>> Am getting:
>> org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-complex-
>> type.2.4.b:
>> The content of element 'KKK' is not complete. One of
>> '{"http://www.sample.com/ws/de":YYY, "http://www.sample.com/ws/
>> de":XXX}' is
>> expected.
>> at
>> org
>> .apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:
>> 207)
>> at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:
>> 63)
>> 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:
>> 220)
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
>> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:
>> 73)
>> at
>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:
>> 170)
>> at $Proxy44.createIdentity(Unknown Source)
>>
>> Does anyone have any ideas what is going on!? This seems to be only
>> on the
>> client side!
>>
>> Am using cxf 2.0.5 and it's jaxb jars (jaxb 2.0.x)
>>
>> Thanks
>>
>> --
>> View this message in context:
>> http://www.nabble.com/JAXB-2.0-schema-validation-tp17779938p17779938.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>
> ---
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
>
>
>
>
>
--
View this message in context: http://www.nabble.com/JAXB-2.0-schema-validation-tp17779938p17797076.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: JAXB 2.0 schema validation
Posted by Daniel Kulp <dk...@apache.org>.
Looking at your spring config, it doesn't look like you are using a
wsdlLocation. Thus, the schema that you are validating against is
one that is generated from the JAXB beans. Since the schema -> JAXB
beans -> schema is a lossy process, the resulting schema may not match
the exact schema that your service is providing.
Dan
On Jun 11, 2008, at 10:59 AM, Adrian C wrote:
>
> Hi,
>
> I have a consumer of a web service which is created using
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean via spring. I seem to be
> having
> an issue where the validation things that optional elements are
> mandatory!
>
> Am getting:
> org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-complex-
> type.2.4.b:
> The content of element 'KKK' is not complete. One of
> '{"http://www.sample.com/ws/de":YYY, "http://www.sample.com/ws/
> de":XXX}' is
> expected.
> at
> org
> .apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:
> 207)
> at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:
> 63)
> 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:
> 220)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:
> 73)
> at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:
> 170)
> at $Proxy44.createIdentity(Unknown Source)
>
> Does anyone have any ideas what is going on!? This seems to be only
> on the
> client side!
>
> Am using cxf 2.0.5 and it's jaxb jars (jaxb 2.0.x)
>
> Thanks
>
> --
> View this message in context: http://www.nabble.com/JAXB-2.0-schema-validation-tp17779938p17779938.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: Antwort: JAXB 2.0 schema validation [Virus checked]
Posted by Adrian C <ad...@gmail.com>.
the request looks something like this:
<complexType name="Request">
<sequence>
<element name="Element1" type="tns:Element1Type" minOccurs="0"/>
<element name="Element2" type="tns:Element2Type" minOccurs="0"/>
<element name="Element3" type="tns:Element3Type" minOccurs="0"/>
</sequence>
</complexType>
<complexType name="Element1Type" >
<sequence>
<element name="Data1" type="string"></element>
</sequence>
</complexType>
<complexType name="Element2Type" >
<sequence>
<element name="Data2" type="string"></element>
</sequence>
</complexType>
<complexType name="Element3Type" >
<sequence>
<element name="Data3" type="string"></element>
</sequence>
</complexType>
jan.minaroviech wrote:
>
> Hard to help without any sample data and xsd
>
>
>
>
> Adrian C <ad...@gmail.com>
> 06/11/2008 16:59
> Bitte antworten an
> users@cxf.apache.org
>
>
> An
> users@cxf.apache.org
> Kopie
>
> Thema
> JAXB 2.0 schema validation [Virus checked]
>
>
>
>
>
>
>
> Hi,
>
> I have a consumer of a web service which is created using
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean via spring. I seem to be having
> an issue where the validation things that optional elements are mandatory!
>
> Am getting:
> org.apache.cxf.interceptor.Fault: Marshalling Error:
> cvc-complex-type.2.4.b:
> The content of element 'KKK' is not complete. One of
> '{"http://www.sample.com/ws/de":YYY, "http://www.sample.com/ws/de":XXX}'
> is
> expected.
> at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:207)
> at
> org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:63)
> 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:220)
> at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
> at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
> at
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:170)
> at $Proxy44.createIdentity(Unknown Source)
>
> Does anyone have any ideas what is going on!? This seems to be only on the
> client side!
>
> Am using cxf 2.0.5 and it's jaxb jars (jaxb 2.0.x)
>
> Thanks
>
> --
> View this message in context:
> http://www.nabble.com/JAXB-2.0-schema-validation-tp17779938p17779938.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
>
>
>
>
--
View this message in context: http://www.nabble.com/JAXB-2.0-schema-validation-tp17779938p17780355.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Antwort: JAXB 2.0 schema validation [Virus checked]
Posted by Adrian C <ad...@gmail.com>.
Some extra information - how I create the consumer...
<bean id="ServiceManagementConsumerFactory"
class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean"
parent="abstractConsumerFactory">
<property name="serviceClass"
value="com.blah.ws.de.servicemanagement.ServiceManagementV1" />
<property name="address" value="${address}/ServiceManagementV1" />
</bean>
<bean id="serviceManagement"
class="com.blah.ws.de.servicemanagement.ServiceManagementV1"
factory-bean="ServiceManagementConsumerFactory"
factory-method="create">
</bean>
<bean id="abstractConsumerFactory"
class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean" abstract="true">
<property name="properties">
<props>
<prop
key="schema-validation-enabled">${schema-validation-enabled}</prop>
<prop key="mtom-enabled">${mtom-enabled}</prop>
</props>
</property>
<property name="features">
<list>
<bean
class="org.apache.cxf.ws.addressing.WSAddressingFeature">
<property name="usingAddressingAdvisory"
value="true" />
</bean>
</list>
</property>
<property name="outInterceptors">
<list>
</list>
</property>
<property name="inInterceptors">
<list>
</list>
</property>
</bean>
I am afraid that I cannot post the wsdl..
jan.minaroviech wrote:
>
> Hard to help without any sample data and xsd
>
>
>
>
> Adrian C <ad...@gmail.com>
> 06/11/2008 16:59
> Bitte antworten an
> users@cxf.apache.org
>
>
> An
> users@cxf.apache.org
> Kopie
>
> Thema
> JAXB 2.0 schema validation [Virus checked]
>
>
>
>
>
>
>
> Hi,
>
> I have a consumer of a web service which is created using
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean via spring. I seem to be having
> an issue where the validation things that optional elements are mandatory!
>
> Am getting:
> org.apache.cxf.interceptor.Fault: Marshalling Error:
> cvc-complex-type.2.4.b:
> The content of element 'KKK' is not complete. One of
> '{"http://www.sample.com/ws/de":YYY, "http://www.sample.com/ws/de":XXX}'
> is
> expected.
> at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:207)
> at
> org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:63)
> 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:220)
> at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
> at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
> at
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:170)
> at $Proxy44.createIdentity(Unknown Source)
>
> Does anyone have any ideas what is going on!? This seems to be only on the
> client side!
>
> Am using cxf 2.0.5 and it's jaxb jars (jaxb 2.0.x)
>
> Thanks
>
> --
> View this message in context:
> http://www.nabble.com/JAXB-2.0-schema-validation-tp17779938p17779938.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
>
>
>
>
--
View this message in context: http://www.nabble.com/JAXB-2.0-schema-validation-tp17779938p17780281.html
Sent from the cxf-user mailing list archive at Nabble.com.
Antwort: JAXB 2.0 schema validation [Virus checked]
Posted by ja...@external.t-mobile.at.
Hard to help without any sample data and xsd
Adrian C <ad...@gmail.com>
06/11/2008 16:59
Bitte antworten an
users@cxf.apache.org
An
users@cxf.apache.org
Kopie
Thema
JAXB 2.0 schema validation [Virus checked]
Hi,
I have a consumer of a web service which is created using
org.apache.cxf.jaxws.JaxWsProxyFactoryBean via spring. I seem to be having
an issue where the validation things that optional elements are mandatory!
Am getting:
org.apache.cxf.interceptor.Fault: Marshalling Error:
cvc-complex-type.2.4.b:
The content of element 'KKK' is not complete. One of
'{"http://www.sample.com/ws/de":YYY, "http://www.sample.com/ws/de":XXX}'
is
expected.
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:207)
at
org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:63)
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:220)
at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
at
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:170)
at $Proxy44.createIdentity(Unknown Source)
Does anyone have any ideas what is going on!? This seems to be only on the
client side!
Am using cxf 2.0.5 and it's jaxb jars (jaxb 2.0.x)
Thanks
--
View this message in context:
http://www.nabble.com/JAXB-2.0-schema-validation-tp17779938p17779938.html
Sent from the cxf-user mailing list archive at Nabble.com.