Raymond Feng escribió:
Hi, I think you hit an issue we recently discussed on the mailing list [1]. To work around the problem, can you try to add "implements Serializable" to your beans for now?[1] http://www.mail-archive.com/[EMAIL PROTECTED]/msg26191.html Thanks, Raymond ----- Original Message ----- From: Álvaro Martínez To: [email protected] Sent: Thursday, December 13, 2007 9:05 AM Subject: Re: Working with related beans Simon Laws escribió: On Dec 13, 2007 3:19 PM, Álvaro Martínez <[EMAIL PROTECTED]> wrote: Hi, I'm a newbie to Apache Tuscany and I have a very dumb doubt... I think. My question is: how can I use related beans when calling web services (as parameters) or on return from them. By "related" I mean specifically that one Client has a set of Vehicles, and these own a set of Devices. That is, beans with a "to-many" relation inside regarding other beans. I tried to use a plain Java array but doesn't seem to work. Thanks! -----------------------Álvaro Martínez Hernández,Push The Button, S.L. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Hi Alvaro, welcome to Tuscany. There's no such thing as a dumb question;-) I think the answer in this case is yes you should be able to pass trees of java objects across services interfaces. Can I ask, is the web service you are trying to communicate with also implemented with Tuscany or is it a web service that someone else is providing. If the former what does the service interface look like? If the latter do you have a WSDL description of the service that we can see? Also are you able to show us the code that is making the service call and can you give us some more details about the errors you are getting. Regards Simon ---------------------------------------------------------------------------- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.17/1179 - Release Date: 09/12/2007 11:06 Thank you very much for your quick answer, Laws. First of all let me explain that I'm trying to do this automatically. I'm sure it can be done with a custom WSDL, but I like Tuscany for its abstraction, I don't want to loose it. Actually I'm developing both server and client sides, so I have total control over the transaction. The exception that client sees is: Exception in thread "main" java.lang.IllegalArgumentException: Pass-by-value is not supported for the given object at org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding.copy(JavaBeansDataBinding.java:84) at org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint$LazyDataBinding.copy(DefaultDataBindingExtensionPoint.java:171) at org.apache.tuscany.sca.core.databinding.wire.PassByValueInteceptor.copy(PassByValueInteceptor.java:90) at org.apache.tuscany.sca.core.databinding.wire.PassByValueInteceptor.invoke(PassByValueInteceptor.java:54) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:233) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:130) at $Proxy6.createClient(Unknown Source) at com.ptb.ws.gw.AdministrationApp.main(AdministrationApp.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) Caused by: java.lang.IllegalArgumentException: Argument type 'com.ptb.commons.beans.GwClient' is not Serializable. Pass-by-value cannot be performed on this argument at org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding.copy(JavaBeansDataBinding.java:80) ... 12 more Such class GwClient follows: public class GwClient { protected String id = null; protected String name = null; protected String user = null; protected String password = null; protected int inputQueueCheckInterval = 0; protected int modemCheckInterval = 0; protected int outputQueueCheckInterval = 0; protected DeviceConf[] defaultConfs = null; protected Modem[] modems = null; protected InputQueue[] inputQueues = null; protected OutputQueue[] outputQueues = null; protected MobileResource[] mobileResources = null; (The rest is just get/set methods). I won't bore you with related beans because all own just simple types and arrays of beans. What am I doing wrong? Thanks! -----------------------Álvaro Martínez Hernández, Push The Button, S.L., Spain --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] That was *exactly* the problem. So for anyone who gets this situation in the future, remember: - You must implement get/set methods for your arrays of beans. - Your beans must implement Serializable (not necessary to implement the method) - You can use ArrayList or whatever. Thanks a lot, that was a hard issue for me to figure out alone. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] |
- Working with related beans Álvaro Martínez
- Re: Working with related beans Simon Laws
- Re: Working with related beans Álvaro Martínez
- Re: Working with related beans Raymond Feng
- Re: Working with related beans Álvaro Martínez
- Re: Working with related beans Jean-Sebastien Delfino
- Re: Working with related beans Álvaro Martínez
- Re: Working with related beans Álvaro Martínez
