You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ja...@external.t-mobile.at on 2008/04/25 15:58:27 UTC

xml schema validation bug [Virus checked]

Hello,

when XML schema validation is enabled, and mandatory element is missing 
(probably the same for any other error) in CXF-generated response, then 
response is invalid in some cases.

E.g. such response is generated from modified wsdl_first sample:

<soap:Envelope 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><sayHiResponse 
xmlns="http://apache.org/hello_world_soap_http/types"><responseType>Executing 
operation sayHi1</responseType><responseType2><responseType>THIS IS 
IMPORTANT .. VERY LONG TEXT ..SOMETHING WILL BE flushed probably and 
that's why cannot be removed later when fault should replace content 
..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
 .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
 .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
 ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................<soap:Fault><faultcode>soap:Server</faultcode><faultstring>Marshalli
ng Error: cvc-complex-type.2.4.a: Invalid content was found starting with 
element 'responseType2'. One of 
'{"http://apache.org/hello_world_soap_http/types":responseType}' is 
expected.</faultstring></soap:Fault></soap:Body></soap:Envelope>


in attachment you can find  modified sample I used to show the bug in 
simple enough project. Just do "ant server" and then invoke sayHi from 
soapUi or other tool, You should see response listed above.



for me it looks like a bug.

tested with apache-cxf-2.1-20080422.181716-3-src.zip and also with one of 
older 2.1 snapshots

best regards
jano

Re: xml schema validation bug [Virus checked]

Posted by Daniel Kulp <dk...@apache.org>.
This is definitely a bug, but there will be a performance penalty to fix 
it.  Please log a bug at
https://issues.apache.org/jira/browse/CXF


Basically, fixing this will require breaking the streaming.  Most likely, 
if validation is turned on, we'll need to buffer the message to a cached 
stream, and if that doesn't result in a error, then flush the buffer to 
the real output stream.  That will be a little bit slower, but would fix 
this issue.

Dan


On Friday 25 April 2008, jan.minaroviech@external.t-mobile.at wrote:
> Hello,
>
> when XML schema validation is enabled, and mandatory element is
> missing (probably the same for any other error) in CXF-generated
> response, then response is invalid in some cases.
>
> E.g. such response is generated from modified wsdl_first sample:
>
> <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><say
>HiResponse
> xmlns="http://apache.org/hello_world_soap_http/types"><responseType>Ex
>ecuting operation
> sayHi1</responseType><responseType2><responseType>THIS IS IMPORTANT ..
> VERY LONG TEXT ..SOMETHING WILL BE flushed probably and that's why
> cannot be removed later when fault should replace content
> ......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>....................................................................
> ......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>...................................................................
> ......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>...................................................................
> ......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>.......................................................................
>..........................................<soap:Fault><faultcode>soap:S
>erver</faultcode><faultstring>Marshalli ng Error:
> cvc-complex-type.2.4.a: Invalid content was found starting with
> element 'responseType2'. One of
> '{"http://apache.org/hello_world_soap_http/types":responseType}' is
> expected.</faultstring></soap:Fault></soap:Body></soap:Envelope>
>
>
> in attachment you can find  modified sample I used to show the bug in
> simple enough project. Just do "ant server" and then invoke sayHi from
> soapUi or other tool, You should see response listed above.
>
>
>
> for me it looks like a bug.
>
> tested with apache-cxf-2.1-20080422.181716-3-src.zip and also with one
> of older 2.1 snapshots
>
> best regards
> jano



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: xml schema validation bug [Virus checked]

Posted by Benson Margulies <bi...@gmail.com>.
Please submit this to JIRA.

On Fri, Apr 25, 2008 at 10:07 AM, <ja...@external.t-mobile.at>
wrote:

> seems that attachments are not supported by list, or?
> here it is
> www.realtime.sk/~jmi/wsdl_first.rar<http://www.realtime.sk/%7Ejmi/wsdl_first.rar>
>
>
>
>
> jan.minaroviech@external.t-mobile.at
> 04/25/2008 15:58
> Bitte antworten an
> users@cxf.apache.org
>
>
> An
> users@cxf.apache.org, issues@cxf.apache.org
> Kopie
>
> Thema
> xml schema validation bug  [Virus checked]
>
>
>
>
>
>
>
> Hello,
>
> when XML schema validation is enabled, and mandatory element is missing
> (probably the same for any other error) in CXF-generated response, then
> response is invalid in some cases.
>
> E.g. such response is generated from modified wsdl_first sample:
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/
> "><soap:Body><sayHiResponse xmlns="
> http://apache.org/hello_world_soap_http/types"><responseType>Executing
> operation sayHi1</responseType><responseType2><responseType>THIS IS
> IMPORTANT .. VERY LONG TEXT ..SOMETHING WILL BE flushed probably and
> that's why cannot be removed later when fault should replace content
>
> .........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
>
> ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
 .
>
> ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
 .
>
> .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................<soap:Fault><faultcode>soap:Server</faultcode><faultstring>Marshalli
>
> ng Error: cvc-complex-type.2.4.a: Invalid content was found starting with
> element 'responseType2'. One of '{"
> http://apache.org/hello_world_soap_http/types":responseType}' is
> expected.</faultstring></soap:Fault></soap:Body></soap:Envelope>
>
>
> in attachment you can find  modified sample I used to show the bug in
> simple enough project. Just do "ant server" and then invoke sayHi from
> soapUi or other tool, You should see response listed above.
>
>
>
> for me it looks like a bug.
>
> tested with apache-cxf-2.1-20080422.181716-3-src.zip and also with one of
> older 2.1 snapshots
>
> best regards
> jano
>

Antwort: xml schema validation bug [Virus checked]

Posted by ja...@external.t-mobile.at.
seems that attachments are not supported by list, or?
here it is
www.realtime.sk/~jmi/wsdl_first.rar




jan.minaroviech@external.t-mobile.at 
04/25/2008 15:58
Bitte antworten an
users@cxf.apache.org


An
users@cxf.apache.org, issues@cxf.apache.org
Kopie

Thema
xml schema validation bug  [Virus checked]







Hello, 

when XML schema validation is enabled, and mandatory element is missing 
(probably the same for any other error) in CXF-generated response, then 
response is invalid in some cases. 

E.g. such response is generated from modified wsdl_first sample: 

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/
"><soap:Body><sayHiResponse xmlns="
http://apache.org/hello_world_soap_http/types"><responseType>Executing 
operation sayHi1</responseType><responseType2><responseType>THIS IS 
IMPORTANT .. VERY LONG TEXT ..SOMETHING WILL BE flushed probably and 
that's why cannot be removed later when fault should replace content 
......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................<soap:Fault><faultcode>soap:Server</faultcode><faultstring>Marshalli 

ng Error: cvc-complex-type.2.4.a: Invalid content was found starting with 
element 'responseType2'. One of '{"
http://apache.org/hello_world_soap_http/types":responseType}' is 
expected.</faultstring></soap:Fault></soap:Body></soap:Envelope> 


in attachment you can find  modified sample I used to show the bug in 
simple enough project. Just do "ant server" and then invoke sayHi from 
soapUi or other tool, You should see response listed above. 



for me it looks like a bug. 

tested with apache-cxf-2.1-20080422.181716-3-src.zip and also with one of 
older 2.1 snapshots 

best regards 
jano

Antwort: xml schema validation bug [Virus checked]

Posted by ja...@external.t-mobile.at.
seems that attachments are not supported by list, or?
here it is
www.realtime.sk/~jmi/wsdl_first.rar




jan.minaroviech@external.t-mobile.at 
04/25/2008 15:58
Bitte antworten an
users@cxf.apache.org


An
users@cxf.apache.org, issues@cxf.apache.org
Kopie

Thema
xml schema validation bug  [Virus checked]







Hello, 

when XML schema validation is enabled, and mandatory element is missing 
(probably the same for any other error) in CXF-generated response, then 
response is invalid in some cases. 

E.g. such response is generated from modified wsdl_first sample: 

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/
"><soap:Body><sayHiResponse xmlns="
http://apache.org/hello_world_soap_http/types"><responseType>Executing 
operation sayHi1</responseType><responseType2><responseType>THIS IS 
IMPORTANT .. VERY LONG TEXT ..SOMETHING WILL BE flushed probably and 
that's why cannot be removed later when fault should replace content 
......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................<soap:Fault><faultcode>soap:Server</faultcode><faultstring>Marshalli 

ng Error: cvc-complex-type.2.4.a: Invalid content was found starting with 
element 'responseType2'. One of '{"
http://apache.org/hello_world_soap_http/types":responseType}' is 
expected.</faultstring></soap:Fault></soap:Body></soap:Envelope> 


in attachment you can find  modified sample I used to show the bug in 
simple enough project. Just do "ant server" and then invoke sayHi from 
soapUi or other tool, You should see response listed above. 



for me it looks like a bug. 

tested with apache-cxf-2.1-20080422.181716-3-src.zip and also with one of 
older 2.1 snapshots 

best regards 
jano