You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sunil Bapat <su...@gmail.com> on 2014/08/29 16:02:00 UTC

Null params after upgrading to 2.7.11

We upgraded from CXF 2.6.8 to 2.7.11, and are running into issues where the
web service parameters are coming in as null in 2.7.11, where they used to
work in 2.6.8.

In the WSDL (code first), the schema is defined with
elementFormDefault="unqualified" and attributeFormDefault="unqualified".
There is no namespace defined for @WebParam.

In 2.6.8, we could send in SOAP requests with namespaces in the params or
without.
e.g. Here's are the corresponding request snippets for the webparam
elements.
<xyz:getData> without namespaces in params
<getData xmlns="http://test.com"> with namespaces in params

We have multiple clients to these web services, which sent either of these
types of request, and both worked in 2.6.8. In 2.7.11, only the requests
without param namespaces works. The requests with param namespaces result
in null parameters in the web service.

Looking at the discussions below , it appears that it is not supposed to
work both ways. Is that correct?
http://cxf.547215.n5.nabble.com/Figuring-out-why-params-turn-to-null-td562045.html
http://cxf.547215.n5.nabble.com/UnmarshallingExceptions-after-upgrading-to-cxf-2-7-10-td5742636.html

Has the behavior changed between these versions? Is it a bug that it worked
with or without param namespaces, or was that the expected behavior in
2.6.8? Is there any way we can configure 2.7.11, such that both requests
will continue to work as before?

We tried adding namespaces to the @WebParam, then it worked for a request
with namespaces in the param, but not without.

We tried a simple HelloWorld service, and that works both ways in 2.7.11.
However none of our real services work in 2.7.11. Any ideas or suggestions
as to what we can debug or configure?

Thanks

Re: Null params after upgrading to 2.7.11

Posted by Daniel Kulp <dk...@apache.org>.
On Sep 2, 2014, at 9:48 AM, Sunil Bapat <su...@gmail.com> wrote:

> No. We are using document/literal style. Will this fix change
> document/literal  behavior as well?

No.  This was just for RPC/Lit due to some vagueness in the spec and various implementations doing different things.


I’m not sure how this would have ever worked with 2.6.8 either.   In both cases, JAXB should have been completely rejecting the form that doesn’t match the schema (likely the one with namespaces).   More specifically, by default, it should throw an exception.   If you have a jaxb ValidationEventHandler setup (or turned off), it shouldn’t throw an exception, but it could then ignore the unknown elements and leave them as null.    It sounds like that’s what it’s doing now for you.

If you need this to work, I would suggest looking in the TransformationFeature:
http://cxf.apache.org/docs/transformationfeature.html

to manipulate the namespaces and such on the elements to match what JAXB is expecting.   That said, if clients are not generating requests that match the Schema, those clients should get fixed.


Dan




>> 2014-08-29 16:02 GMT+02:00 Sunil Bapat <su...@gmail.com>:
>>> We upgraded from CXF 2.6.8 to 2.7.11, and are running into issues where
>> the
>>> web service parameters are coming in as null in 2.7.11, where they used
>> to
>>> work in 2.6.8.
>>> 
>>> In the WSDL (code first), the schema is defined with
>>> elementFormDefault="unqualified" and attributeFormDefault="unqualified".
>>> There is no namespace defined for @WebParam.
>>> 
>>> In 2.6.8, we could send in SOAP requests with namespaces in the params or
>>> without.
>>> e.g. Here's are the corresponding request snippets for the webparam
>>> elements.
>>> <xyz:getData> without namespaces in params
>>> <getData xmlns="http://test.com"> with namespaces in params
>>> 
>>> We have multiple clients to these web services, which sent either of
>> these
>>> types of request, and both worked in 2.6.8. In 2.7.11, only the requests
>>> without param namespaces works. The requests with param namespaces result
>>> in null parameters in the web service.
>>> 
>>> Looking at the discussions below , it appears that it is not supposed to
>>> work both ways. Is that correct?
>>> 
>> http://cxf.547215.n5.nabble.com/Figuring-out-why-params-turn-to-null-td562045.html
>>> 
>> http://cxf.547215.n5.nabble.com/UnmarshallingExceptions-after-upgrading-to-cxf-2-7-10-td5742636.html
>>> 
>>> Has the behavior changed between these versions? Is it a bug that it
>> worked
>>> with or without param namespaces, or was that the expected behavior in
>>> 2.6.8? Is there any way we can configure 2.7.11, such that both requests
>>> will continue to work as before?
>>> 
>>> We tried adding namespaces to the @WebParam, then it worked for a request
>>> with namespaces in the param, but not without.
>>> 
>>> We tried a simple HelloWorld service, and that works both ways in 2.7.11.
>>> However none of our real services work in 2.7.11. Any ideas or
>> suggestions
>>> as to what we can debug or configure?
>>> 
>>> Thanks
>> 

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Null params after upgrading to 2.7.11

Posted by Sunil Bapat <su...@gmail.com>.
No. We are using document/literal style. Will this fix change
document/literal  behavior as well?

Thanks
Sunil.


On Tue, Sep 2, 2014 at 6:17 AM, Aki Yoshida <el...@gmail.com> wrote:

> do you have an RPC style service? If that is the case, could you try
> your scenario with 2.7.12?
>
> There was a code that was rejecting those "incorrectly"
> namespace-qualified parameters but we loosened this check with
> CXF-5827.
>
> regards, aki
>
> 2014-08-29 16:02 GMT+02:00 Sunil Bapat <su...@gmail.com>:
> > We upgraded from CXF 2.6.8 to 2.7.11, and are running into issues where
> the
> > web service parameters are coming in as null in 2.7.11, where they used
> to
> > work in 2.6.8.
> >
> > In the WSDL (code first), the schema is defined with
> > elementFormDefault="unqualified" and attributeFormDefault="unqualified".
> > There is no namespace defined for @WebParam.
> >
> > In 2.6.8, we could send in SOAP requests with namespaces in the params or
> > without.
> > e.g. Here's are the corresponding request snippets for the webparam
> > elements.
> > <xyz:getData> without namespaces in params
> > <getData xmlns="http://test.com"> with namespaces in params
> >
> > We have multiple clients to these web services, which sent either of
> these
> > types of request, and both worked in 2.6.8. In 2.7.11, only the requests
> > without param namespaces works. The requests with param namespaces result
> > in null parameters in the web service.
> >
> > Looking at the discussions below , it appears that it is not supposed to
> > work both ways. Is that correct?
> >
> http://cxf.547215.n5.nabble.com/Figuring-out-why-params-turn-to-null-td562045.html
> >
> http://cxf.547215.n5.nabble.com/UnmarshallingExceptions-after-upgrading-to-cxf-2-7-10-td5742636.html
> >
> > Has the behavior changed between these versions? Is it a bug that it
> worked
> > with or without param namespaces, or was that the expected behavior in
> > 2.6.8? Is there any way we can configure 2.7.11, such that both requests
> > will continue to work as before?
> >
> > We tried adding namespaces to the @WebParam, then it worked for a request
> > with namespaces in the param, but not without.
> >
> > We tried a simple HelloWorld service, and that works both ways in 2.7.11.
> > However none of our real services work in 2.7.11. Any ideas or
> suggestions
> > as to what we can debug or configure?
> >
> > Thanks
>

Re: Null params after upgrading to 2.7.11

Posted by Aki Yoshida <el...@gmail.com>.
do you have an RPC style service? If that is the case, could you try
your scenario with 2.7.12?

There was a code that was rejecting those "incorrectly"
namespace-qualified parameters but we loosened this check with
CXF-5827.

regards, aki

2014-08-29 16:02 GMT+02:00 Sunil Bapat <su...@gmail.com>:
> We upgraded from CXF 2.6.8 to 2.7.11, and are running into issues where the
> web service parameters are coming in as null in 2.7.11, where they used to
> work in 2.6.8.
>
> In the WSDL (code first), the schema is defined with
> elementFormDefault="unqualified" and attributeFormDefault="unqualified".
> There is no namespace defined for @WebParam.
>
> In 2.6.8, we could send in SOAP requests with namespaces in the params or
> without.
> e.g. Here's are the corresponding request snippets for the webparam
> elements.
> <xyz:getData> without namespaces in params
> <getData xmlns="http://test.com"> with namespaces in params
>
> We have multiple clients to these web services, which sent either of these
> types of request, and both worked in 2.6.8. In 2.7.11, only the requests
> without param namespaces works. The requests with param namespaces result
> in null parameters in the web service.
>
> Looking at the discussions below , it appears that it is not supposed to
> work both ways. Is that correct?
> http://cxf.547215.n5.nabble.com/Figuring-out-why-params-turn-to-null-td562045.html
> http://cxf.547215.n5.nabble.com/UnmarshallingExceptions-after-upgrading-to-cxf-2-7-10-td5742636.html
>
> Has the behavior changed between these versions? Is it a bug that it worked
> with or without param namespaces, or was that the expected behavior in
> 2.6.8? Is there any way we can configure 2.7.11, such that both requests
> will continue to work as before?
>
> We tried adding namespaces to the @WebParam, then it worked for a request
> with namespaces in the param, but not without.
>
> We tried a simple HelloWorld service, and that works both ways in 2.7.11.
> However none of our real services work in 2.7.11. Any ideas or suggestions
> as to what we can debug or configure?
>
> Thanks