Webservice client sending null parameters to host

View: New views
8 Messages — Rating Filter:   Alert me  

Webservice client sending null parameters to host

by mrsv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Parent Message unknown Re: Webservice client sending null parameters to host

by Mehmet Imga :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am having same kind of problem. Client sends request successfully and response is OK in XML format but CXF cannot bind SOAP result to Java object so it returns null.

Any answers are appreciated.

Thanks


----- Original Message ----
From: mrsv <swathir@...>
To: cxf-user@...
Sent: Friday, February 8, 2008 10:09:35 PM
Subject: Webservice client sending null parameters to host


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-tp15368060p15368060.html
Sent from the cxf-user mailing list archive at Nabble.com.


      Get a sneak peak at messages with a handy reading pane with All new Yahoo! Mail: http://ca.promos.yahoo.com/newmail/overview2/

Re: Webservice client sending null parameters to host

by dkulp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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@...
http://www.dankulp.com/blog

Re: Webservice client sending null parameters to host

by Mayank Mishra-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
>>    
>
>
>
>  


Re: Webservice client sending null parameters to host

by depstei2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
>>    
>
>
>
>  

Re: Webservice client sending null parameters to host

by dkulp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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@...
http://www.dankulp.com/blog

Re: Webservice client sending null parameters to host

by depstei2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

by willem.jiang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
>>
>>
>>
>>    
>
>