I considered this is an web service antipattern for shipping an object across the wire. Always think you are sending a bunch of data across the wire which will be picked up by the services whichever way he wants to interprete your sent data. This is one major paradigm shift for people who have a distributed object background (RMI, CORBA) move to SOAP.
So Bean Mapping should take away all methods.
I suggest you put a Wrapper around the bean so that the wrapper contains all the behavior while the bean contains only data. In this case, only the bean is send across the wire which will then be wrapped before used.
The client code will look like this
class Client {
CheckingService service = new CheckingServiceLocator();
Checking checking = service.getServicePort(new URL("..."));
}
The service will look like this.
class Checking implements IChecking {
}
Best regards,
ricky
At 01:34 PM 11/13/2002 -0500, Ramon Arias wrote:
I might have not explained my self correcly, I am concerned with the value objects being the same, not the service objects. For instance, having a Person object that is an argument to soap methods, the Person object could have a calculateAge() method, which is apropiate for me to call on the server or on the client. If I do a bean mapping, methods other that JavaBean getters and setters get removed, althoug they are apropiate for me to call on the client.
-----Original Message-----
From: Alex Dovlecel [mailto:[EMAIL PROTECTED]]
Sent: Mi�rcoles, 13 de Noviembre de 2002 12:42 p.m.
To: [EMAIL PROTECTED]
Subject: Re: Design Pattern
As long as you keep the Subjects on client and server, why should not be
possible?
(you have the same methods on client and server, the same class names if you
decide to keep the same structure and so on...) .
I might not have understood the question ...
dovle
> This sounds violate the heterogeneity principle of SOAP. And SOAP has
> never define language bindings, so you can only have such guarantee when
> using the same vendor's product. And of course, the same Java class need
> to be explicitly installed at both side.
>
> I think you should question why you are using SOAP instead of RMI.
>
> Best regards,
> Ricky
>
> At 10:32 AM 11/13/2002 -0500, Ramon Arias wrote:
> >Is there clean, simple and transparent way to move serializable java
> >objects from server side to the client side using soap and still retain
> >the objects behaviour (methods, inheritance, class names, package names,
> > etc)
> >
> >I would greatly apreciate your help,
> >
> >Best Regards
> >
> >Ramon
> >
> >-----Original Message-----
>
> From: Akin Ayi [mailto:[EMAIL PROTECTED]]
>
> >Sent: Mi�rcoles, 13 de Noviembre de 2002 12:04 p.m.
> >To: [EMAIL PROTECTED]
> >Subject: FW: Axis: Help with correct typeMapping for JavaBean
> >
> >
> >The Axis community,
> >I joined the axis-user yesterday. I did not get any response to this
> >question I posed, so I am re-sending it.
> >Any input will be greatly appreciated, and confirm my request made it to
> > the group.
> >
> >thanks,
> >-akin
> >
> >-----Original Message-----
>
> From: Akin Ayi [mailto:[EMAIL PROTECTED]]
>
> >Sent: Tuesday, November 12, 2002 3:07 PM
> >To: [EMAIL PROTECTED]
> >Subject: Axis: Help with correct typeMapping for JavaBean
> >
> >
> >
> >
> >I am using Axis 1.0, Is this how to go about what I need to do ?
> >//My service, EchoService, returns whatever I send in MyBean.
> >// With a simple Bean structure, it works just fine.
> >
> >public class MyBean {
> > private String name = null;
> > private float price = 0.0f;
> >// Get & Set Methods
> >}
> >The .wsdd has this for beanMapping
> > <beanMapping qname="myNS:MyBean"
> > xmlns:myNS="urn:EchoService"
> > languageSpecificType="java:book.MyBean"/>
> >
> >The Client performs the following registration before calling the service
> > QName oiqn = new QName( "urn:EchoService", "myBean");
> > Class cls1 = book.myBean.class;
> > call.registerTypeMapping(cls1, oiqn,
> > new org.apache.axis.encoding.ser.BeanSerializerFactory
> >(myBean.class,oiqn),
> > new org.apache.axis.encoding.ser.BeanDeserializerFactory
> >(myBean.class,oiqn));
> >
> > // Set the input param type as follows
> > call.addParameter("dataIn", oiqn, ParameterMode.IN);
> > // myBeanData is an instance of myBean correctly
> > populated Object[] params = new Object[] {myBeanData };
> > String result = (String) call.invoke(params);
> >This works, my data was sent and echoed by the service CORRECLY.
> >**********************************************
> >I then modified myBean as shown below:
> >1) Added modifier field,
> >2) Created a Modifier class
> >3) Updated my .wsdd to include beanMapping for Modifier
> >4) In the Client, included Modifier when registering type mapping
> >
> >public class MyBean {
> > private String name = null;
> > private float price = 0.0f;
> > private Modifier [] modifier = new Modifier[4]; // class defined below
> >// Get & Set Methods
> >}
> >
> >public class Modifier {
> > private String modName = null;
> > private String modType = null;
> > private int modQuantity = 0;
> > // Get & Set Methods
> >}
> >
> >The .wsdd has this for beanMapping
> > <beanMapping qname="myNS:MyBean"
> > xmlns:myNS="urn:EchoService"
> > languageSpecificType="java:book.MyBean"/>
> > <beanMapping qname="myNS:Modifier"
> > xmlns:myNS="urn:EchoService"
> > languageSpecificType="java:book.Modifier"/>
> >
> >//Client2 performs the following registration before calling the service
> > QName oiqn = new QName( "urn:EchoService", "myBean");
> > QName mdqn = new QName( "urn:EchoService", "Modifier");
> > Class cls1 = book.myBean.class;
> > Class cls2 = book.Modifier.class;
> > call.registerTypeMapping(cls1, oiqn,
> > new org.apache.axis.encoding.ser.BeanSerializerFactory
> >(myBean.class,oiqn),
> > new org.apache.axis.encoding.ser.BeanDeserializerFactory
> >(myBean.class,oiqn));
> > call.registerTypeMapping(cls2, mdqn,
> > new org.apache.axis.encoding.ser.BeanSerializerFactory
> >(Modifier.class,mdqn),
> > new org.apache.axis.encoding.ser.BeanDeserializerFactory
> >(Modifier.class,mdqn));
> > // Set the input param type as follows
> > call.addParameter("dataIn", oiqn, ParameterMode.IN);
> > // myBeanData is an instance of myBean correctly
> > populated Object[] params = new Object[] {myBeanData };
> > String result = (String) call.invoke(params);
> >
> >THE PROBLEM:
> >Using Client2, when the outbound soap was generated it did not contain the
> >Modifier data. The updated service was expecting it.
> >QUESTION:
> >1) What am I missing in Client2 that caused only part of myBean to be
> >included in the soap.
> >2) The registration of myBean and Modifier are separate, how is the
> >correlation between myBean and Modifier classes accomplished.
> >3) Is there a difernt way of doing this
> >
> >thanks,
> >akin
