axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anne Thomas Manes" <>
Subject RE: RPC vs. building your own SOAP messages
Date Sat, 02 Oct 2004 08:51:07 GMT
Attributes are mapped to properties.

The wrapped style doesn't permit attributes at the top level (no complex
content in the wrapper element). The wrapper element must be defined as a
type comprising a sequence of elements. But these elements within the
wrapper element may contain attributes.

In a situation where you require attributes at the top level, then you must
use either "document" style or "message" style. With "document" style, Axis
maps the entire contents of the SOAP body to a Java object. With "message"
style, Axis maps the contents to a DOM.


-----Original Message-----
From: [] 
Sent: Friday, October 01, 2004 7:49 PM
Subject: RE: RPC vs. building your own SOAP messages

Ok, that makes sense.  And Axis' "wrapped" style will support nested tags
by creating nested Java objects?

If so, how does it handle attributes that are on tags?  Like:
<member type="1">
    <lastname> doe</name>

I would imagine that the "wrapped" style would create a Member object that
has an age, but also contains a Name object.  And then the Name object
contains the firstname and lastname.

But, how would it represent the "type=1" in the java objects?  (Assuming
I'm right about how it would represent the nested objects.)

Thank you for your help!  Axis is very exciting... I wish I had converted
over sooner.

-Raiden Johnson

On Fri, 1 Oct 2004, Anne Thomas Manes wrote:

> As a rule of thumb, you should use the Axis "wrapped" style. (Sometimes
> can't, but the example you cite below is fine.) The "wrapped" generates
> document/literal messages, and it manages the message building process for
> you. Axis automatically maps the XML message to Java objects based on the
> schema of the message. When developing a "wrapped" style service, you
> start by defining the XML schema of your input and output messages.
> Anne
> -----Original Message-----
> From: []
> Sent: Friday, October 01, 2004 10:39 AM
> To:
> Subject: RPC vs. building your own SOAP messages
> Hello,
> I am having a hard time grasping when to use RPC calls and when to build
> your own messages.  I used to use Apache SOAP, and I used to build my own
> SOAP message via JAXM.
> However, I am now trying to upgrade to AXIS, and to make full use of its
> feature set... which seems to have a huge emphasis on using RPC, and
> seems to abstract out message building.
> Every guide and tutorial that I have read seems to revolve around RPC, and
> how easy it is to implement in AXIS.  I can see the benefits of RPC for
> simple calls (pass in a few arguments, get back a single result... even
> if the result is a complex type).  RPC seems great for that.
> However, I need to pass much more complex messages, and receive much more
> complex results.  Does that mean that RPC is not the best solution for me?
> For example, here is a typical message that I will send to a SOAP server:
> <soap-env:Envelope
> xmlns:soap-env="">
> <soap-env:Header>
> <t:Transaction xmlns:t="xxs">
>   <iden u="user" p="password"/>
> </t:Transaction>
> </soap-env:Header>
> <soap-env:Body>
> <ns1:ProviderTransaction xmlns:ns1="xxs">
> <REQ>
>   <action entryDate="20040919">1</action>
>   <memberInfo nvid="1234567">
>     <externalID>4001775</externalID>
>     <name><first>Maggie</first><last>Duke</last></name>
>     <companyName/>
>     <address>123 Test St.</address>
>     <address2/>
>     <city>City</city>
>     <state>CT</state>
>     <country>US</country>
>     <postalCode>06524</postalCode>
>     <email></email>
>     <ssn></ssn>
>   </memberInfo>
>   <orderInfo>
>     <effectiveDate>20040928</effectiveDate>
>     <items count="2">
>       <item><itc>2973</itc><qty>1</qty><pc>Y</pc></item>
>       <item><itc>1234</itc><qty>1</qty><pc>Y</pc></item>
>     </items>
>   </orderInfo>
> </REQ>
> </ns1:ProviderTransaction>
> </soap-env:Body><
> /soap-env:Envelope>
> and here is a typical response:
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENV=""
> SOAP-ENV:encodingStyle=""
> xmlns:xsd=""
> xmlns:xsi="">
> <SOAP-ENV:Header>
> <t:Transaction xmlns:t="xxs" />
> </SOAP-ENV:Header>
> <SOAP-ENV:Body>
> <ns1:ProviderTransaction xmlns:ns1="xxs">
> <RSP>
> <responseNode>
>   <nvid new="1">863262802</nvid>
>   <orderNumber>9136214</orderNumber>
>   <asOrderNumber>961704</asOrderNumber>
> </responseNode>
> </RSP>
> </ns1:ProviderTransaction>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
> Are complex SOAP packets like these not appropriate for RPC?  It seems to
> me, like you really need to build your own requests, and parse your own
> responses to make something like this work.  Am I correct in that?
> Thank you,
> -Raiden Johnson

View raw message