No you don't have it right yet.

Let's say you have a class named Phone:

public class Phone implements java.io.Serializable {
    private int areaCode;
    private java.lang.String exchange;
    private java.lang.String number;

    public Phone() {
    }

    public int getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(int areaCode) {
        this.areaCode = areaCode;
    }

    public java.lang.String getExchange() {
        return exchange;
    }

    public void setExchange(java.lang.String exchange) {
        this.exchange = exchange;
    }

    public java.lang.String getNumber() {
        return number;
    }

    public void setNumber(java.lang.String number) {
        this.number = number;
    }

}

To pass this as an inOut parameter you need to create a class named
PhoneHolder which looks like:

public final class PhoneHolder implements javax.xml.rpc.holders.Holder {
    public Phone value;

    public PhoneHolder() {
    }

    public PhoneHolder(Phone value) {
        this.value = value;
    }
}

The generated wsld will have input and output messages that reference the
Phone type, but
you can tell that they are inout because the parameter name is in both the
input and output message.

<wsdl:message name="operationRequest">
      <wsdl:part name="phone" type="intf:Phone"/>
</wsdl:message>
<wsdl:message name="operationReply">
      <wsdl:part name="phone" type="intf:Phone"/>
</wsdl:message>


...
<wsdl:operation name="operation" >
         <wsdl:input message="intf:operationRequest"/>
         <wsdl:output message="intf:operationReply"/>
 </wsdl:operation>


See the test  test/wsdl/inout

Rich Scheuerle
XML & Web Services Development
512-838-5115  (IBM TL 678-5115)


                                                                                       
                                            
                      "Steve Pannier"                                                  
                                            
                      <spannier@jacada.        To:       [EMAIL PROTECTED]      
                                            
                      com>                     cc:                                     
                                            
                                               Subject:  Re: Java2WSDL In/Out/InOut 
method parameter question                      
                      02/27/2002 11:36                                                 
                                            
                      AM                                                               
                                            
                      Please respond to                                                
                                            
                      axis-user                                                        
                                            
                                                                                       
                                            
                                                                                       
                                            





Rich,

Thanks for the reply.  (Sorry for my slow response - I've been multitasking
and have finally gotten around to addressing this again.)

I have tried specifying an "InfoHolder" class, and I've also changed my
interfaces to classes.  I do get the parameter names to appear in the
generated WSDL, but my question now is:  Is there a way to tell if a
parameter is In vs. In/Out by looking at the generated WSDL?  Is it simply
the "Holder" suffix in the parameter name that designates the parameter
as In/Out?

Java classes and generated WSDL are attached.

(See attached file: banking.java)(See attached file: InfoHolder.java)(See
attached file: banking.wsdl)

Thanks.


Steve Pannier
Jacada, Inc.
(763) 268-6382
[EMAIL PROTECTED]
http://www.jacada.com



> Steve,
>
> You will need to specify an InfoHolder class for Info as defined by JSR
> 101.
> Java2WSDL will interpret a "Holder" parameter as InOut when generating
the
> WSDL.
>
> If you change your interface to a class and compile with -g, you should
get
> parameter names.
>
> Rich Scheuerle
> XML & Web Services Development
> 512-838-5115  (IBM TL 678-5115)
>
>
>
>                       "Steve Pannier"
>                       <spannier@jacada.        To:
> [EMAIL PROTECTED]
>                       com>                     cc:
>                                                Subject:  Java2WSDL
In/Out/InOut
> method parameter question
>                       02/11/2002 04:01
>                       PM
>                       Please respond to
>                       axis-user
>
>
>
>
>
>
> Does "Java2WSDL" have any knowledge of "In" vs "InOut" parameter types?
> Suppose I have a Java interface as follows:
>
> public interface banking {
>     public int getInfo(Info checking, Info saving);
> }
>
> The getInfo() method allows me to get checking & saving info based on
> account
> numbers supplied somewhere within the checking/saving structures.  It
> returns
> checking/saving structures updated with current info, plus an integer
> status code.
> Thus, the checking and saving parameters to getInfo() are each "InOut".
>
> The Info interface is defined as follows:
>
> public interface Info {
>     public String getChecking();
>     public void setChecking(String anum);
>
>     public String getSaving();
>     public void setSaving(String anum);
> }
>
>
> When I run "Java2WSDL" to generate WSDL from this interface, it shows
"in0"
> and "in1"
> for the parameters  on the "GetInfoRequest" message. (Output WSDL
> attached.)  How
> do I tell "Java2WSDL" that these parameters are actually "In/Out"?  Or is
> there a way to
> do this at all?  Stated another way: How would I go about creating a Java
> interface
> containing a method with one or more "In/Out" parameters, so that the
> generated WSDL
> contains proper definition of "in" vs. "out" parameters?  Is there any
> recommended
> reading that would describe what I've encountered here?
>
> (See attached file: banking.wsdl)
>
> Also, is there a way to get the actual parameter names ("checking" and
> "saving" in my
> example) to appear in the generated WSDL, rather than the "in0", "in1",
> etc?  I did compile
> my source with "-g".
>
> Thanks in advance.
>
>
> Steve Pannier
> Jacada, Inc.
> (763) 268-6382
> [EMAIL PROTECTED]
> http://www.jacada.com
>
>
>
> #### banking.wsdl has been removed from this note on February 12 2002 by
R
> J Scheuerle Jr
>
>





#### banking.java has been removed from this note on February 27 2002 by R
J Scheuerle Jr
#### InfoHolder.java has been removed from this note on February 27 2002 by
R J Scheuerle Jr
#### banking.wsdl has been removed from this note on February 27 2002 by R
J Scheuerle Jr


Reply via email to