axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kraus, David" <dkr...@MicroStrategy.com>
Subject RE: Nested return types from POJO web service method -shouldn't this work?
Date Fri, 29 Feb 2008 01:27:43 GMT
I haven't found any documentation that definitively says that the POJO approach doesn't handle
nested complex types, but I am getting the impression that the POJO approach is really designed
for simple services, and that nested complex types need to be handled with the databinding
provided by automatically generated service-side serialization code.

 

I generated a client that uses ADB and complex nested types sent successfully as SOAP to the
POJO service were dropped. Also, any complex nested type that is returned from a POJO webservice
API call results in an empty element in the SOAP body, so it is clear that the absence of
service-side serialization is the problem.

 

I am not sure if there is a way to get around this behavior when using POJOs, but for now,
I am going back to my original method of always generating service-side serialization code,
and avoiding the POJO approach.

 

Dave

 

________________________________

From: Wesley Mesquita [mailto:wesleymesquita@gmail.com] 
Sent: Thursday, February 28, 2008 4:43 PM
To: axis-user@ws.apache.org
Subject: Re: Nested return types from POJO web service method -shouldn't this work?

 

I am having the same problem here, I tried to follow the documentation at axis2 site but I
didnĀ“t help me. Is there any old thread in this list discussing this problem? Or some other
examples that show how to do this?

Thanks.
 

On Thu, Feb 28, 2008 at 7:48 PM, Kraus, David <dkraus@microstrategy.com> wrote:

So the question is:

 

In order to support a complex nested object as a return type, using the POJO mechanism, is
it necessary to also generate the server-side serialization code (adb databinding)?

 

________________________________

From: Kraus, David 
Sent: Thursday, February 28, 2008 11:18 AM
To: 'axis-user@ws.apache.org'
Subject: Nested return types from POJO web service method -shouldn't this work?

 

I have defined a POJO service which has a method which returns an object which contains fields
that are nested non-simple objects.

 

So given the Pojo class which implements ReturnInfoObject, the InfoObj object being returned
contains a field nest which is defined by the NestedObj object.

 

public class Pojo

{

   public InfoObj ReturnInfoObject()

   {

      ...

   }

}

 

 

public class InfoObj

{

    private java.lang.String val;

    private NestedObj nest;

}

 

public class NestedObj

{

   private java.lang.String nestedVal;

}

 

When my client calls the deployed Pojo service, the val field of InfoObj shows up in the soap
trace, but the nest field is empty, even when it has been correctly allocated on the service
side.

 

It appears that the service side does not know how to serialize the nested object. In the
past, I have used nested objects like this fine, when defining non-POJO services, by using
wsdl2java to generate the service-side serialization code. It was my understanding that I
wouldn't have to generate this service-side serialization code, when using the POJO approach.
Was my assumption incorrect? Am I missing something?

 

My POJO approach was basically to compile the Pojo class and all its supporting classes, build
an aar file and place it in the Axis2 services directory. This seems to work, except the return
object's nested fields are not being serialized by the service.

 

Thanks, Dave

 




-- 
Wesley Mesquita
LIS/IC - UNICAMP
[skype: wesley.mesquita] 


Mime
View raw message