RE: Nested return types from POJO web service method -shouldn't this work?
I have verified that I can correctly use nested return types in a POJO service. Now I need to figure out why my more complex POJO service is not working correctly Dave From: Kraus, David Sent: Thursday, February 28, 2008 10:40 PM To: axis-user@ws.apache.org Subject: RE: Nested return types from POJO web service method -shouldn't this work? Yes, I didn't show it, but my classes did have getters/setters, default public constructor, and basically obeyed the rules of a JavaBean. Dave From: Deepal Jayasinghe [mailto:[EMAIL PROTECTED] Sent: Fri 2/29/2008 1:01 AM To: axis-user@ws.apache.org Subject: Re: 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. Nope this can not be happen , however you need to remember that you class should be JavaBean (need to have getters and settes). I have tested this and working fine , in addition to that following link will be helpful for you to understand about Axis2 POJO. http://www.developer.com/java/other/article.php/10936_3726461_3 Thank you Deepal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] winmail.dat- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested return types from POJO web service method -shouldn't this work?
David- Take a look at http://commons.apache.org/beanutils/api/org/apache/commons/beanutils/Propert yUtilsBean.html specifically the copyProperties method.. copyProperties(java.lang.Object dest, java.lang.Object orig) As copyProperties method is a shallow copy I think you may want to handle *deep* copy programatically.. HTH M-- - Original Message - From: Kraus, David [EMAIL PROTECTED] To: Kraus, David [EMAIL PROTECTED]; axis-user@ws.apache.org Sent: Friday, February 29, 2008 1:02 PM Subject: RE: Nested return types from POJO web service method -shouldn't this work? I have verified that I can correctly use nested return types in a POJO service. Now I need to figure out why my more complex POJO service is not working correctly Dave From: Kraus, David Sent: Thursday, February 28, 2008 10:40 PM To: axis-user@ws.apache.org Subject: RE: Nested return types from POJO web service method -shouldn't this work? Yes, I didn't show it, but my classes did have getters/setters, default public constructor, and basically obeyed the rules of a JavaBean. Dave From: Deepal Jayasinghe [mailto:[EMAIL PROTECTED] Sent: Fri 2/29/2008 1:01 AM To: axis-user@ws.apache.org Subject: Re: 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. Nope this can not be happen , however you need to remember that you class should be JavaBean (need to have getters and settes). I have tested this and working fine , in addition to that following link will be helpful for you to understand about Axis2 POJO. http://www.developer.com/java/other/article.php/10936_3726461_3 Thank you Deepal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Nested return types from POJO web service method -shouldn't this work?
Ok... this is what is happening. It seems that the name of a member variable is affecting serialization...My objects, which were having problems, had fields starting with a low cap a, and continuing with a large cap letter This version of nested object works fine... public class NestedObj { private String nestedVal; public NestedObj() { nestedVal = null; } public String getNestedVal() { return anestedVal; } public void setNestedVal(String nestedVal) { this.nestedVal = nestedVal; } } This version of the nested object causes serialization to skip serialization of the object... public class NestedObj { private String aNestedVal; public NestedObj() { aNestedVal = null; } public String getANestedVal() { return aNestedVal; } public void setANestedVal(String nestedVal) { this.aNestedVal = nestedVal; } } Finally when I use this version, it works again... public class NestedObj { private String anestedVal; public NestedObj() { anestedVal = null; } public String getAnestedVal() { return anestedVal; } public void setAnestedVal(String nestedVal) { this.anestedVal = nestedVal; } } So, in conclusion, serialization seems to skip the nested object field, when the name of the field has one small cap letter followed by a large cap letter. This results is a get and set methods which have two caps in a row in the name(eg. setANestedVal - AN). Is this a bug, or a pattern I am not aware of? Thanks, Dave -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Friday, February 29, 2008 11:13 AM To: Kraus, David Cc: axis-user@ws.apache.org Subject: Re: Nested return types from POJO web service method -shouldn't this work? David- Take a look at http://commons.apache.org/beanutils/api/org/apache/commons/beanutils/Pro pert yUtilsBean.html specifically the copyProperties method.. copyProperties(java.lang.Object dest, java.lang.Object orig) As copyProperties method is a shallow copy I think you may want to handle *deep* copy programatically.. HTH M-- - Original Message - From: Kraus, David [EMAIL PROTECTED] To: Kraus, David [EMAIL PROTECTED]; axis-user@ws.apache.org Sent: Friday, February 29, 2008 1:02 PM Subject: RE: Nested return types from POJO web service method -shouldn't this work? I have verified that I can correctly use nested return types in a POJO service. Now I need to figure out why my more complex POJO service is not working correctly Dave From: Kraus, David Sent: Thursday, February 28, 2008 10:40 PM To: axis-user@ws.apache.org Subject: RE: Nested return types from POJO web service method -shouldn't this work? Yes, I didn't show it, but my classes did have getters/setters, default public constructor, and basically obeyed the rules of a JavaBean. Dave From: Deepal Jayasinghe [mailto:[EMAIL PROTECTED] Sent: Fri 2/29/2008 1:01 AM To: axis-user@ws.apache.org Subject: Re: 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. Nope this can not be happen , however you need to remember that you class should be JavaBean (need to have getters and settes). I have tested this and working fine , in addition to that following link will be helpful for you to understand about Axis2 POJO. http://www.developer.com/java/other/article.php/10936_3726461_3 Thank you Deepal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: Nested return types from POJO web service method -shouldn't this work?
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
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 [EMAIL PROTECTED] 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]
RE: Nested return types from POJO web service method -shouldn't this work?
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:[EMAIL PROTECTED] 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 [EMAIL PROTECTED] 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]
Re: 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. Nope this can not be happen , however you need to remember that you class should be JavaBean (need to have getters and settes). I have tested this and working fine , in addition to that following link will be helpful for you to understand about Axis2 POJO. http://www.developer.com/java/other/article.php/10936_3726461_3 Thank you Deepal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Nested return types from POJO web service method -shouldn't this work?
Yes, I didn't show it, but my classes did have getters/setters, default public constructor, and basically obeyed the rules of a JavaBean. Dave From: Deepal Jayasinghe [mailto:[EMAIL PROTECTED] Sent: Fri 2/29/2008 1:01 AM To: axis-user@ws.apache.org Subject: Re: 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. Nope this can not be happen , however you need to remember that you class should be JavaBean (need to have getters and settes). I have tested this and working fine , in addition to that following link will be helpful for you to understand about Axis2 POJO. http://www.developer.com/java/other/article.php/10936_3726461_3 Thank you Deepal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] winmail.dat- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]