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/message RPCArg.java SOAPHeader.java
Date Fri, 02 Feb 2001 02:53:26 GMT
dug         01/02/01 18:53:26

  Modified:    java/samples/stock GetQuote.java
               java/src/org/apache/axis/client HTTPCall.java
                        HTTPMessage.java
               java/src/org/apache/axis/handlers HTTPDispatchHandler.java
               java/src/org/apache/axis/message RPCArg.java SOAPHeader.java
  Log:
  Changed 'namespace' to 'prefix' - better name for it.
  
  Revision  Changes    Path
  1.6       +1 -1      xml-axis/java/samples/stock/GetQuote.java
  
  Index: GetQuote.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/stock/GetQuote.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GetQuote.java	2001/02/01 22:21:19	1.5
  +++ GetQuote.java	2001/02/02 02:53:25	1.6
  @@ -124,7 +124,7 @@
         System.out.println( symbol + ": " + res );
       }
       catch( Exception e ) {
  -      System.err.println( e );
  +      e.printStackTrace();
       }
     };
   
  
  
  
  1.4       +21 -3     xml-axis/java/src/org/apache/axis/client/HTTPCall.java
  
  Index: HTTPCall.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/HTTPCall.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HTTPCall.java	2001/02/01 22:21:25	1.3
  +++ HTTPCall.java	2001/02/02 02:53:25	1.4
  @@ -58,6 +58,8 @@
   package org.apache.axis.client ;
   
   import java.util.* ;
  +import org.w3c.dom.* ;
  +import org.apache.xerces.dom.DocumentImpl ;
   import org.apache.axis.* ;
   import org.apache.axis.message.* ;
   import org.apache.axis.handlers.* ;
  @@ -122,6 +124,21 @@
       body.setPrefix( "m" );
       body.setNamespaceURI( action );
       reqEnv.addBody( body );
  +
  +    // Until we have chains on the client force a debug header if needed
  +    if ( Debug.getDebugLevel() > 0  ) {
  +      SOAPHeader  header = new SOAPHeader();
  +      header.setPrefix("d");
  +      header.setName("Debug");
  +      header.setNamespaceURI( "http://xml.apache.org/axis/debug" );
  +      header.setActor( "http://schemas.xmlsoap.org/soap/actor/next" );
  +      Document doc = new DocumentImpl();
  +      Node node = doc.createTextNode( "" + Debug.getDebugLevel() );
  +      header.addDataNode( node );
  +  
  +      reqEnv.addHeader( header );
  +    }
  +
       msgContext.setProperty( "HTTP_URL", url );   // horrible name!
       msgContext.setProperty( "HTTP_ACTION", action );   // horrible name!
       try {
  @@ -129,9 +146,10 @@
         client.invoke( msgContext );
         client.cleanup();
       }
  -    catch( AxisFault fault ) {
  -      Debug.Print( 1,  fault );
  -      throw fault ;
  +    catch( Exception e ) {
  +      Debug.Print( 1, e );
  +      if ( !(e instanceof AxisFault ) ) e = new AxisFault( e );
  +      throw (AxisFault) e ;
       }
   
       resMsg = msgContext.getOutgoingMessage();
  
  
  
  1.2       +4 -4      xml-axis/java/src/org/apache/axis/client/HTTPMessage.java
  
  Index: HTTPMessage.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/HTTPMessage.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HTTPMessage.java	2001/02/01 22:21:25	1.1
  +++ HTTPMessage.java	2001/02/02 02:53:25	1.2
  @@ -121,10 +121,10 @@
   
       reqEnv.addBody( reqBody );
   
  -    if ( Debug.DebugOn(1) ) {
  -      Debug.Print( 1, "Request Message:" );
  -      Debug.Print( 1, (String) reqMsg.getAs("String") );
  -    }
  +    // if ( Debug.DebugOn(1) ) {
  +      // Debug.Print( 1, "Request Message:" );
  +      // Debug.Print( 1, (String) reqMsg.getAs("String") );
  +    // }
   
       msgContext.setProperty( "HTTP_URL", url );   // horrible name!
       msgContext.setProperty( "HTTP_ACTION", action );   // horrible name!
  
  
  
  1.4       +4 -0      xml-axis/java/src/org/apache/axis/handlers/HTTPDispatchHandler.java
  
  Index: HTTPDispatchHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/HTTPDispatchHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HTTPDispatchHandler.java	2001/02/01 22:21:27	1.3
  +++ HTTPDispatchHandler.java	2001/02/02 02:53:25	1.4
  @@ -115,6 +115,10 @@
         out.write( header.getBytes() );
         out.write( reqEnv.getBytes() );
   
  +      Debug.Print( 1, "XML sent:" );
  +      Debug.Print( 1, header );
  +      Debug.Print( 1, reqEnv );
  +
         byte       lastB=0, b ;
         int        len = 0 ;
         int        colonIndex = -1 ;
  
  
  
  1.6       +7 -7      xml-axis/java/src/org/apache/axis/message/RPCArg.java
  
  Index: RPCArg.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCArg.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RPCArg.java	2001/01/31 19:49:54	1.5
  +++ RPCArg.java	2001/02/02 02:53:26	1.6
  @@ -69,7 +69,7 @@
    * @author Doug Davis (dug@us.ibm.com)
    */
   public class RPCArg {
  -  protected String   namespace ;
  +  protected String   prefix ;
     protected String   namespaceURI ;
     protected String   name ;
     protected String   value ;         // only support String for now
  @@ -77,7 +77,7 @@
     public RPCArg() {} 
   
     public RPCArg(Element elem) {
  -    namespace = elem.getPrefix();
  +    prefix = elem.getPrefix();
       namespaceURI = elem.getNamespaceURI();
       name = elem.getLocalName();
       value = elem.getFirstChild().getNodeValue();
  @@ -93,8 +93,8 @@
       setValue( value );
     }
   
  -  public String getNamespace() { return( namespace ); }
  -  public void   setNamespace(String ns) { namespace = ns ; }
  +  public String getPrefix() { return( prefix ); }
  +  public void   setPrefix(String p) { prefix = p ; }
   
     public String getNamespaceURI() { return( namespaceURI ); }
     public void   setNamespaceURI(String nsuri) { namespaceURI = nsuri ; }
  @@ -108,9 +108,9 @@
     public Element getAsXML(Document doc) {
       Element   root ;
   
  -    if ( namespace != null ) {
  -      root = doc.createElementNS(namespace, namespace + ":" + name );
  -      root.setAttribute( "xmlns:" + namespace, namespaceURI );
  +    if ( prefix != null ) {
  +      root = doc.createElementNS(prefix, prefix + ":" + name );
  +      root.setAttribute( "xmlns:" + prefix, namespaceURI );
       }
       else {
         root = doc.createElement( name );
  
  
  
  1.6       +19 -14    xml-axis/java/src/org/apache/axis/message/SOAPHeader.java
  
  Index: SOAPHeader.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPHeader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SOAPHeader.java	2001/01/27 19:55:05	1.5
  +++ SOAPHeader.java	2001/02/02 02:53:26	1.6
  @@ -71,15 +71,18 @@
    */
   public class SOAPHeader {
     protected String    name ;
  -  protected String    namespace ;
  +  protected String    prefix ;
     protected String    namespaceURI ;
     protected boolean   mustUnderstand ;
     protected String    actor ;
     protected ArrayList data ;
   
  +  public SOAPHeader() {
  +  }
  +
     public SOAPHeader(Element elem) {
       String  value ;
  -    namespace = elem.getPrefix();
  +    prefix = elem.getPrefix();
       namespaceURI = elem.getNamespaceURI();
       name = elem.getLocalName();
       value = elem.getAttributeNS( Constants.URI_SOAP_ENV,
  @@ -91,22 +94,25 @@
     }
   
     public String getName() { return( name ); }
  -  public void   setName(String n) { name = n; }
  +  public void setName(String n) { name = n; }
   
  -  public String getNamespace() { return( namespace ); }
  -  public void   setNamespace(String ns) { namespace = ns; }
  +  public String getPrefix() { return( prefix ); }
  +  public void setPrefix(String p) { prefix = p; }
   
     public String getNamespaceURI() { return( namespaceURI ); }
  -  public void   setNamespaceURI(String nsuri) { namespaceURI = nsuri ; }
  +  public void setNamespaceURI(String nsuri) { namespaceURI = nsuri ; }
   
     public boolean getMustUnderstand() { return( mustUnderstand ); }
  -  public void    setMustUnderstand(boolean b) { mustUnderstand = b ; }
  +  public void setMustUnderstand(boolean b) { mustUnderstand = b ; }
   
  -  public String  getActor() { return( actor ); }
  -  public void    setActor(String a) { actor = a ; }
  +  public String getActor() { return( actor ); }
  +  public void setActor(String a) { actor = a ; }
   
  -  public Node[]    getData() { return( (Node[]) data.toArray() ); }
  -  public void      addDataNode(Node n) { data.add(n); };
  +  public Node[] getData() { return( (Node[]) data.toArray() ); }
  +  public void addDataNode(Node n) { 
  +    if ( data == null ) data = new ArrayList();
  +    data.add(n); 
  +  };
   
     public void setData(NodeList nl) { 
       data = null ;
  @@ -116,9 +122,8 @@
     }
   
     public Element getAsXML(Document doc) {
  -    Element   root = doc.createElementNS(namespace, namespace + ":" +
  -                                         name );
  -    root.setAttribute( "xmlns:" + namespace, namespaceURI );
  +    Element   root = doc.createElementNS(prefix, prefix + ":" + name );
  +    root.setAttribute( "xmlns:" + prefix, namespaceURI );
       if ( mustUnderstand )
         root.setAttributeNS( Constants.URI_SOAP_ENV,
                              Constants.ATTR_MUST_UNDERSTAND,
  
  
  

Mime
View raw message