XML documents are flat; object graphs are multi-dimensional. Multirefs provide a convenient way to represent object graphs in XML. And SOAP encoding was designed to support serialization of object graphs.

But keep in mind: SOAP is a document-oriented messaging system. It is not a distributed object system. You really shouldn't be asking SOAP to serialize object graphs.

Yes -- using RPC/encoded, you can make SOAP work like a distributed object system, but you will almost certainly encounter interoperability challenges if you attempt to communicate with other languages. If you are communicating only with other Java applications, then why not just use RMI? SOAP is much slower, and it imposes a bunch of unnatural constraints on you (e.g., don't use Collections).

But if your goal is to enable heterogenous communications, it's much better to bite the bullet and deal with the fact that you shouldn't be trying to make other languages deal with Java-specific constructs. Instead you should adjust your application interfaces so that they can deal with flat documents rather than object graphs.

In other words, don't use multirefs.

Anne

On 1/17/06, Brian Abbott <[EMAIL PROTECTED]> wrote:
Thank you for that Anne! :) That leads me to ask, as a
design decision, when given a choice, when do you
choose or not choose to use multi-ref encoding? And,
what are the benefits of using multi-refs?

Thanks,

Brian Abbott

--- Anne Thomas Manes <[EMAIL PROTECTED]> wrote:

> If you want to define multirefs in your schema, you
> can. But the schema that
> Glenn showed us does not include multirefs,
> therefore messages sent to and
> from that service should under no circumstances use
> multirefs.
>
> When using Literal encoding, the SOAP message must
> conform to the schema of
> the element or type referenced from the message part
> definition. If that
> schema defines the use of multirefs, then the
> message must contain
> multirefs. But if the schema doesn't define the use
> of multirefs, then the
> message must not contain multirefs.
>
> When using SOAP encoding, the SOAP message is
> dynamically constructed
> according to the SOAP encoding data model, and it
> does not necessarily
> conform to a schema. SOAP encoding often uses
> multirefs.
>
> Anne
>
> On 1/17/06, Brian Abbott <[EMAIL PROTECTED] >
> wrote:
> >
> > Anne,
> >
> > Could you expand on why not to use Multirefs?
> >
> > Thanks,
> >
> > Brian
> >
> > --- Anne Thomas Manes < [EMAIL PROTECTED]> wrote:
> >
> > > Under no circumstances should this service use
> SOAP
> > > encoding or multirefs.
> > > Was your code was generated from the WSDL using
> > > wsdl2java?
> > >
> > > Anne
> > >
> > > On 1/17/06, glenn bech <[EMAIL PROTECTED]>
> > > wrote:
> > > >
> > > > Hi! Thank you for taking the time to reply.
> > > >
> > > > My service has this declaration in the
> > > server-config.wsdd
> > > >
> > > > <service name="Provisioning"
> provider="java:RPC"
> > > style="document"
> > > > use="literal" >
> > > >
> > > > And the binding part of my WSDL looks like
> this
> > > >
> > > > <binding name="Provisioning"
> > > type="gb:Provisioning">
> > > >     <soap:binding style="document"
> > > >
> transport="http://schemas.xmlsoap.org/soap/http"/>
> > > >     <operation name="Create">
> > > >       <soap:operation soapAction="gb#Create"
> > > style="document"/>
> > > >       <input>
> > > >         <soap:body use="literal"/>
> > > >       </input>
> > > >       <output>
> > > >         <soap:body use="literal"/>
> > > >       </output>
> > > >     </operation>
> > > >   </binding>
> > > >   <service name="Provisioning">
> > > >     <port name="Provisioning"
> > > binding="gb:Provisioning">
> > > >       <soap:address
> > > >
> > >
> >
>
location=" http://localhost:8888/axis/services/Provisioning"/>
> > > >     </port>
> > > >   </service>
> > > >
> > > > Can anyone point me in the right way for
> > > documentation or information
> > > > about
> > > > the different encoding styles, and why this
> > > service, given the binding
> > > > and server-config.wsdd uses RPC/encoded and
> > > multirefs ?
> > > >
> > > > ________________________________________
> > > > From: Anne Thomas Manes
> [mailto: [EMAIL PROTECTED]]
> > > > Sent: 16. januar 2006 18:25
> > > > To: [email protected]
> > > > Subject: Re: multirefs
> > > >
> > > > Multirefs are used only with RPC/encoded.
> > > >
> > > > Anne
> > > > On 1/16/06, glenn bech <[EMAIL PROTECTED] >
> > > wrote:
> > > > I have two different web services (1 & 2) and
> two
> > > different clients (A &
> > > > B).
> > > > When Client A or B runs against service 1,
> they
> > > create a request XML that
> > > > looks like the one below (with "multiref's").
> This
> > > is not the case when
> > > > client A or B runs against service 2.
> > > >
> > > > In a but clueless and would really like an
> answert
> > > to why this is
> > > > happening,
> > > > and- or directions to documentation on the
> > > "multiref" syntax, and when and
> > > > why Axis uses it.
> > > >
> > > > My WSDL can be found at
> > > >
> http://www.glennbech.com/java/wsdl/abstract.wsdl
> > > >
> > > > Best regards!
> > > >
> > > > -- 8 <-- This is the serialized request
> message
> > > >
> > > > <?xml version="1.0" encoding="-8"?>
> > > > <soapenv:Envelope
> > >
> >
>
xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/
> > > > "
> > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > >
> > >
> >
>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> > > > <soapenv:Body>
> > > > <Create
> > > >
> > >
> >
>
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> > > > <arg0 href=""
> > > > </Create>
> > > > <multiRef id="id0" soapenc:root="0"
> > > >
> > >
> >
>
soapenv:encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/"
> > > >
> > >
> >
>
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/ ">
> > > > <ItemType
> > >
> xsi:type="xsd:string">[EMAIL PROTECTED]</ItemType>
> > > > <ItemID href="">> > > > <ItemAttributes href=""
> > > > </multiRef>
> > > > <multiRef id="id2" soapenc:root="0"
> > > > soapenv:encodingStyle="
> > > http://schemas.xmlsoap.org/soap/encoding/"
> > > >
> > >
> >
>
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/
> > > ">
> > > > <CreateItemDefinition href="">> > > > </multiRef>
> > > > <multiRef id="id1" soapenc:root="0"
> > > > soapenv:encodingStyle="
> > > http://schemas.xmlsoap.org/soap/encoding/"
> > > > xsi:type="xsd:int"
> > > >
> > >
> >
>
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</multiRef>
> > > > <multiRef id="id3" soapenc:root="0"
> > > >
> > >
> >
>
soapenv:encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/"
> > > > xsi:type="ns1:CreateComputerParameters"
> > > >
> > >
> >
>
xmlns:ns1=" http://www.glennbech.com/abstractiontest/abstract/"
>
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Reply via email to