axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Daniels <gdani...@macromedia.com>
Subject RE: Explanation of how to use in/out parameters
Date Fri, 11 Jan 2002 18:22:02 GMT

Actually, if the server side handled this, the WSDL generation would know to mark those params
as in/outs so the stub would automatically get Holders.  If we wanted to do this without Holders
(so that both the client and server sides could implement a given interface, for instance),
then something like this (i.e. some kind of metadata telling us which params were byref/inout)
would also need to be done on the client side.

--Glen

> -----Original Message-----
> From: Russell Butek [mailto:butek@us.ibm.com]
> Sent: Friday, January 11, 2002 11:42 AM
> To: axis-dev@xml.apache.org
> Subject: RE: Explanation of how to use in/out parameters
> 
> 
> It might not be hard to process the WSDD with this info, but the
> client-side stub has to do something special as well.  Since 
> there's no
> indicator in the WSDL telling it that readWidget's rc is 
> special, on every
> method call, after it's processed the normal output/inout 
> parameters, it
> would have to check to see whether there are any of these 
> special inout
> parameters still waiting in the wings and do some 
> introspection to do the
> proper transfer of data.  This is still doable, just not as simple as
> adding to the WSDD.  It adds a fair chunk of code.  Either each method
> calls some utility method to do introspection and data 
> transfer, or each
> method is generated with code that can do the same thing 
> faster without
> introspection.  The former is expensive, but is only executed 
> if one of
> these special types actually exists.  The latter is a massive 
> case of code
> bloat.
> 
> Russell Butek
> butek@us.ibm.com
> 
> 
> Glen Daniels <gdaniels@macromedia.com> on 01/11/2002 10:20:37 AM
> 
> Please respond to axis-dev@xml.apache.org
> 
> To:   "'axis-dev@xml.apache.org'" <axis-dev@xml.apache.org>
> cc:
> Subject:  RE: Explanation of how to use in/out parameters
> 
> 
> 
> 
> It wouldn't be too hard to have something like this in WSDD:
> 
> <service name="Foo" provider="java:RPC">
>   <method name="readWidget">
>    <parameter name="rc" mode="inout"/>
>    <parameter name="wq" mode="in"/>
>   </method>
> </service>
> 
> As long as ReadContext is something we have both a serializer and a
> deserializer for, this should work fine.
> 
> We could add this to the "to do" list as a "B" level feature....
> 
> --G
> 
> > -----Original Message-----
> > From: Russell Butek [mailto:butek@us.ibm.com]
> > Sent: Friday, January 11, 2002 9:41 AM
> > To: axis-user@xml.apache.org
> > Cc: axis-dev@xml.apache.org
> > Subject: RE: Explanation of how to use in/out parameters
> >
> >
> > (I'm cross posting this to both axis-dev and axis-user.  For
> > the axis-dev
> > folks who haven't been monitoring axis-user, in short we have
> > an existing
> > class that we'd like to turn into a Web Service.  This class
> > has method "
> > Widget readWidget(ReadContext rc, WidgetQualifier wq);" where the
> > implementation updates ReadContext and the caller receives
> > those updates.
> > When called remotely, the caller doesn't receive these 
> updates because
> > ReadContext is treated as a simple input parameter.  This
> > isn't such an
> > outlandish use of Java, the Java classes themselves have
> > instances like
> > this, for example:  java.util.Vector.toArray(Object[] array),
> > java.lang.StringBuffer.getChars(int srcBegin, int srcEnd,
> > char[] dst, int
> > dstBegin).)
> >
> > I've giving this a bit more thought.  I said this is a spec
> > issue, but the
> > JAX-RPC spec weasels out of it (section 5.2.2 Remote
> > Reference Passing):
> >
> > "The JAX-RPC specification does not require support for the 
> passing or
> > return of a
> > remote reference across a remote method invocation. The
> > reason is that SOAP
> > [5]
> > specifies object-by-reference as out of scope in both the 
> 1.1 and 1.2
> > versions. Any
> > support for remote reference passing in the JAX-RPC would be
> > non-standard
> > and hence
> > constrain interoperability."
> >
> > Java's parameter passing mode is really object-by-reference
> > even though
> > it's not often used that way.  This particular example IS
> > using it that way
> > and the SOAP specs themselves don't even want to deal with it.  That
> > doesn't mean AXIS can't provide a solution, but I suspect 
> it would be
> > difficult.  Obviously, if we DO solve this, it will be completely
> > non-interoperable.  It would ONLY work AXIS->AXIS.
> >
> > Time for a little brainstorming (and PLEASE join in!)  A
> > possible solution
> > is to somehow tell Java2WSDL that a particular parameter on a
> > particular
> > method should be treated specially - in other words, sent 
> on both the
> > request message AND the reply message.  If we can get the runtime to
> > recognize this special case, then another issue is how does
> > this look on
> > the client?  Can we keep the same signature or does it have
> > to be marked
> > somehow?  How does the stub distinguish between an input
> > parameter and this
> > special inout parameter?  Will the stub be able to receive the new
> > ReadContext and make the updates?  If ReadContext is simply a
> > bean, then
> > the stub may be able to simply call the accessors and
> > transfer data.  If
> > ReadContext is NOT a bean, then I don't know whether we can 
> solve this
> > problem.  Thoughts?  Ideas?
> >
> > Russell Butek
> > butek@us.ibm.com
> >
> >
> > Russell Butek/Austin/IBM@IBMUS on 01/11/2002 07:20:33 AM
> >
> > Please respond to axis-user@xml.apache.org
> >
> > To:   axis-user@xml.apache.org
> > cc:
> > Subject:  RE: Explanation of how to use in/out parameters
> >
> >
> >
> > I'm puzzled.  Java does not have the concept of an inout
> > parameter.  So
> > there's no way for ReadContext to be inout in the existing 
> readWidget
> > method.  Do you mean that the implementation of readWidget updates
> > ReadContext?  (It's a nit, but that's not quite the same as
> > ReadContext
> > being in/out, the fields within ReadContext are in/out and
> > ReadContext is
> > essentially a holder.)
> >
> > This is a problem, and it's bigger than AXIS, it's a spec
> > issue.  We assume
> > parameters are input unless they're holders.  This covers the
> > vast majority
> > of situations because parameters in Java are primarily input.
> >  In order for
> > your situation to work we'd have to treat all parameters as
> > in/out (without
> > holders which means we might get into other problems) and
> > ALWAYS send the
> > parameter back on the response message.  This is a lot of
> > overhead since
> > most of the time the parameters are really only input and,
> > therefore, the
> > response parameters will most often be ignored.
> >
> > I don't have a solution for you.  Perhaps someone else would care to
> > respond?
> >
> > Russell Butek
> > butek@us.ibm.com
> >
> >
> > "Williams,Ed" <EWILLIAMS@cerner.com> on 01/10/2002 03:40:20 PM
> >
> > Please respond to axis-user@xml.apache.org
> >
> > To:   "'axis-user@xml.apache.org'" <axis-user@xml.apache.org>
> > cc:
> > Subject:  RE: Explanation of how to use in/out parameters
> >
> >
> >
> > Thank you Russell for the explanation and link (sorry about 
> the user's
> > guide
> > thing).
> > Here is my problem with this solution that might be common
> > (hopefully you
> > can offer a solution).
> > I have an existing, established, published set of services 
> (Directory
> > classes with 'read', 'write', 'delete', etc).  Hundreds and
> > hundreds of
> > them
> > that have been exposed at the java level (through the
> > Directory classes)
> > and
> > through XML servlets (non-SOAP).  It would be a great burden, not to
> > consider a non-passive change to all my users, to change the
> > classnames to
> > 'Holders' to indicate in/out.  Can't this be done some 
> other way, like
> > making the class implement the Holder interface instead?
> > This would be
> > passive and it seems more elegant than parsing the name of a class.
> > Granted, I have no grasp on all the issues that went into
> > this decision.
> >
> >
> > -----Original Message-----
> > From: Russell Butek [mailto:butek@us.ibm.com]
> > Sent: Thursday, January 10, 2002 2:54 PM
> > To: axis-user@xml.apache.org
> > Subject: Re: Explanation of how to use in/out parameters
> >
> >
> > The holders are documented in the JAX-RPC spec
> > (http://java.sun.com/xml/jaxrpc/index.html).
> >
> > The users's guide is out of date.  Thanks for bringing this
> > up!  I'll have
> > to fix it when I get the chance.  WSDL2Java ONLY generates 
> holders if
> > they're needed.  What you want to do is to change your
> > signature to read:
> >
> > Widget readWidget(ReadContextHolder rc, WidgetQualifier wq);
> >
> > Java2WSDL recognizes any parameter ending in "Holder" and
> > having a public
> > value field as a JAX-RPC holder.  Here's what your holder
> > class should look
> > like:
> >
> > public final class ReadContextHolder implements 
> java.io.Serializable {
> >     public ReadContext value;
> >
> >     public ReadContextHolder() {
> >     }
> >
> >     public ReadContextHolder(ReadContext value) {
> >         this.value = value;
> >     }
> > }
> >
> > Russell Butek
> > butek@us.ibm.com
> >
> >
> > "Williams,Ed" <EWILLIAMS@cerner.com> on 01/10/2002 02:40:09 PM
> >
> > Please respond to axis-user@xml.apache.org
> >
> > To:   "'axis-user@xml.apache.org'" <axis-user@xml.apache.org>
> > cc:
> > Subject:  Explanation of how to use in/out parameters
> >
> >
> >
> > Can anyone point me to where in/out parameters have been
> > discussed/explained, because I seem to be left out?  I've
> > picked up from
> > that Holders are probably the answer, but I can find 
> nothing on them.
> >
> > Alternatively, someone please answer the questions I am finding:
> > The User's Guide (only doc I can find) has a section on
> > Holders in which it
> > says: "You'll notice that for each data class that Wsdl2java
> > generates,
> > there is a corresponding "Holder" class".  I don't see any
> > "Holder" classes
> > generated for my service.
> > My service has the following method in it:
> > Widget readWidget(ReadContext rc, WidgetQualifier wq);
> > I want the ReadContext to be "in/out" and the WidgetQualifier
> > to be "in".
> > How do you indicate this to the AxisServlet and to the
> > Java2WSDL (?WSDL)
> > generator?
> > Any help or info would be greatly appreciated.
> > Ed
> > CONFIDENTIALITY NOTICE
> >
> > This message and any included attachments are from Cerner
> > Corporation and
> > are intended only for the addressee. The information 
> contained in this
> > message is confidential and may constitute inside or
> > non-public information
> > under international, federal, or state securities laws. Unauthorized
> > forwarding, printing, copying, distribution, or use of such
> > information is
> > strictly prohibited and may be unlawful. If you are not the 
> addressee,
> > please promptly delete this message and notify the sender of
> > the delivery
> > error by e-mail or you may call Cerner's corporate offices in
> > Kansas City,
> > Missouri, U.S.A at (+1) (816)221-1024.
> > -------------------------------------------
> >
> >
> > CONFIDENTIALITY NOTICE
> >
> > This message and any included attachments are from Cerner
> > Corporation and
> > are intended only for the addressee. The information 
> contained in this
> > message is confidential and may constitute inside or
> > non-public information
> > under international, federal, or state securities laws. Unauthorized
> > forwarding, printing, copying, distribution, or use of such
> > information is
> > strictly prohibited and may be unlawful. If you are not the 
> addressee,
> > please promptly delete this message and notify the sender of
> > the delivery
> > error by e-mail or you may call Cerner's corporate offices in
> > Kansas City,
> > Missouri, U.S.A at (+1) (816)221-1024.
> > -------------------------------------------
> >
> >
> >
> >
> >
> 
> 

Mime
View raw message