You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Thomas Pawlitzki <ma...@pawlitzki.name> on 2008/01/17 08:52:59 UTC

axis2 [1.3] Influence the ADB generation

Hello,

i wounder if there is there is a possibility to influence the
generation of the ADBs.

I have a XSD which defines the data structures of a webservice. I use
this xsd to generate the ADBs. As the ADBs covers the hole data of my
business logic i want to use them as business objects, too. So my
clients create objects of  them, pass the objects into my logic, I do
some validation and computing and I send them via WebService easily.

But therefore the ADBs must implement java.io.Serializable.

Is there a possibillity to generate the ADBs implementing this interface?

Thanks a lot.

Greetings,
Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: axis2 [1.3] Influence the ADB generation

Posted by Afkham Azeez <af...@gmail.com>.
The purpose of the ADB Beans is to provide databinding. From time to
time, the way these databinding classes are generated may change when
we fix various issues + introduce new features in Axis2. Hence if you
decide to use these as your business objects, you may have to make
significant code changes when upgrading to a newer version of Axis2.
Therefore, IMHO, the better approach would be to define your own
business objects which corresponds to your domain model.

In addition, I don't think it is very prudent to make all your
ADBBeans implement
serializable and use them as your business objects. See
http://richm.org/eff/effectivejava.html. See Item 54
in this article.

<quote>
**Item 54: Implement Serializable judiciously**

Allowing a class's instances to be serialized can be as simple as adding
the words implements Serializableto its declaration. Because this is so
easy to do, there is a common misconception that serialization requires
little effort on the part of the programmer.

The truth is far more complex. While the immediate cost to make a class
serializable can be negligible, the long-term costs are often
substantial. A major cost of implementing Serializable is that it
decreases the flexibility to change a class's implementation once it has
been released. When a class implements Serializable, its byte-stream
encoding (or serialized form) becomes part of its exported
API. Once you distribute a class widely, you are generally required to
support the serialized form forever, just as you are required to support
all other parts of the exported API. If you do
not go to the effort to design a custom serialized form, but merely
accept the default, the serialized form will forever be tied to the
class's original internal representation. In other
words, if you accept the default serialized form, the class's private
and package-private instance fields become part of its exported API, and
the practice of minimizing access to fields (Item 12) loses its
effectiveness as a tool for information hiding.
</quote>


--
Azeez

On Jan 17, 2008 1:22 PM, Thomas Pawlitzki <ma...@pawlitzki.name>
wrote:

> Hello,
>
> i wounder if there is there is a possibility to influence the
> generation of the ADBs.
>
> I have a XSD which defines the data structures of a webservice. I use
> this xsd to generate the ADBs. As the ADBs covers the hole data of my
> business logic i want to use them as business objects, too. So my
> clients create objects of  them, pass the objects into my logic, I do
> some validation and computing and I send them via WebService easily.
>
> But therefore the ADBs must implement java.io.Serializable.
>
> Is there a possibillity to generate the ADBs implementing this interface?
>
> Thanks a lot.
>
> Greetings,
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Thanks
Afkham Azeez

http://azeez78.blogspot.com
http://www.wso2.org
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760

RE: axis2 [1.3] Influence the ADB generation

Posted by "Chen, Lizhao" <li...@tellabs.com>.
Sorry, Thomas,

I find the place to add java.io.Serializable.

Best Regards!

 

Lizhao Chen

 

86-021-50800850-8395

-----Original Message-----
From: Chen, Lizhao 
Sent: Wednesday, January 23, 2008 05:27 PM
To: 'axis-user@ws.apache.org'
Subject: RE: axis2 [1.3] Influence the ADB generation

Hi, Thomas,

For the step 2, 

2) extract
axis2-1.3\modules\adb-codegen\src\org\apache\axis2\schema\template\ADBBe
anTemplate.xsl
and change it by adding the "implements java.io.Serializable" to the
generated code

can you tell me the detail that how do you add the "implements
java.io.Serializable" to the generated code?

I extract the xsl, and can't find where to add above code.

Best Regards!

 

Lizhao Chen

 

86-021-50800850-8395

-----Original Message-----
From: thomas.pawlitzki@gmail.com [mailto:thomas.pawlitzki@gmail.com] On
Behalf Of Thomas Pawlitzki
Sent: Thursday, January 17, 2008 07:33 PM
To: axis-user@ws.apache.org
Subject: Re: axis2 [1.3] Influence the ADB generation

Hello Mauro,

2008/1/17, Mauro Molinari <ma...@cardinis.com>:
> You can do the following:
> 1) download Axis2 SRC distributon
> 2) extract
>
axis2-1.3\modules\adb-codegen\src\org\apache\axis2\schema\template\ADBBe
anTemplate.xsl
> and change it by adding the "implements java.io.Serializable" to the
> generated code
> 3) extract
>
axis2-1.3\modules\adb-codegen\src\org\apache\axis2\schema\schema-compile
.properties
> and change the value of schema.bean.writer.template so that it points
to
> your modified template
> 4) run WSDL2Java generator setting the Java system property
> org.apache.adb.properties so that it points to your own
> schema-compile.properties, i.e.:
> java -Dorg.apache.adb.properties=my-own/schema-compile.properties -cp
> <full classpath!> org.apache.axis2.wsdl.WSDL2Java <your options> -uri
> YourWSDL.wsdl
>
> You'll find some hints at:
> http://ws.apache.org/axis2/1_3/adb/adb-tweaking.html

Tank you for the very fast reply and for the hint.

It seems to work for me.

Greetings,
Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
============================================================
The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader
of this message is not the intended recipient, or an employee
or agent responsible for delivering this message to the
intended recipient, you are hereby notified that any reproduction,
dissemination or distribution of this communication is strictly
prohibited. If you have received this communication in error,
please notify us immediately by replying to the message and
deleting it from your computer. Thank you. Tellabs
============================================================

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: axis2 [1.3] Influence the ADB generation

Posted by "Chen, Lizhao" <li...@tellabs.com>.
Hi, Thomas,

For the step 2, 

2) extract
axis2-1.3\modules\adb-codegen\src\org\apache\axis2\schema\template\ADBBe
anTemplate.xsl
and change it by adding the "implements java.io.Serializable" to the
generated code

can you tell me the detail that how do you add the "implements
java.io.Serializable" to the generated code?

I extract the xsl, and can't find where to add above code.

Best Regards!

 

Lizhao Chen

 

86-021-50800850-8395

-----Original Message-----
From: thomas.pawlitzki@gmail.com [mailto:thomas.pawlitzki@gmail.com] On
Behalf Of Thomas Pawlitzki
Sent: Thursday, January 17, 2008 07:33 PM
To: axis-user@ws.apache.org
Subject: Re: axis2 [1.3] Influence the ADB generation

Hello Mauro,

2008/1/17, Mauro Molinari <ma...@cardinis.com>:
> You can do the following:
> 1) download Axis2 SRC distributon
> 2) extract
>
axis2-1.3\modules\adb-codegen\src\org\apache\axis2\schema\template\ADBBe
anTemplate.xsl
> and change it by adding the "implements java.io.Serializable" to the
> generated code
> 3) extract
>
axis2-1.3\modules\adb-codegen\src\org\apache\axis2\schema\schema-compile
.properties
> and change the value of schema.bean.writer.template so that it points
to
> your modified template
> 4) run WSDL2Java generator setting the Java system property
> org.apache.adb.properties so that it points to your own
> schema-compile.properties, i.e.:
> java -Dorg.apache.adb.properties=my-own/schema-compile.properties -cp
> <full classpath!> org.apache.axis2.wsdl.WSDL2Java <your options> -uri
> YourWSDL.wsdl
>
> You'll find some hints at:
> http://ws.apache.org/axis2/1_3/adb/adb-tweaking.html

Tank you for the very fast reply and for the hint.

It seems to work for me.

Greetings,
Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
============================================================
The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader
of this message is not the intended recipient, or an employee
or agent responsible for delivering this message to the
intended recipient, you are hereby notified that any reproduction,
dissemination or distribution of this communication is strictly
prohibited. If you have received this communication in error,
please notify us immediately by replying to the message and
deleting it from your computer. Thank you. Tellabs
============================================================

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: axis2 [1.3] Influence the ADB generation

Posted by Thomas Pawlitzki <ma...@pawlitzki.name>.
Hello Mauro,

2008/1/17, Mauro Molinari <ma...@cardinis.com>:
> You can do the following:
> 1) download Axis2 SRC distributon
> 2) extract
> axis2-1.3\modules\adb-codegen\src\org\apache\axis2\schema\template\ADBBeanTemplate.xsl
> and change it by adding the "implements java.io.Serializable" to the
> generated code
> 3) extract
> axis2-1.3\modules\adb-codegen\src\org\apache\axis2\schema\schema-compile.properties
> and change the value of schema.bean.writer.template so that it points to
> your modified template
> 4) run WSDL2Java generator setting the Java system property
> org.apache.adb.properties so that it points to your own
> schema-compile.properties, i.e.:
> java -Dorg.apache.adb.properties=my-own/schema-compile.properties -cp
> <full classpath!> org.apache.axis2.wsdl.WSDL2Java <your options> -uri
> YourWSDL.wsdl
>
> You'll find some hints at:
> http://ws.apache.org/axis2/1_3/adb/adb-tweaking.html

Tank you for the very fast reply and for the hint.

It seems to work for me.

Greetings,
Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: axis2 [1.3] Influence the ADB generation

Posted by Mauro Molinari <ma...@cardinis.com>.
Thomas Pawlitzki ha scritto:
> Hello,
> 
> i wounder if there is there is a possibility to influence the
> generation of the ADBs.
> 
> I have a XSD which defines the data structures of a webservice. I use
> this xsd to generate the ADBs. As the ADBs covers the hole data of my
> business logic i want to use them as business objects, too. So my
> clients create objects of  them, pass the objects into my logic, I do
> some validation and computing and I send them via WebService easily.
> 
> But therefore the ADBs must implement java.io.Serializable.
> 
> Is there a possibillity to generate the ADBs implementing this interface?
> 
> Thanks a lot.

You can do the following:
1) download Axis2 SRC distributon
2) extract 
axis2-1.3\modules\adb-codegen\src\org\apache\axis2\schema\template\ADBBeanTemplate.xsl 
and change it by adding the "implements java.io.Serializable" to the 
generated code
3) extract 
axis2-1.3\modules\adb-codegen\src\org\apache\axis2\schema\schema-compile.properties 
and change the value of schema.bean.writer.template so that it points to 
your modified template
4) run WSDL2Java generator setting the Java system property 
org.apache.adb.properties so that it points to your own 
schema-compile.properties, i.e.:
java -Dorg.apache.adb.properties=my-own/schema-compile.properties -cp 
<full classpath!> org.apache.axis2.wsdl.WSDL2Java <your options> -uri 
YourWSDL.wsdl

You'll find some hints at:
http://ws.apache.org/axis2/1_3/adb/adb-tweaking.html

Good luck!

-- 
Mauro Molinari
Software Developer
mauro.molinari@cardinis.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org