Answers inline...

On Tue, 21 Dec 2004 23:50:24 -0500, tony k <[EMAIL PROTECTED]> wrote:
> Hi All,
> 
> I'm relatively new to web services and axis, so forgive me if this is old
> hat,
> but i have a few questions that i was hoping the more learned may be able to
> answer.
> 
> (1) if i wanted to use document/literal interaction for a web services would
> this be the equivalent of what axis refers to as "message" style?

"Wrapped" and "document" styles produce document/literal services.
"Rpc" style produces rpc/encoded services. "Message" style can produce
both rpc/encoded or document/literal -- whatever your application
chooses to produce. RPC, wrapped, and document styles automatically
marshal your application request into SOAP messages for your
application. They automatically perform Java to XML mapping. Message
style lets the application marshal the request manually. The
application must construct the messages using DOM.

> 
> (2) the axis documentation provides 4 possible signatures for message style
> interaction: 
> 
> 
> public Element [] method(Element [] bodies);
> public SOAPBodyElement [] method (SOAPBodyElement [] bodies);
> public Document method(Document body);
> public void method(SOAPEnvelope req, SOAPEnvelope resp);
> 
> 
> I was expecting to see something like:
> 
> 
> public String method(String request);

Use wrapped or document style. When using wrapped style, your
interface looks like a standard parameterized Java interface (passing
strings, ints, floats, etc). When using document style, your input and
output parameters must be objects (typically JavaBeans).

> 
> 
> and am a bit perplexed as to why:
> 
> 
> (a) if i already have an XML string, it seems like i'm going to take a
> performance hit converting to DOM object on client and then back on server
> side

Use message style if your application manipulates the XML directly.
Message style works only with DOM, though. (Java strings needs to be
serialized, too -- you can't just render your Java string to the
wire.) If you prefer to do your own parsing, build your own Axis
provider.

> 
> 
> (b)  what if i want to use SAX or dom4j to parse XML on server side, i'm
> stuck with some kind of another hit for conversion
>

When using wrapped or document style, you don't need to parse the XML.
Axis performs all the parsing for you and presents the data to your
application as Java objects. There are ways to use alternative
serialization frameworks, such as Castor or JiBX if you prefer. Search
the archives for information. a future release will make this process
much easier.
 
> 
> Can someone help me to understand and/or offer up some best practices?
> 
> 
> Any input appreciated,
> Thanks,
> Tony.
> 
>

Reply via email to