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 Srikanth Thiagarajan <sr...@mail.com> on 2004/04/14 00:19:58 UTC

JAXB vs Axis generated classes

Hi Guys,
I am reposting my mail again as my previous mail had html content in it.
I have some questions regarding JAXB and Axis.

1. What are the benefits of using Axis generated classes as against
using standard like JAXB?
2. Will JAXB generation be included as part of the next version of
JAX-RPC spec?
3. Has anyone tried to compare the performance using Axis generated
classes as against using JAXB?

Now for some more specific questions.

I have got Axis to work with JAXB.
I have a couple of issues( small ones)
1. I have been able to make JAXB write directly to the
SrializationContext by extending SOAPBodyElement.

public class JAXBSoapBodyElement extends SOAPBodyElement {

private Object jaxbObjectTree;

public JAXBSoapBodyElement(Object object) {
jaxbObjectTree = object;
}

protected void outputImpl(SerializationContext context) throws
Exception {
String wellFormedXml = JAXBMarshaller.toXml(jaxbObjectTree);
wellFormedXml = stripXmlHeader (wellFormedXml);
context .writeString(wellFormedXml);
}

}

When I call Call.invoke I create a JAXBBodyElement instead of a
SOAPBodyElement like this
SOAPBodyElement[] input = new SOAPBodyElement[1];
input[0] = new JAXBSoapBodyElement(jaxbObjectTree);

The problem is when I get my response I see that it gets recorded by
the SAX2EventRecorder in MessageElement. Is it possible for to use JAXB
to read from the stream instead of using the using the event recorder
to record to a string and then using jaxb to construct an object tree?

An help with this problem is appreciated



-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm


RE: Need suggestions on web service interop and design

Posted by Anne Thomas Manes <an...@manes.net>.
Henrik,

The WS-I Basic Profile disallows the use of SOAP Encoding. It allows only
Document/Literal and RPC/Literal. Technically, WS-I BP doesn't *require*
support for RPC/Literal, though. Microsoft fought long and hard to exclude
RPC-style from the WS-I BP, but they lost that vote. In any case, Microsoft
does not support RPC/Literal, and my guess is that they will never support
RPC/Literal. (Please note, though, that the JAX-RPC specification requires
support for RPC/Literal.)

If you want to design for interoperability, you should use Document/Literal.
Axis 1.2 provides much better support for Document/Literal than previous
releases. 

I suggest that you follow the .NET guides and define your schema first --
then generate your beans from the schema. This approach ensures that you
won't attempt to expose Java collections through your WS interface.

For best interoperability, your interface should consist of simple types,
arrays (defined using minOccurs/maxOccurs), and complex types defined as
sequence structures of simple types, arrays, and/or sequence structures.

Anne

-----Original Message-----
From: HG [mailto:axis@websolver.dk] 
Sent: Wednesday, April 14, 2004 3:43 AM
To: axis-user@ws.apache.org
Subject: Need suggestions on web service interop and design

Hi all

I have developed some WebServices using Axis...nothing big...just a couple
of examples serializing beans and so between a java (Axis) server and a java
client...however...now a project is arising where web services is going to
be used in large scale...

and to add even more complexity..the web services deployed must be
consumable by other platforms...first case is .NET

I have read "inteop" guides in both "camps", ie Java/Axis/J2EE and .NET..In
the .NET camp they favor one style of messages and claim that this is
according to the WS-Basic profile...So it makes me wonder...how is Axis
support for this style (can't remember if it is doc/literal or rpc/literal)
?

In the .NET guides, thet also say that one must define the schemas first?
Why...? Because a schema can be understood by both sides? or to define the
message structure as they seem to favor message style instead of rpc style?

The primary goal of the web servcices developed is to be consumable by many
platforms...first two targets is .NET and Axis...more coming....


Any thoughts, ideas....Anne, please...you seem to have done a lot in this
fields..

Best regards

Henrik



Need suggestions on web service interop and design

Posted by HG <ax...@nospam.websolver.dk>.
Hi all

I have developed some WebServices using Axis...nothing big...just a couple
of examples serializing beans and so between a java (Axis) server and a java
client...however...now a project is arising where web services is going to
be used in large scale...

and to add even more complexity..the web services deployed must be
consumable by other platforms...first case is .NET

I have read "inteop" guides in both "camps", ie Java/Axis/J2EE and .NET..In
the .NET camp they favor on style of messages and claim that this is
according to the WS-Basic profile...So it makes me wonder...how is Axis
support for this style (can't remember if it is doc/literal or rpc/literal)
?

In the .NET guides, thet also say that one must define the schemas first?
Why...? Because a schema can be understood by both sides? or to define the
message structure as they seem to favor message style instead of rpc style?

The primary goal of the web servcices developed is to be consumable by many
platforms...first two targets is .NET and Axis...more coming....


Any thoughts, ideas....Anne, please...you seem to have done a lot in this
fields..

Best regards

Henrik



RE: JAXB vs Axis generated classes

Posted by Anderson Jonathan <an...@bah.com>.
>1. What are the benefits of using Axis generated classes as against
>using standard like JAXB?

More robust XML Schema support is my guess - but I'm fuzzy on which Java <->
XML data binding engines support what.

>2. Will JAXB generation be included as part of the next version of
>JAX-RPC spec?

Not sure about the specifics, but JAX-RPC 2.0 looks like it will be tied to
JAXB 2.0.  Check out: http://www.jcp.org/en/jsr/detail?id=224

>3. Has anyone tried to compare the performance using Axis generated
>classes as against using JAXB?

Not to my knowledge.  See Dim's rant for some possible insight into the
current state of performance metrics:
http://marc.theaimsgroup.com/?l=axis-user&m=108186602814158&w=2

>I have got Axis to work with JAXB.
Cool!

>The problem is when I get my response I see that it gets recorded by
>the SAX2EventRecorder in MessageElement. Is it possible for to use JAXB
>to read from the stream instead of using the using the event recorder
>to record to a string and then using jaxb to construct an object tree?

Might want to try posting to Axis-Dev.  They might be very interested in
what you're trying to do.

Regards,
Jonathan Anderson
Booz Allen Hamilton