You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by jmi <jm...@gmail.com> on 2011/03/28 18:55:57 UTC

CXF client received response with null object

Hi,

I'm not exactly sure if this problem was encountered by CXF user and
resolved. If so, please execuse me and point me to the relevant thread.

First, a little background. We have an Axis-based Web Services and we have
an Axis-based client as well to test out our services. Due to a backward
compatibility isssue in Axis, mainly its bean
deserializer on an older client side has issue deserialize an obeject
(complexType) which has more element(s) defined for a newer server.

So, I'm trying to create a CXF-based client to replace the existing
Axis-based client.

Here is my problem with CXF client:

I'm very new to CXF. I managed to modify an Axis-generated wsdl (which was
used for Axis-based client) to be used by CXF wsdl2java to generate clent
stub. 
The CXF-based client can then successfully make a GetOrderByOrderID request
to the server and the server is returning a correct response which can be
seen in server log.

However, by the time that the client received the response, although
GetOrderByOrderIDOutput itself is NOT null, its contained OrderDetail object
is null. Again, server 
log showed that it was returning a valid OrderDetail in
GetOrderByOrderIDOutput.

Why couldn't the client get it right? I heard that adding
elementFormDefault="qualified" in  tag of wsdl might solve the problem. Is
that true? I tried it and it didn't seem to help. Or there is something 
else needs to be done in order for the nested complexType deserialized
correctly on the client side?

Below is the WSDL modified from its original Axis-generated version in order
for CXF wsdl2java to generate the client stub.

I"d appreciate if anyone can shed some light.

Thanks,
Jason

<?xml version="1.0" encoding="UTF-8"?>


 
   
     
     
     
     
     
       
         
         
       
     
     
       
         
           
         
       
     
     
       
         
           
         
       
     
   
 

 
   
 

 
   
 

 
   
     
     
   
 

 
   
   
     
     
       
     
     
       
     
   
 

 
   
     
   
 





--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-client-received-response-with-null-object-tp4267930p4267930.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXF client received response with null object

Posted by jmi <jm...@gmail.com>.
Hi Dan,

I managed to use Eclipse's TCP/IP Monitor to capture both the request and
response soap messages. The response soap messages appeared to return
OrderDetail fine.

Hope you'll find some clue for me. Here they are...

Thanks for your time.
Jason

Client request soap message:





126070953
<
/ns1:getOrderByOrderID>


Server response soap message:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>











0



SS001
126070953




--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-client-received-response-with-null-object-tp4267930p4268581.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXF client received response with null object

Posted by jmi <jm...@gmail.com>.
Hi Dan,

Thanks for the response! I got stuck with this problem for a week. How could
I enable/get soap messages? I'm running the CXF client as a Java app. The
server is deployed in tomcat and it's server.log does not show any soap
messages.

Jason

--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-client-received-response-with-null-object-tp4267930p4268140.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXF client received response with null object

Posted by Daniel Kulp <dk...@apache.org>.
We'd likely need to see the soap message in addition to the wsdl.   Normally, 
it does have something to do with the qualifications, but it's hard to say.

Dan



On Monday 28 March 2011 12:55:57 PM jmi wrote:
> Hi,
> 
> I'm not exactly sure if this problem was encountered by CXF user and
> resolved. If so, please execuse me and point me to the relevant thread.
> 
> First, a little background. We have an Axis-based Web Services and we have
> an Axis-based client as well to test out our services. Due to a backward
> compatibility isssue in Axis, mainly its bean
> deserializer on an older client side has issue deserialize an obeject
> (complexType) which has more element(s) defined for a newer server.
> 
> So, I'm trying to create a CXF-based client to replace the existing
> Axis-based client.
> 
> Here is my problem with CXF client:
> 
> I'm very new to CXF. I managed to modify an Axis-generated wsdl (which was
> used for Axis-based client) to be used by CXF wsdl2java to generate clent
> stub.
> The CXF-based client can then successfully make a GetOrderByOrderID request
> to the server and the server is returning a correct response which can be
> seen in server log.
> 
> However, by the time that the client received the response, although
> GetOrderByOrderIDOutput itself is NOT null, its contained OrderDetail
> object is null. Again, server
> log showed that it was returning a valid OrderDetail in
> GetOrderByOrderIDOutput.
> 
> Why couldn't the client get it right? I heard that adding
> elementFormDefault="qualified" in  tag of wsdl might solve the problem. Is
> that true? I tried it and it didn't seem to help. Or there is something
> else needs to be done in order for the nested complexType deserialized
> correctly on the client side?
> 
> Below is the WSDL modified from its original Axis-generated version in
> order for CXF wsdl2java to generate the client stub.
> 
> I"d appreciate if anyone can shed some light.
> 
> Thanks,
> Jason
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> 
> 
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/CXF-client-received-response-with-null-obj
> ect-tp4267930p4267930.html Sent from the cxf-user mailing list archive at
> Nabble.com.

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