axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: xml-axis/java/test/outparams TestOutParams.java
Date Fri, 09 Nov 2001 00:02:56 GMT
dug         01/11/08 16:02:56

  Modified:    java/samples/stock GetQuote.wsdl GetQuote1.java
                        StockQuoteService.java deploy.wsdd
               java/src/org/apache/axis/client Call.java Service.java
                        ServiceClient.java
               java/src/org/apache/axis/utils resources.properties
               java/test/encoding TestXsiType.java
               java/test/outparams TestOutParams.java
  Log:
  Add a setOperation() method on Call.
  This will allow us to reuse a Call object (and its session data)
  but call a different operationName - telling Call to get the
  data from the WSDL document (if there was one).
  
  Clearly missing function in JAX-RPC.
  
  Revision  Changes    Path
  1.4       +20 -0     xml-axis/java/samples/stock/GetQuote.wsdl
  
  Index: GetQuote.wsdl
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/stock/GetQuote.wsdl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GetQuote.wsdl	2001/10/05 13:06:22	1.3
  +++ GetQuote.wsdl	2001/11/09 00:02:56	1.4
  @@ -8,6 +8,10 @@
                xmlns="http://schemas.xmlsoap.org/wsdl/">
   
     <!-- message declns -->
  +  <message name="testRequest">
  +    <part name="string" type="xsd:string"/>
  +  </message>
  +
     <message name="GetQuoteRequest">
       <part name="symbol" type="xsd:string"/>
     </message>
  @@ -22,6 +26,9 @@
         <input  message="tns:GetQuoteRequest"/>
         <output message="tns:GetQuoteResponse"/>
       </operation>
  +    <operation name="test" >
  +      <output message="tns:GetQuoteResponse"/>
  +    </operation>
     </portType>
   
     <!-- binding declns -->
  @@ -30,6 +37,19 @@
                     transport="http://schemas.xmlsoap.org/soap/http"/>
       <operation name="getQuote">
         <soap:operation soapAction="getQuote"/>
  +      <input>
  +        <soap:body use="encoded" 
  +                   namespace="urn:xmltoday-delayed-quotes" 
  +                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  +      </input>
  +      <output>
  +        <soap:body use="encoded" 
  +                   namespace="urn:xmltoday-delayed-quotes"
  +                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  +      </output>
  +    </operation>
  +    <operation name="test">
  +      <soap:operation soapAction="test"/>
         <input>
           <soap:body use="encoded" 
                      namespace="urn:xmltoday-delayed-quotes" 
  
  
  
  1.17      +60 -0     xml-axis/java/samples/stock/GetQuote1.java
  
  Index: GetQuote1.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/stock/GetQuote1.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- GetQuote1.java	2001/10/31 23:50:19	1.16
  +++ GetQuote1.java	2001/11/09 00:02:56	1.17
  @@ -171,6 +171,56 @@
         return( ((Float) result).floatValue() );
       }
   
  +    /**
  +     * This will use the WSDL to prefill all of the info needed to make
  +     * the call.  All that's left is filling in the args to invoke().
  +     */
  +    public float getQuote3(String args[]) throws Exception {
  +      Options  opts = new Options( args );
  +
  +      args = opts.getRemainingArgs();
  +
  +      if ( args == null ) {
  +        System.err.println( "Usage: GetQuote <symbol>" );
  +        System.exit(1);
  +      }
  +
  +      /* Define the service QName and port QName */
  +      /*******************************************/
  +      QName servQN = new QName("urn:xmltoday-delayed-quotes","GetQuoteService");
  +      QName portQN = new QName("urn:xmltoday-delayed-quotes","GetQuote");
  +
  +      /* Now use those QNames as pointers into the WSDL doc */
  +      /******************************************************/
  +      Service service = new Service( new URL("file:GetQuote.wsdl"), servQN );
  +      Call    call    = (Call) service.createCall( portQN, "getQuote" );
  +
  +      /* Strange - but allows the user to change just certain portions of */
  +      /* the URL we're gonna use to invoke the service.  Useful when you  */
  +      /* want to run it thru tcpmon (ie. put  -p81 on the cmd line).      */
  +      /********************************************************************/
  +      opts.setDefaultURL( call.getTargetEndpointAddress() );
  +      call.setTargetEndpointAddress( new URL(opts.getURL()) );
  +
  +      /* Define some service specific properties */
  +      /*******************************************/
  +      call.setProperty( Transport.USER, opts.getUser() );
  +      call.setProperty( Transport.PASSWORD, opts.getPassword() );
  +
  +      /* Get symbol and invoke the service */
  +      /*************************************/
  +      Object result = call.invoke( new Object[] { symbol = args[0] } );
  +      result = call.invoke( new Object[] { symbol = args[0] } );
  +
  +      call.setOperation( portQN, "test" );
  +      opts.setDefaultURL( call.getTargetEndpointAddress() );
  +      call.setTargetEndpointAddress( new URL(opts.getURL()) );
  +
  +      System.out.println( call.invoke(new Object[]{}) );
  +
  +      return( ((Float) result).floatValue() );
  +    }
  +
       public static void main(String args[]) {
         try {
             String    save_args[] = new String[args.length];
  @@ -179,19 +229,29 @@
   
             /* Call the getQuote() that uses the WDSL */
             /******************************************/
  +          System.out.println("Using WSDL");
             System.arraycopy( args, 0, save_args, 0, args.length );
             val = gq.getQuote1( args );
             System.out.println( gq.symbol + ": " + val );
   
             /* Call the getQuote() that does it all manually */
             /*************************************************/
  +          System.out.println("Manually");
             System.arraycopy( save_args, 0, args, 0, args.length );
             val = gq.getQuote2( args );
             System.out.println( gq.symbol + ": " + val );
  +
  +          /* Call the getQuote() that uses Axis's generated WSDL */
  +          /*******************************************************/
  +          System.out.println("WSDL + Reuse Call");
  +          System.arraycopy( save_args, 0, args, 0, args.length );
  +          val = gq.getQuote3( args );
  +          System.out.println( gq.symbol + ": " + val );
         }
         catch( Exception e ) {
             if ( e instanceof AxisFault ) {
                 ((AxisFault)e).dump();
  +              e.printStackTrace();
             } else
                 e.printStackTrace();
         }
  
  
  
  1.12      +4 -0      xml-axis/java/samples/stock/StockQuoteService.java
  
  Index: StockQuoteService.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/stock/StockQuoteService.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- StockQuoteService.java	2001/10/30 16:46:32	1.11
  +++ StockQuoteService.java	2001/11/09 00:02:56	1.12
  @@ -70,6 +70,10 @@
    * @author Doug Davis (dug@us.ibm.com)
    */
   public class StockQuoteService {
  +  public String test() {
  +    return( "Just a test" );
  +  }
  +
     public float getQuote (String symbol) throws Exception {
       // get a real (delayed by 20min) stockquote from 
       // http://www.xmltoday.com/examples/stockquote/. The IP addr 
  
  
  
  1.3       +1 -1      xml-axis/java/samples/stock/deploy.wsdd
  
  Index: deploy.wsdd
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/stock/deploy.wsdd,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- deploy.wsdd	2001/11/07 21:04:20	1.2
  +++ deploy.wsdd	2001/11/09 00:02:56	1.3
  @@ -12,7 +12,7 @@
   			xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">
     <service name="urn:xmltoday-delayed-quotes" provider="java:RPC">
       <parameter name="className" value="samples.stock.StockQuoteService" />
  -    <parameter name="methodName" value="getQuote" />
  +    <parameter name="methodName" value="getQuote test" />
       <parameter name="allowedRoles" value="user1,user2"/>
   
       <requestFlow name="checks">
  
  
  
  1.36      +190 -6    xml-axis/java/src/org/apache/axis/client/Call.java
  
  Index: Call.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- Call.java	2001/11/08 15:06:53	1.35
  +++ Call.java	2001/11/09 00:02:56	1.36
  @@ -73,11 +73,30 @@
   import org.apache.axis.message.SOAPFaultElement;
   import org.apache.axis.message.SOAPHeader;
   import org.apache.axis.transport.http.HTTPTransport;
  +import org.apache.axis.transport.http.HTTPConstants;
   import org.apache.axis.utils.JavaUtils;
  +
  +import javax.xml.rpc.encoding.XMLType ;
  +
   import org.apache.log4j.Category;
   
  -import javax.xml.rpc.encoding.XMLType;
  +import javax.wsdl.Binding;
  +import javax.wsdl.BindingInput;
  +import javax.wsdl.BindingOperation;
  +import javax.wsdl.Definition;
  +import javax.wsdl.Input;
  +import javax.wsdl.Operation;
  +import javax.wsdl.Output;
  +import javax.wsdl.Part;
  +import javax.wsdl.Port;
  +import javax.wsdl.PortType;
  +import com.ibm.wsdl.extensions.soap.SOAPAddress;
  +import com.ibm.wsdl.extensions.soap.SOAPBody;
  +import com.ibm.wsdl.extensions.soap.SOAPOperation;
  +
   import javax.xml.rpc.namespace.QName;
  +import javax.xml.rpc.JAXRPCException;
  +
   import java.io.PrintWriter;
   import java.io.StringWriter;
   import java.net.MalformedURLException;
  @@ -85,6 +104,11 @@
   import java.util.Enumeration;
   import java.util.Hashtable;
   import java.util.Vector;
  +import java.util.HashSet;
  +import java.util.Iterator;
  +import java.util.List;
  +import java.util.Map;
  +import java.util.Set;
   
   /**
    * Axis' JAXRPC Dynamic Invocation Interface implementation of the Call
  @@ -105,6 +129,7 @@
   public class Call implements javax.xml.rpc.Call {
       static Category category = Category.getInstance(Call.class.getName());
   
  +    private Service            service         = null ;
       private QName              portTypeName    = null ;
       private String             operationName   = null ;
       private Vector             paramNames      = null ;
  @@ -157,7 +182,8 @@
       /**
        * Default constructor - not much else to say.
        */
  -    public Call() {
  +    public Call(Service service) {
  +        this.service = service ;
           setEngine( new AxisClient(configProvider) );
           if ( !initialized ) initialize();
       }
  @@ -168,8 +194,8 @@
        * @param url the target endpoint URL
        * @exception MalformedURLException
        */
  -    public Call(String url) throws MalformedURLException {
  -        this();
  +    public Call(String url) throws MalformedURLException, JAXRPCException {
  +        this(new Service());
           setTargetEndpointAddress(new URL(url));
       }
   
  @@ -178,8 +204,8 @@
        *
        * @param url the target endpoint URL
        */
  -    public Call(URL url) {
  -        this();
  +    public Call(URL url) throws JAXRPCException {
  +        this(new Service());
           setTargetEndpointAddress(url);
       }
   
  @@ -298,6 +324,159 @@
           operationName = opName ;
       }
   
  +    public void setOperation(QName portName, String opName) 
  +                      throws JAXRPCException{
  +        if ( service == null ) 
  +            throw new JAXRPCException( JavaUtils.getMessage("noService04") );
  +
  +        Definition wsdlDefinition = service.getWSDLDefinition();
  +        javax.wsdl.Service wsdlService = service.getWSDLService();
  +
  +        javax.wsdl.QName qn = new javax.wsdl.QName( portName.getNamespaceURI(),
  +                                                    portName.getLocalPart() );
  +        if ( wsdlDefinition == null )
  +            throw new JAXRPCException( JavaUtils.getMessage("wsdlMissing00") );
  +
  +        Port port = wsdlService.getPort( portName.getLocalPart() );
  +        if ( port == null )
  +            throw new JAXRPCException( JavaUtils.getMessage("noPort00", "" + portName)
);
  +
  +        Binding   binding  = port.getBinding();
  +        PortType  portType = binding.getPortType();
  +        if ( portType == null )
  +            throw new JAXRPCException( JavaUtils.getMessage("noPortType00", "" + portName)
);
  +
  +        List operations = portType.getOperations();
  +        if ( operations == null )
  +            throw new JAXRPCException( JavaUtils.getMessage("noOperation01", opName) );
  +        Operation op = null ;
  +        for ( int i = 0 ; i < operations.size() ; i++, op=null ) {
  +            op = (Operation) operations.get( i );
  +            if ( opName.equals( op.getName() ) ) break ;
  +        }
  +        if ( op == null )
  +            throw new JAXRPCException( JavaUtils.getMessage("noOperation01", opName) );
  +
  +        this.setPortTypeName( portName );
  +        this.setOperationName( opName );
  +
  +        // Get the URL
  +        ////////////////////////////////////////////////////////////////////
  +        this.setTargetEndpointAddress( null );
  +        List list = port.getExtensibilityElements();
  +        for ( int i = 0 ; list != null && i < list.size() ; i++ ) {
  +            Object obj = list.get(i);
  +            if ( obj instanceof SOAPAddress ) { 
  +                try {
  +                    SOAPAddress addr = (SOAPAddress) obj ;
  +                    URL         url  = new URL(addr.getLocationURI());
  +                    this.setTargetEndpointAddress(url);
  +                }
  +                catch(Exception exp) {
  +                    throw new JAXRPCException(
  +                            JavaUtils.getMessage("cantSetURI00", "" + exp) );
  +                }
  +            }
  +        }
  +
  +        // Get the SOAPAction
  +        ////////////////////////////////////////////////////////////////////
  +        BindingOperation bop = binding.getBindingOperation(opName,
  +                                                           null, null);
  +        this.removeProperty(HTTPConstants.MC_HTTP_SOAPACTION);
  +        list = bop.getExtensibilityElements();
  +        for ( int i = 0 ; list != null && i < list.size() ; i++ ) {
  +            Object obj = list.get(i);
  +            if ( obj instanceof SOAPOperation ) { 
  +                SOAPOperation sop    = (SOAPOperation) obj ;
  +                String        action = sop.getSoapActionURI();
  +                if ( action != null )
  +                    this.setProperty(HTTPConstants.MC_HTTP_SOAPACTION, action);
  +                break ;
  +            }
  +        }
  +
  +        // Get the body's namespace URI and encoding style
  +        ////////////////////////////////////////////////////////////////////
  +        this.removeProperty( org.apache.axis.client.Call.NAMESPACE );
  +        this.setEncodingStyle( null );
  +        BindingInput bIn = bop.getBindingInput();
  +        if ( bIn != null ) {
  +            list = bIn.getExtensibilityElements();
  +            for ( int i = 0 ; list != null && i < list.size() ; i++ ) {
  +                Object obj = list.get(i);
  +                if ( obj instanceof SOAPBody ) { 
  +                    SOAPBody sBody  = (SOAPBody) obj ;
  +                    String   tmp     = sBody.getNamespaceURI();
  +                    if ( tmp != null )
  +                        this.setProperty( org.apache.axis.client.Call.NAMESPACE, 
  +                                          tmp );
  +                    list = sBody.getEncodingStyles();
  +                    if ( list != null && list.size() > 0 )
  +                        this.setEncodingStyle( (String) list.get(0) );
  +                    break ;
  +                }
  +            }
  +        }
  +
  +        // Get the parameters
  +        ////////////////////////////////////////////////////////////////////
  +        List    paramOrder = op.getParameterOrdering();
  +        Input   input      = op.getInput();
  +        javax.wsdl.Message message    = null ;
  +        List    parts      = null ;
  +
  +        this.removeAllParameters();
  +        if ( input   != null ) message = input.getMessage();
  +        if ( message != null ) parts   = message.getOrderedParts( paramOrder );
  +        if ( parts != null ) {
  +            for ( int i = 0 ; i < parts.size() ; i++ ) {
  +                Part    part = (Part) parts.get(i);
  +                if ( part == null ) continue ;
  +
  +                String           name  = part.getName();
  +                javax.wsdl.QName type  = part.getTypeName();
  +
  +                if ( type == null )
  +                    throw new JAXRPCException(
  +                            JavaUtils.getMessage("typeNotSet00", name) );
  +
  +                QName     tmpQN = new QName( type.getNamespaceURI(),
  +                                             type.getLocalPart());
  +                XMLType   xmlType = new org.apache.axis.encoding.XMLType(tmpQN);
  +                int       mode = Call.PARAM_MODE_IN ;
  +                this.addParameter( name, xmlType, mode );
  +            }
  +        }
  +
  +
  +        // Get the return type
  +        ////////////////////////////////////////////////////////////////////
  +        Output   output  = op.getOutput();
  +        message = null ;
  +
  +        if ( output  != null ) message = output.getMessage();
  +        if ( message != null ) parts   = message.getOrderedParts(null);
  +
  +        this.setReturnType( null );
  +        if ( parts != null ) {
  +            for( int i = 0 ;i < parts.size() ; i++ ) {
  +                Part part  = (Part) parts.get( i );
  +
  +                if (paramOrder != null && paramOrder.contains(part.getName()))
  +                        continue ;
  +
  +                javax.wsdl.QName type  = part.getTypeName();
  +                QName    tmpQN = new QName( type.getNamespaceURI(),
  +                                            type.getLocalPart());
  +                XMLType  xmlType = new org.apache.axis.encoding.XMLType(tmpQN);
  +                this.setReturnType( xmlType );
  +                break ;
  +            }
  +        }
  +
  +    }
  +
       /**
        * Returns the fully qualified name of the port for this Call object
        * (if there is one).
  @@ -326,6 +505,11 @@
        */
       public void setTargetEndpointAddress(java.net.URL address) {
           try {
  +            if ( address == null ) {
  +                setTransport(null);
  +                return ;
  +            }
  +
               String protocol = address.getProtocol();
               Transport transport = getTransportForProtocol(protocol);
               if (transport == null)
  
  
  
  1.20      +13 -138   xml-axis/java/src/org/apache/axis/client/Service.java
  
  Index: Service.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Service.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Service.java	2001/11/06 15:41:25	1.19
  +++ Service.java	2001/11/09 00:02:56	1.20
  @@ -2,7 +2,7 @@
   * The Apache Software License, Version 1.1
   *
   *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  +* Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
  @@ -104,6 +104,14 @@
       private Definition          wsdlDefinition = null ;
       private javax.wsdl.Service  wsdlService    = null ;
   
  +    Definition getWSDLDefinition() {
  +        return( wsdlDefinition );
  +    }
  +
  +    javax.wsdl.Service getWSDLService() {
  +        return( wsdlService );
  +    }
  +
       /**
        * Constructs a new Service object - this assumes the caller will set
        * the appropriate fields by hand rather than getting them from the
  @@ -263,7 +271,7 @@
           if ( portType == null )
               throw new JAXRPCException( JavaUtils.getMessage("noPortType", "" + portName)
);
   
  -        org.apache.axis.client.Call call = new org.apache.axis.client.Call();
  +        org.apache.axis.client.Call call = new org.apache.axis.client.Call(this);
           call.setPortTypeName( portName );
   
           // Get the URL
  @@ -300,142 +308,9 @@
       public javax.xml.rpc.Call createCall(QName portName, 
                                            String operationName)
                              throws JAXRPCException {
  -        javax.wsdl.QName qn = new javax.wsdl.QName( portName.getNamespaceURI(),
  -                                                    portName.getLocalPart() );
  -        if ( wsdlDefinition == null )
  -            throw new JAXRPCException( JavaUtils.getMessage("wsdlMissing00") );
  -
  -        Port port = wsdlService.getPort( portName.getLocalPart() );
  -        if ( port == null )
  -            throw new JAXRPCException( JavaUtils.getMessage("noPort00", "" + portName)
);
  -
  -        Binding   binding  = port.getBinding();
  -        PortType  portType = binding.getPortType();
  -        if ( portType == null )
  -            throw new JAXRPCException( JavaUtils.getMessage("noPortType00", "" + portName)
);
  -
  -        List operations = portType.getOperations();
  -        if ( operations == null )
  -            throw new JAXRPCException( JavaUtils.getMessage("noOperation01", operationName)
);
  -        Operation op = null ;
  -        for ( int i = 0 ; i < operations.size() ; i++, op=null ) {
  -            op = (Operation) operations.get( i );
  -            if ( operationName.equals( op.getName() ) ) break ;
  -        }
  -        if ( op == null )
  -            throw new JAXRPCException( JavaUtils.getMessage("noOperation01", operationName)
);
  -
  -        org.apache.axis.client.Call call = new org.apache.axis.client.Call();
  -        call.setPortTypeName( portName );
  -        call.setOperationName( operationName );
  -
  -        // Get the URL
  -        ////////////////////////////////////////////////////////////////////
  -        List list = port.getExtensibilityElements();
  -        for ( int i = 0 ; list != null && i < list.size() ; i++ ) {
  -            Object obj = list.get(i);
  -            if ( obj instanceof SOAPAddress ) { 
  -                try {
  -                    SOAPAddress addr = (SOAPAddress) obj ;
  -                    URL         url  = new URL(addr.getLocationURI());
  -                    call.setTargetEndpointAddress(url);
  -                }
  -                catch(Exception exp) {
  -                    throw new JAXRPCException(
  -                            JavaUtils.getMessage("cantSetURI00", "" + exp) );
  -                }
  -            }
  -        }
  -
  -        // Get the SOAPAction
  -        ////////////////////////////////////////////////////////////////////
  -        BindingOperation bop = binding.getBindingOperation(operationName,
  -                                                           null, null);
  -        list = bop.getExtensibilityElements();
  -        for ( int i = 0 ; list != null && i < list.size() ; i++ ) {
  -            Object obj = list.get(i);
  -            if ( obj instanceof SOAPOperation ) { 
  -                SOAPOperation sop    = (SOAPOperation) obj ;
  -                String        action = sop.getSoapActionURI();
  -                if ( action != null )
  -                    call.setProperty(HTTPConstants.MC_HTTP_SOAPACTION, action);
  -                break ;
  -            }
  -        }
  -
  -        // Get the body's namespace URI and encoding style
  -        ////////////////////////////////////////////////////////////////////
  -        BindingInput bIn = bop.getBindingInput();
  -        list = bIn.getExtensibilityElements();
  -        for ( int i = 0 ; list != null && i < list.size() ; i++ ) {
  -            Object obj = list.get(i);
  -            if ( obj instanceof SOAPBody ) { 
  -                SOAPBody sBody  = (SOAPBody) obj ;
  -                String   tmp     = sBody.getNamespaceURI();
  -                if ( tmp != null )
  -                    call.setProperty( org.apache.axis.client.Call.NAMESPACE, 
  -                                      tmp );
  -                list = sBody.getEncodingStyles();
  -                if ( list != null && list.size() > 0 )
  -                    call.setEncodingStyle( (String) list.get(0) );
  -                break ;
  -            }
  -        }
  -
  -        // Get the parameters
  -        ////////////////////////////////////////////////////////////////////
  -        List    paramOrder = op.getParameterOrdering();
  -        Input   input      = op.getInput();
  -        Message message    = null ;
  -        List    parts      = null ;
  -
  -        if ( input   != null ) message = input.getMessage();
  -        if ( message != null ) parts   = message.getOrderedParts( paramOrder );
  -        if ( parts != null ) {
  -            for ( int i = 0 ; i < parts.size() ; i++ ) {
  -                Part    part = (Part) parts.get(i);
  -                if ( part == null ) continue ;
  -
  -                String           name  = part.getName();
  -                javax.wsdl.QName type  = part.getTypeName();
  -
  -                if ( type == null )
  -                    throw new JAXRPCException(
  -                            JavaUtils.getMessage("typeNotSet00", name) );
  -
  -                QName            tmpQN = new QName( type.getNamespaceURI(),
  -                                                    type.getLocalPart());
  -                XMLType          xmlType = new XMLType(tmpQN);
  -                int              mode = Call.PARAM_MODE_IN ;
  -                call.addParameter( name, xmlType, mode );
  -            }
  -        }
  -
  -
  -        // Get the return type
  -        ////////////////////////////////////////////////////////////////////
  -        Output   output  = op.getOutput();
  -        message = null ;
  -
  -        if ( output  != null ) message = output.getMessage();
  -        if ( message != null ) parts   = message.getOrderedParts(null);
  -
  -        if ( parts != null ) {
  -            for( int i = 0 ;i < parts.size() ; i++ ) {
  -                Part part  = (Part) parts.get( i );
  -
  -                if (paramOrder != null && paramOrder.contains(part.getName()))
  -                        continue ;
  -
  -                javax.wsdl.QName type  = part.getTypeName();
  -                QName            tmpQN = new QName( type.getNamespaceURI(),
  -                                                    type.getLocalPart());
  -                XMLType          xmlType = new XMLType(tmpQN);
  -                call.setReturnType( xmlType );
  -                break ;
  -            }
  -        }
   
  +        org.apache.axis.client.Call call=new org.apache.axis.client.Call(this);
  +        call.setOperation( portName, operationName );
           return( call );
       }
   
  @@ -448,7 +323,7 @@
        * @throws JAXRPCException If there's an error
        */
       public javax.xml.rpc.Call createCall() throws JAXRPCException {
  -        return( new org.apache.axis.client.Call() );
  +        return( new org.apache.axis.client.Call(this) );
       }
   
       /**
  
  
  
  1.66      +9 -9      xml-axis/java/src/org/apache/axis/client/ServiceClient.java
  
  Index: ServiceClient.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/ServiceClient.java,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- ServiceClient.java	2001/11/06 15:41:25	1.65
  +++ ServiceClient.java	2001/11/09 00:02:56	1.66
  @@ -142,15 +142,15 @@
       /**
        * Basic, no-argument constructor.
        */
  -    public ServiceClient () {
  -        call = new Call();
  +    public ServiceClient () throws Exception {
  +        call = new Call(new Service());
       }
   
       /**
        * Construct a ServiceClient with just an AxisEngine.
        */
  -    public ServiceClient (AxisEngine engine) {
  -        call = new Call();
  +    public ServiceClient (AxisEngine engine) throws Exception {
  +        call = new Call(new Service());
           call.setEngine(engine);
       }
   
  @@ -162,7 +162,7 @@
        *                    service.
        */
       public ServiceClient(String endpointURL)
  -            throws AxisFault
  +            throws AxisFault, Exception
       {
           try {
               call = new Call(endpointURL);
  @@ -175,7 +175,7 @@
        * Construct a ServiceClient with a given endpoint URL & engine
        */
       public ServiceClient(String endpointURL, AxisEngine engine)
  -            throws AxisFault
  +            throws AxisFault, Exception
       {
           try {
               call = new Call(endpointURL);
  @@ -192,15 +192,15 @@
        *                  to set up the MessageContext appropriately for each
        *                  request
        */
  -    public ServiceClient (Transport transport) {
  -        call = new Call();
  +    public ServiceClient (Transport transport) throws Exception {
  +        call = new Call(new Service());
           call.setTransport(transport);
       }
   
       /**
        * Construct a ServiceClient with the given Transport & engine.
        */
  -    public ServiceClient (Transport transport, AxisEngine engine) {
  +    public ServiceClient (Transport transport, AxisEngine engine) throws Exception {
           this(engine);
           call.setTransport(transport);
       }
  
  
  
  1.9       +1 -0      xml-axis/java/src/org/apache/axis/utils/resources.properties
  
  Index: resources.properties
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/resources.properties,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- resources.properties	2001/11/08 21:43:59	1.8
  +++ resources.properties	2001/11/09 00:02:56	1.9
  @@ -280,6 +280,7 @@
   noService01=No service has been defined
   noService02=This service is not available at this endpoint ({0}).
   noService03=No service/pivot
  +noService04=No service object defined for this Call object.
   
   #NOTE:  in noService04, do not translate "AXIS", "targetService"
   noService04=The AXIS engine could not find a target service to invoke!  targetService is
{0}
  
  
  
  1.6       +3 -1      xml-axis/java/test/encoding/TestXsiType.java
  
  Index: TestXsiType.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestXsiType.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestXsiType.java	2001/11/07 22:23:08	1.5
  +++ TestXsiType.java	2001/11/09 00:02:56	1.6
  @@ -7,6 +7,7 @@
   import org.apache.axis.providers.java.RPCProvider;
   import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.client.Call;
  +import org.apache.axis.client.Service;
   import org.apache.axis.encoding.SerializationContext;
   import org.apache.axis.encoding.XMLType;
   import org.apache.axis.message.RPCElement;
  @@ -89,7 +90,8 @@
           // correctly, even without the xsi:type attribute, because
           // we set the return type manually.
           
  -        Call call = new Call();
  +        Service S_service = new Service();
  +        Call call = (Call) S_service.createCall();
           call.setTransport(new LocalTransport(server));
           call.setReturnType(XMLType.XSD_DOUBLE);
           
  
  
  
  1.7       +5 -1      xml-axis/java/test/outparams/TestOutParams.java
  
  Index: TestOutParams.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/outparams/TestOutParams.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestOutParams.java	2001/10/31 23:50:22	1.6
  +++ TestOutParams.java	2001/11/09 00:02:56	1.7
  @@ -6,6 +6,7 @@
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
   import org.apache.axis.client.Call;
  +import org.apache.axis.client.Service;
   import org.apache.axis.encoding.XMLType;
   import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.message.RPCParam;
  @@ -37,7 +38,8 @@
                "</soap:Body>\n" +
           "</soap:Envelope>\n";
   
  -    private Call client = new Call();
  +    private Service s_service = null ;
  +    private Call    client    = null ;
       private AxisServer server = new AxisServer();
   
       public TestOutParams(String name) {
  @@ -51,6 +53,8 @@
       public void testOutputParams() throws Exception {
           // Register the service
           Handler h = new ServiceHandler();
  +        s_service = new Service();
  +        client  = (Call) s_service.createCall();
   
           // ??? Do we need to register the handler?
   
  
  
  

Mime
View raw message