You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by depstei2 <de...@umd.edu> on 2008/04/01 23:07:23 UTC

Re: Webservice client sending null parameters to host

I am getting the same error, and after debugging I have come to the same
piece of code in DocLiteralInInterceptor.  Has anyone come up with a
solution?


Mayank Mishra-2 wrote:
> 
> G'day all,
> 
> I faced the same problem using JAXB binding, I debuged it,
> 
> The code in method getPara() of DocLiteralInInterceptor class
>  >>>
> parameters.put(part, null);
> <<<
> 
> puts null parameters in the MessageContentsLists instance.
> 
> replacing it with,
> 
> <<<
> parameters.put(part, dr.read(part, xmlReader));
>  >>>
> 
> results in right behavior.
> 
> I may be wrong, but sharing my own experience with you all.
> 
> With Regards,
> Mayank
> 
> Daniel Kulp wrote:
>> Any chance you can send a sample project that shows the problem?   Kind 
>> of hard to diagnos this without more details.   What version of CXF?  
>> Code first/wsdl first?   Can I see the wsdl?  Can you capture the soap 
>> message?   JAXB/Aegis? etc....
>>
>>
>>
>> Dan
>>
>> On Friday 08 February 2008, mrsv wrote:
>>   
>>> I have a cxf webservice and a client generated using wsdl2java. When
>>> the client tries to contact the service the parameters are being null.
>>> I am unable to figure out the reason.Tried including all the jars from
>>> cxf.
>>>
>>> Any answers are appreciated.
>>>
>>> Thanks
>>>     
>>
>>
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Webservice-client-sending-null-parameters-to-host-tp15368060p16424980.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Webservice client sending null parameters to host

Posted by kislaykishore <ki...@gmail.com>.
Did not find any success with Interceptors.
Finally used wsimport to generate clients as described  here
<http://stackoverflow.com/questions/4172118/web-service-client-given-wsdl>  

This is working fine now.

Thanks



--
View this message in context: http://cxf.547215.n5.nabble.com/Webservice-client-sending-null-parameters-to-host-tp555284p5721365.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Webservice client sending null parameters to host

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

You can change the wsdl used for client side to make it use qualified name, you really should use same interface description between client and server.
Or you can use cxf transform feature[1] which can change input/output message for you.

[1]http://cxf.apache.org/docs/transformationfeature.html
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-1-3, at 上午3:09, kislaykishore wrote:

> Thanks a lot for you reply.
> 
> Choosing the aegis route will cause much pain.
> Can't we modify the CXF client somehow to generate and receive qualified
> attributes?
> Should I use interceptors?
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Webservice-client-sending-null-parameters-to-host-tp555284p5720894.html
> Sent from the cxf-user mailing list archive at Nabble.com.


Re: Webservice client sending null parameters to host

Posted by kislaykishore <ki...@gmail.com>.
Thanks a lot for you reply.

Choosing the aegis route will cause much pain.
Can't we modify the CXF client somehow to generate and receive qualified
attributes?
Should I use interceptors?



--
View this message in context: http://cxf.547215.n5.nabble.com/Webservice-client-sending-null-parameters-to-host-tp555284p5720894.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Webservice client sending null parameters to host

Posted by Daniel Kulp <dk...@apache.org>.
On Dec 30, 2012, at 5:52 AM, kislaykishore <ki...@gmail.com> wrote:

> I am facing the same qualified vs unqualified issue.
> I am trying to develop a java client to a CXF web service. The service is
> using Aegis for databinding.
> The client is honoring the namespaces for operations but the attributes in
> the request are not qualified and hence the corresponding arguments are
> received as nulls at the service end. Also, the service sends qualified
> return values in response which the client is unable to understand.
> Could someone please help me with this.

You'll likely need to flip to JAXB instead of Aegis if you need unqualified schemas.   Aegis only uses qualified schemas.

Dan


> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Webservice-client-sending-null-parameters-to-host-tp555284p5720866.html
> Sent from the cxf-user mailing list archive at Nabble.com.

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


Re: Webservice client sending null parameters to host

Posted by kislaykishore <ki...@gmail.com>.
I am facing the same qualified vs unqualified issue.
I am trying to develop a java client to a CXF web service. The service is
using Aegis for databinding.
The client is honoring the namespaces for operations but the attributes in
the request are not qualified and hence the corresponding arguments are
received as nulls at the service end. Also, the service sends qualified
return values in response which the client is unable to understand.
Could someone please help me with this.



--
View this message in context: http://cxf.547215.n5.nabble.com/Webservice-client-sending-null-parameters-to-host-tp555284p5720866.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Webservice client sending null parameters to host

Posted by Willem Jiang <wi...@gmail.com>.
FYI, the jetty engine is just used for implementing the http transport, 
it will not modify any of the Request or Response message.
I think there may be different xml library in the WAR class path and the 
in the jetty embedded class path.

Willem
depstei2 wrote:
> Hi Dan, thanks for your help,
> You were right about the qualified vs unqualified issue.  The weird thing
> is, if I deploy in tomcat or jetty as a WAR it works fine, but if I deploy
> in jetty embedded it fails. The message being sent was this:
> <soap:Envelope
>         xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>         <soap:Body>
>                 <ns2:createPersonTypeInfo
>                         xmlns:ns2="http://myNamespace">
>                         <personTypeInfo name="PersonType1"> 
> and it causes null parameters, so using soap UI I changed the message by
> adding a namespace prefix:
> <soap:Envelope
>         xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>         <soap:Body>
>                 <ns2:createPersonTypeInfo
>                         xmlns:ns2="http://myNamespace">
>                         <ns2:personTypeInfo name="PersonType1"> 
> and it worked.  
>
> I then removed @XmlRootElement from my PersonTypeInfo class and it works
> without using the namespace prefix. I wonder why jetty embedded is causing
> problems!
> Thanks again,
> -Daniel
>
>
> dkulp wrote:
>   
>> I'm pretty sure that if your hitting this, the soap message is invalid 
>> for the service.  Usually, it's one of two things:
>>
>> 1) A qualified vs unqualified issue.   The elements are coming in 
>> non-qulalified when the service is expecting qualified or vice-versa.
>>
>> 2) The elements are coming in the wrong order.   I think one of the perl 
>> soap toolkits does this sometimes. 
>>
>> In anycase, a testcase would be a big help.
>>
>> Dan
>>
>>
>>
>>     
>
>   


Re: Webservice client sending null parameters to host

Posted by depstei2 <de...@umd.edu>.
Hi Dan, thanks for your help,
You were right about the qualified vs unqualified issue.  The weird thing
is, if I deploy in tomcat or jetty as a WAR it works fine, but if I deploy
in jetty embedded it fails. The message being sent was this:
<soap:Envelope
        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Body>
                <ns2:createPersonTypeInfo
                        xmlns:ns2="http://myNamespace">
                        <personTypeInfo name="PersonType1"> 
and it causes null parameters, so using soap UI I changed the message by
adding a namespace prefix:
<soap:Envelope
        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Body>
                <ns2:createPersonTypeInfo
                        xmlns:ns2="http://myNamespace">
                        <ns2:personTypeInfo name="PersonType1"> 
and it worked.  

I then removed @XmlRootElement from my PersonTypeInfo class and it works
without using the namespace prefix. I wonder why jetty embedded is causing
problems!
Thanks again,
-Daniel


dkulp wrote:
> 
> 
> I'm pretty sure that if your hitting this, the soap message is invalid 
> for the service.  Usually, it's one of two things:
> 
> 1) A qualified vs unqualified issue.   The elements are coming in 
> non-qulalified when the service is expecting qualified or vice-versa.
> 
> 2) The elements are coming in the wrong order.   I think one of the perl 
> soap toolkits does this sometimes. 
> 
> In anycase, a testcase would be a big help.
> 
> Dan
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Webservice-client-sending-null-parameters-to-host-tp15368060p16447092.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Webservice client sending null parameters to host

Posted by Daniel Kulp <dk...@apache.org>.
I'm pretty sure that if your hitting this, the soap message is invalid 
for the service.  Usually, it's one of two things:

1) A qualified vs unqualified issue.   The elements are coming in 
non-qulalified when the service is expecting qualified or vice-versa.

2) The elements are coming in the wrong order.   I think one of the perl 
soap toolkits does this sometimes. 

In anycase, a testcase would be a big help.

Dan



On Tuesday 01 April 2008, depstei2 wrote:
> I am getting the same error, and after debugging I have come to the
> same piece of code in DocLiteralInInterceptor.  Has anyone come up
> with a solution?
>
> Mayank Mishra-2 wrote:
> > G'day all,
> >
> > I faced the same problem using JAXB binding, I debuged it,
> >
> > The code in method getPara() of DocLiteralInInterceptor class
> >
> > parameters.put(part, null);
> > <<<
> >
> > puts null parameters in the MessageContentsLists instance.
> >
> > replacing it with,
> >
> > <<<
> > parameters.put(part, dr.read(part, xmlReader));
> >
> >
> > results in right behavior.
> >
> > I may be wrong, but sharing my own experience with you all.
> >
> > With Regards,
> > Mayank
> >
> > Daniel Kulp wrote:
> >> Any chance you can send a sample project that shows the problem?  
> >> Kind of hard to diagnos this without more details.   What version
> >> of CXF? Code first/wsdl first?   Can I see the wsdl?  Can you
> >> capture the soap message?   JAXB/Aegis? etc....
> >>
> >>
> >>
> >> Dan
> >>
> >> On Friday 08 February 2008, mrsv wrote:
> >>> I have a cxf webservice and a client generated using wsdl2java.
> >>> When the client tries to contact the service the parameters are
> >>> being null. I am unable to figure out the reason.Tried including
> >>> all the jars from cxf.
> >>>
> >>> Any answers are appreciated.
> >>>
> >>> Thanks



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