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/src/org/apache/axis/client Service.java
Date Fri, 05 Oct 2001 10:55:14 GMT
dug         01/10/05 03:55:14

  Modified:    java/samples/stock GetQuote1.java
               java/src/org/apache/axis/client Service.java
  Log:
  get the body's namespace and encoding style from wsdl too
  
  Revision  Changes    Path
  1.6       +2 -3      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GetQuote1.java	2001/10/04 17:25:09	1.5
  +++ GetQuote1.java	2001/10/05 10:55:14	1.6
  @@ -55,6 +55,7 @@
   
   package samples.stock ;
   
  +import java.net.URL;
   import java.io.FileInputStream;
   
   import org.apache.axis.AxisFault ;
  @@ -91,13 +92,11 @@
         QName servQN = new QName("urn:xmltoday-delayed-quotes","GetQuoteService");
         QName portQN = new QName("urn:xmltoday-delayed-quotes","GetQuote");
   
  -      Service service = new Service( "GetQuote.wsdl", servQN );
  +      Service service = new Service( new URL("file:GetQuote.wsdl"), servQN );
         Call    call    = service.createCall( portQN, "getQuote" );
   
         // Define some service and Axis specific properties
  -      // Namespace should be part of JAXRPC but it isn't - too bad
         ////////////////////////////////////////////////////////////////////////
  -      call.setProperty( Constants.NAMESPACE, "urn:xmltoday-delayed-quotes" );
         call.setProperty( Transport.USER, opts.getUser() );
         call.setProperty( Transport.PASSWORD, opts.getPassword() );
   
  
  
  
  1.9       +23 -6     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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Service.java	2001/10/04 17:25:09	1.8
  +++ Service.java	2001/10/05 10:55:14	1.9
  @@ -66,15 +66,16 @@
   import java.io.InputStream ;
   import java.io.FileInputStream ;
   
  -import org.apache.axis.utils.XMLUtils ;
  -
  +import org.apache.axis.Constants ;
   import org.apache.axis.encoding.XMLType ;
   import org.apache.axis.rpc.JAXRPCException ;
   import org.apache.axis.rpc.namespace.QName ;
   import org.apache.axis.transport.http.HTTPConstants ;
  +import org.apache.axis.utils.XMLUtils ;
   
   import javax.wsdl.Definition ;
   import javax.wsdl.Binding ;
  +import javax.wsdl.BindingInput ;
   import javax.wsdl.BindingOperation ;
   import javax.wsdl.Input ;
   import javax.wsdl.Message ;
  @@ -86,6 +87,7 @@
   
   import com.ibm.wsdl.xml.WSDLReader ;
   import com.ibm.wsdl.extensions.soap.SOAPAddress ;
  +import com.ibm.wsdl.extensions.soap.SOAPBody ;
   import com.ibm.wsdl.extensions.soap.SOAPOperation ;
   
   /**
  @@ -358,6 +360,25 @@
                   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( Constants.NAMESPACE, tmp );
  +                list = sBody.getEncodingStyles();
  +                if ( list != null && list.size() > 0 )
  +                    call.setEncodingStyle( (String) list.get(0) );
  +                break ;
               }
           }
   
  @@ -373,7 +394,6 @@
           if ( parts != null ) {
               for ( int i = 0 ; i < parts.size() ; i++ ) {
                   Part    part = (Part) parts.get(i);
  -                // Part    part = message.getPart( name );
                   if ( part == null ) continue ;
   
                   String           name  = part.getName();
  @@ -383,8 +403,6 @@
                   XMLType          xmlType = new XMLType(tmpQN);
                   int              mode = Call.PARAM_MODE_IN ;
                   call.addParameter( name, xmlType, mode );
  -
  -                // System.err.println("Adding param: " + name );
               }
           }
   
  @@ -409,7 +427,6 @@
                                                       type.getLocalPart());
                   XMLType          xmlType = new XMLType(tmpQN);
                   call.setReturnType( xmlType );
  -                // System.err.println("Return type: " + type.getLocalPart() );
                   break ;
               }
           }
  
  
  

Mime
View raw message