You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by du...@apache.org on 2001/02/01 23:21:35 UTC
cvs commit: xml-axis/java/src/org/apache/axis/utils Debug.java Admin.java Constants.java
dug 01/02/01 14:21:34
Modified: java/samples/stock GetQuote.java deploy.xml
java/samples/xml deploy.xml init.xml
java/src/org/apache/axis FaultableHandler.java
SimpleChain.java SimpleTargetedChain.java
java/src/org/apache/axis/client AdminClient.java
HTTPCall.java
java/src/org/apache/axis/handlers EchoHandler.java
ErrorHandler.java HTTPDispatchHandler.java
LogHandler.java RPCDispatchHandler.java
java/src/org/apache/axis/message RPCBody.java SOAPBody.java
SOAPEnvelope.java
java/src/org/apache/axis/server SimpleAxisEngine.java
java/src/org/apache/axis/server/transports AxisServlet.java
java/src/org/apache/axis/utils Admin.java Constants.java
Added: java/src/org/apache/axis/client HTTPMessage.java
java/src/org/apache/axis/handlers MsgDispatchHandler.java
java/src/org/apache/axis/utils Debug.java
Log:
Added a MsgRouterHandler
Added a HTTPMessage class for the client to use for messaging
Changed AdminClient to use this new MsgRouterHandler
Added a Debug class to use instead of println's - more on this later
Changed SOAPBody - it was just plan wrong and confusing. It shouldn't
have read any of the xml - that's for things like RPCBody.
Changed the sample deploy.xml files.
Revision Changes Path
1.5 +3 -0 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- GetQuote.java 2001/01/31 19:49:47 1.4
+++ GetQuote.java 2001/02/01 22:21:19 1.5
@@ -62,6 +62,7 @@
import java.util.*;
import org.apache.axis.client.HTTPCall ;
+import org.apache.axis.utils.Debug ;
/**
*
@@ -83,6 +84,8 @@
for ( int i = 0 ; i < args.length ; i++ ) {
if ( args[i].charAt(0) == '-' )
switch( args[i].toLowerCase().charAt(1) ) {
+ case 'd': Debug.incDebugLevel();
+ break ;
case 'h': if ( args[i].length() > 2 )
host = args[i].substring(2);
break ;
1.3 +2 -2 xml-axis/java/samples/stock/deploy.xml
Index: deploy.xml
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/stock/deploy.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- deploy.xml 2001/01/28 05:12:40 1.2
+++ deploy.xml 2001/02/01 22:21:20 1.3
@@ -8,11 +8,11 @@
<!-- This file will be replaced by WSDD once it's ready -->
<deploy>
- <service name="urn:xmltoday-delayed-quotes" handler="JavaRPC" >
+ <service name="urn:xmltoday-delayed-quotes" handler="RPCDispatcher" >
<option name="className" value="samples.stock.StockQuoteService" />
<option name="methodName" value="getQuote" />
</service>
- <service name="urn:cominfo" handler="JavaRPC" >
+ <service name="urn:cominfo" handler="RPCDispatcher" >
<option name="className" value="samples.stock.ComInfoService" />
<option name="methodName" value="getInfo" />
</service>
1.4 +2 -5 xml-axis/java/samples/xml/deploy.xml
Index: deploy.xml
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/xml/deploy.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- deploy.xml 2001/01/26 17:31:31 1.3
+++ deploy.xml 2001/02/01 22:21:21 1.4
@@ -9,24 +9,21 @@
<deploy>
<handler name="log" class="org.apache.axis.handlers.LogHandler" />
- <handler name="rpc-dispatch" class="org.apache.axis.handlers.RPCDispatchHandler" />
<handler name="echo" class="org.apache.axis.handlers.EchoHandler" />
- <handler name="admin" class="org.apache.axis.handlers.AdminHandler" />
<handler name="error" class="org.apache.axis.handlers.ErrorHandler" />
<chain name="pre" flow="log" />
<chain name="echoChain" input="log" pivot="echo" output="log" />
<chain name="errorChain" input="log,log" pivot="error" output="log,log" />
- <service name="AdminService" handler="admin" />
<service name="EchoService" handler="echoChain" />
<service name="ErrorService" handler="errorChain" />
<service name="ErrorService1" handler="error" />
- <chain name="JavaRPC" flow="log,rpc-dispatch,log" />
+ <chain name="LogRPC" flow="log,RPCDispatch,log" />
<!--- sample showing up to give options
- <service name="urn:FOOBAR" handler="JavaRPC" >
+ <service name="urn:FOOBAR" handler="LogRPC" >
<option name="className" value="samples.stockquote.FooBar" />
<option name="methodName" value="doWork" />
</service>
1.2 +11 -2 xml-axis/java/samples/xml/init.xml
Index: init.xml
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/xml/init.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- init.xml 2001/01/23 14:55:44 1.1
+++ init.xml 2001/02/01 22:21:21 1.2
@@ -4,6 +4,15 @@
<!-- This file will be replaced by WSDD once it's ready -->
<deploy>
- <handler name="admin" class="org.apache.axis.handlers.AdminHandler" />
- <service name="AdminService" handler="admin" />
+ <handler name="MsgDispatcher"
+ class="org.apache.axis.handlers.MsgDispatchHandler" />
+
+ <handler name="RPCDispatcher"
+ class="org.apache.axis.handlers.RPCDispatchHandler" />
+
+ <service name="AdminService" handler="MsgDispatchHandler">
+ <option name="className" value="org.apache.axis.utils.Admin" />
+ <option name="methodName" value="AdminService" />
+ </service>
+
</deploy>
1.8 +5 -1 xml-axis/java/src/org/apache/axis/FaultableHandler.java
Index: FaultableHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/FaultableHandler.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FaultableHandler.java 2001/01/26 20:54:56 1.7
+++ FaultableHandler.java 2001/02/01 22:21:22 1.8
@@ -86,10 +86,12 @@
* and already processed it's undo logic - as needed.
*/
public void invoke(MessageContext msgContext) throws AxisFault {
+ Debug.Print( 1, "Enter: FaultableHandler::invoke" );
try {
workHandler.invoke( msgContext );
}
catch( Exception e ) {
+ Debug.Print( 1, e );
// Is this a Java Exception? a SOAPException? an AxisException?
if ( !(e instanceof AxisFault) )
e = new AxisFault( e );
@@ -100,14 +102,16 @@
faultHandler.invoke( msgContext );
throw (AxisFault) e ;
}
+ Debug.Print( 1, "Exit: FaultableHandler::invoke" );
}
/**
* Some handler later on has faulted so we need to undo our work.
*/
public void undo(MessageContext msgContext) {
- System.err.println( "In FaultableHandler:undo" );
+ Debug.Print( 1, "Enter: FaultableHandler::undo" );
workHandler.undo( msgContext );
+ Debug.Print( 1, "Exit: FaultableHandler::undo" );
};
public boolean canHandleBlock(QName qname) {
1.7 +5 -2 xml-axis/java/src/org/apache/axis/SimpleChain.java
Index: SimpleChain.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/SimpleChain.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SimpleChain.java 2001/01/26 20:54:57 1.6
+++ SimpleChain.java 2001/02/01 22:21:23 1.7
@@ -85,6 +85,7 @@
* rethrow the exception.
*/
public void invoke(MessageContext msgContext) throws AxisFault {
+ Debug.Print( 1, "Enter: SimpleChain::invoke" );
int i = 0 ;
try {
for ( i = 0 ; i < handlers.size() ; i++ )
@@ -92,12 +93,14 @@
}
catch( Exception e ) {
// undo in reverse order - rethrow
+ Debug.Print( 1, e );
if( !(e instanceof AxisFault ) )
e = new AxisFault( e );
while( --i >= 0 )
((Handler) handlers.elementAt( i )).undo( msgContext );
throw (AxisFault) e ;
}
+ Debug.Print( 1, "Exit: SimpleChain::invoke" );
}
/**
@@ -105,10 +108,10 @@
* later on has faulted - in reverse order.
*/
public void undo(MessageContext msgContext) {
- System.err.println( "In SimpleChain::undo" );
+ Debug.Print( 1, "Enter: SimpleChain::undo" );
for ( int i = handlers.size()-1 ; i >= 0 ; i-- )
((Handler) handlers.elementAt( i )).undo( msgContext );
-
+ Debug.Print( 1, "Exit: SimpleChain::undo" );
}
public boolean canHandleBlock(QName qname) {
1.7 +6 -1 xml-axis/java/src/org/apache/axis/SimpleTargetedChain.java
Index: SimpleTargetedChain.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/SimpleTargetedChain.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SimpleTargetedChain.java 2001/01/26 20:54:57 1.6
+++ SimpleTargetedChain.java 2001/02/01 22:21:23 1.7
@@ -89,11 +89,13 @@
* that has been successfully invoked and then rethrow the fault.
*/
public void invoke(MessageContext msgContext) throws AxisFault {
+ Debug.Print( 1, "Enter: SimpleTargetedChain::invoke" );
if ( inputChain != null ) inputChain.invoke( msgContext );
try {
if ( pivotHandler != null ) pivotHandler.invoke( msgContext );
}
catch( Exception e ) {
+ Debug.Print( 1, e );
if ( !(e instanceof AxisFault ) )
e = new AxisFault( e );
if ( inputChain != null ) inputChain.undo( msgContext );
@@ -103,22 +105,25 @@
if ( outputChain != null ) outputChain.invoke( msgContext );
}
catch( Exception e ) {
+ Debug.Print( 1, e );
if ( !(e instanceof AxisFault ) )
e = new AxisFault( e );
if ( pivotHandler != null ) pivotHandler.undo( msgContext );
if ( inputChain != null ) inputChain.undo( msgContext );
throw (AxisFault) e ;
}
+ Debug.Print( 1, "Exit: SimpleTargetedChain::invoke" );
}
/**
* Undo all of the work - in reverse order.
*/
public void undo(MessageContext msgContext) {
- System.err.println( "In SimpleTargetedChain:undo" );
+ Debug.Print( 1, "Enter: SimpleTargetedChain::undo" );
if ( outputChain != null ) outputChain.undo( msgContext );
if ( pivotHandler != null ) pivotHandler.undo( msgContext );
if ( inputChain != null ) inputChain.undo( msgContext );
+ Debug.Print( 1, "Exit: SimpleTargetedChain::undo" );
}
public boolean canHandleBlock(QName qname) {
1.6 +40 -26 xml-axis/java/src/org/apache/axis/client/AdminClient.java
Index: AdminClient.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/AdminClient.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AdminClient.java 2001/01/26 20:55:00 1.5
+++ AdminClient.java 2001/02/01 22:21:25 1.6
@@ -65,6 +65,12 @@
*
* @author Doug Davis (dug@us.ibm.com)
*/
+
+import org.apache.axis.Message ;
+import org.apache.axis.MessageContext ;
+import org.apache.axis.client.HTTPMessage ;
+import org.apache.axis.utils.Debug ;
+
public class AdminClient {
public static void main(String args[]) {
@@ -76,50 +82,58 @@
String msg = null ;
try {
- String host = "localhost" ;
- int port = 8080 ;
+ /* Parse the command line */
+ /***************************/
+ String host = "localhost" ;
+ String servlet = "/axis/servlet/AxisServlet" ;
+ int port = 8080 ;
for ( int i = 0 ; i < args.length ; i++ ) {
- if ( args[i].charAt(0) == '-' ) {
+ if ( args[i].charAt(0) == '-' )
switch( args[i].toLowerCase().charAt(1) ) {
- case 'h': if (args[i].length() > 2 )
+ case 'd': Debug.incDebugLevel();
+ break ;
+ case 'h': if ( args[i].length() > 2 )
host = args[i].substring(2);
break ;
- case 'p': if (args[i].length() > 2 )
+ case 'p': if ( args[i].length() > 2 )
port = Integer.parseInt(args[i].substring(2));
+ break ;
+ case 's': if ( args[i].length() > 2 )
+ servlet = args[i].substring(2);
+ if ( servlet != null && servlet.charAt(0) != '/' )
+ servlet = "/" + servlet ;
break ;
- default: System.err.println( "Unknown option '" +
+ case 'u': if ( args[i].length() > 2 ) {
+ URL tmpurl = new URL(args[i].substring(2));
+ host = tmpurl.getHost();
+ port = tmpurl.getPort();
+ servlet = tmpurl.getPath() ;
+ }
+ break ;
+ default: System.err.println( "Unknown option '" +
args[i].charAt(1) + "'" );
System.exit(1);
}
- }
else {
InputStream input = null ;
long length ;
System.out.println( "Processing file: " + args[i] );
- File file = new File(args[i]);
- length = file.length();
input = new FileInputStream( args[i] );
+
+ String url = "http://" + host + ":" + port + servlet ;
+ HTTPMessage hMsg = new HTTPMessage( url, "AdminService" );
+ MessageContext msgContext = new MessageContext();
+ Message inMsg = new Message( input, "InputStream" );
+ Message outMsg = null ;
+ msgContext.setIncomingMessage( inMsg );
+
+ hMsg.invoke( msgContext );
- Socket sock = new Socket( host, port );
- InputStream inp = sock.getInputStream();
- OutputStream out = sock.getOutputStream();
- String cl = "Content-Length: " + length + "\n\n" ;
-
- out.write( hdr.getBytes() );
- out.write( cl.getBytes() );
-
- byte[] buf = new byte[1000];
- int rc ;
- while ( (rc = input.read(buf)) > 0 )
- out.write( buf, 0, rc );
-
- while ( (rc = inp.read(buf,0,1000)) > 0 )
- System.out.write( buf,0,rc );
-
- sock.close();
+ outMsg = msgContext.getOutgoingMessage();
input.close();
+ System.err.println( outMsg.getAs( "String" ) );
}
}
}
1.3 +10 -5 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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HTTPCall.java 2001/01/31 21:36:37 1.2
+++ HTTPCall.java 2001/02/01 22:21:25 1.3
@@ -61,6 +61,7 @@
import org.apache.axis.* ;
import org.apache.axis.message.* ;
import org.apache.axis.handlers.* ;
+import org.apache.axis.utils.* ;
/**
*
@@ -95,15 +96,18 @@
this.action = action ;
}
- public static Object invoke(String url, String act, String m, Object[] args) {
+ public static Object invoke(String url, String act, String m, Object[] args)
+ throws AxisFault
+ {
HTTPCall ahc = new HTTPCall();
ahc.setURL( url );
ahc.setAction( act );
return( ahc.invoke( m, args ) );
}
- public Object invoke( String method, Object[] args ) {
+ public Object invoke( String method, Object[] args ) throws AxisFault {
// quote = HTTPCall.invoke( "getQuote", Object[] { "IBM" } );
+ Debug.Print( 1, "Enter: HTTPCall.invoke" );
RPCBody body = new RPCBody( method, args );
SOAPEnvelope reqEnv = new SOAPEnvelope();
SOAPEnvelope resEnv = null ;
@@ -115,7 +119,7 @@
Vector resArgs = null ;
RPCArg arg ;
- body.setNamespace( "m" );
+ body.setPrefix( "m" );
body.setNamespaceURI( action );
reqEnv.addBody( body );
msgContext.setProperty( "HTTP_URL", url ); // horrible name!
@@ -126,8 +130,8 @@
client.cleanup();
}
catch( AxisFault fault ) {
- System.err.println( fault );
- System.exit(1); /// ha!
+ Debug.Print( 1, fault );
+ throw fault ;
}
resMsg = msgContext.getOutgoingMessage();
@@ -137,6 +141,7 @@
body = (RPCBody) resBodies.get( 0 );
resArgs = body.getArgs();
arg = (RPCArg) resArgs.get(0);
+ Debug.Print( 1, "Exit: HTTPCall.invoke" );
return( (String) arg.getValue() );
}
1.1 xml-axis/java/src/org/apache/axis/client/HTTPMessage.java
Index: HTTPMessage.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, International
* Business Machines, Inc., http://www.ibm.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.axis.client ;
import java.util.* ;
import org.w3c.dom.* ;
import org.apache.axis.* ;
import org.apache.axis.message.* ;
import org.apache.axis.handlers.* ;
import org.apache.axis.utils.* ;
/**
*
* @author Doug Davis (dug@us.ibm.com)
*/
// Need to add proxy, ssl.... other cool things - but it's a start
// Only supports String
public class HTTPMessage {
private String url ;
private String action ;
public HTTPMessage() {
}
public HTTPMessage(String url) {
this.url = url ;
}
public HTTPMessage(String url, String action) {
setURL( url );
setAction( action );
}
public void setURL( String url ) {
this.url = url ;
}
public void setAction( String action ) {
this.action = action ;
}
public static void invoke(String url, String act, MessageContext mc )
throws AxisFault
{
HTTPMessage hm = new HTTPMessage();
hm.setURL( url );
hm.setAction( act );
hm.invoke( mc );
}
public void invoke( MessageContext mc ) throws AxisFault {
Debug.Print( 1, "Enter: HTTPMessage.invoke" );
Message inMsg = mc.getIncomingMessage();
Document doc = (Document) inMsg.getAs("Document");
Element root = doc.getDocumentElement();
SOAPBody reqBody = new SOAPBody( root );
SOAPEnvelope reqEnv = new SOAPEnvelope();
HTTPDispatchHandler client = new HTTPDispatchHandler();
Message reqMsg = new Message( reqEnv, "SOAPEnvelope" );
MessageContext msgContext = new MessageContext( reqMsg );
reqEnv.addBody( reqBody );
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!
try {
client.init();
client.invoke( msgContext );
client.cleanup();
}
catch( AxisFault fault ) {
Debug.Print( 1, fault );
throw fault ;
}
Message resMsg = msgContext.getOutgoingMessage();
SOAPEnvelope resEnv = (SOAPEnvelope) resMsg.getAs( "SOAPEnvelope" );
SOAPBody resBody = resEnv.getFirstBody();
mc.setOutgoingMessage( new Message(resBody.getAsDocument(), "Document") );
Debug.Print( 1, "Exit: HTTPMessage.invoke" );
}
}
1.9 +5 -3 xml-axis/java/src/org/apache/axis/handlers/EchoHandler.java
Index: EchoHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/EchoHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- EchoHandler.java 2001/01/27 19:05:59 1.8
+++ EchoHandler.java 2001/02/01 22:21:26 1.9
@@ -79,20 +79,22 @@
}
public void invoke(MessageContext msgContext) throws AxisFault {
+ Debug.Print( 1, "Enter: EchoHandler::invoke" );
try {
- System.err.println("In: EchoHandler");
Message msg = msgContext.getIncomingMessage();
SOAPEnvelope env = (SOAPEnvelope) msg.getAs( "SOAPEnvelope" );
msgContext.setOutgoingMessage( new Message( env, "SOAPEnvelope" ) );
}
catch( Exception e ) {
- e.printStackTrace();
+ Debug.Print( 1, e );
throw new AxisFault( e );
}
+ Debug.Print( 1, "Exit: EchoHandler::invoke" );
}
public void undo(MessageContext msgContext) {
- System.err.println( "In EchoHandler::undo" );
+ Debug.Print( 1, "Enter: EchoHandler::undo" );
+ Debug.Print( 1, "Exit: EchoHandler::undo" );
}
public boolean canHandleBlock(QName qname) {
1.7 +3 -2 xml-axis/java/src/org/apache/axis/handlers/ErrorHandler.java
Index: ErrorHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/ErrorHandler.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ErrorHandler.java 2001/01/26 20:55:02 1.6
+++ ErrorHandler.java 2001/02/01 22:21:26 1.7
@@ -75,12 +75,13 @@
}
public void invoke(MessageContext msgContext) throws AxisFault {
- System.err.println("In EchoHandler");
+ Debug.Print( 1, "Enter: ErrorHandler::invoke" );
throw new AxisFault( "Server.Whatever", "ERROR", null, null );
}
public void undo(MessageContext msgContext) {
- System.err.println( "In EchoHandler::undo" );
+ Debug.Print( 1, "Enter: ErrorHandler::undo" );
+ Debug.Print( 1, "Exit: ErrorHandler::undo" );
}
public boolean canHandleBlock(QName qname) {
1.3 +26 -4 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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HTTPDispatchHandler.java 2001/01/31 21:36:37 1.2
+++ HTTPDispatchHandler.java 2001/02/01 22:21:27 1.3
@@ -68,6 +68,7 @@
import org.apache.axis.message.* ;
/**
+ * This is meant to be used on a SOAP Client to call a SOAP server.
*
* @author Doug Davis (dug@us.ibm.com)
*/
@@ -81,6 +82,7 @@
}
public void invoke(MessageContext msgContext) throws AxisFault {
+ Debug.Print( 1, "Enter: HTTPDispatchHandler::invoke" );
/* Find the service we're invoking so we can grab it's options */
/***************************************************************/
String targetURL = (String) msgContext.getProperty( "HTTP_URL" );
@@ -99,8 +101,10 @@
if ( (port = tmpURL.getPort()) == -1 ) port = 80;
Socket sock = null ;
- sock = new Socket( host, port );
- reqEnv = (String) msgContext.getIncomingMessage().getAs("String");
+
+ sock = new Socket( host, port );
+ reqEnv = (String) msgContext.getIncomingMessage().getAs("String");
+
OutputStream out = sock.getOutputStream();
InputStream inp = sock.getInputStream();
String header = "POST " + tmpURL.getPath() + " HTTP/1.0\n" +
@@ -138,7 +142,19 @@
name = new String( buf, 0, len );
value = "" ;
}
- headers.put( name, value );
+ Debug.Print( 2, name + value );
+ if ( msgContext.getProperty(Constants.MC_HTTP_STATUS_CODE) == null ) {
+ // Reader status code
+ int start = name.indexOf( ' ' ) + 1 ;
+ int end = name.indexOf( ' ', start ) ;
+ rc = Integer.parseInt( name.substring(start, end) );
+ msgContext.setProperty( Constants.MC_HTTP_STATUS_CODE,
+ new Integer(rc) );
+ msgContext.setProperty( Constants.MC_HTTP_STATUS_LINE,
+ name.substring(end+1));
+ }
+ else
+ headers.put( name, value );
len = 0 ;
}
}
@@ -148,6 +164,11 @@
outMsg = new Message( parser.getDocument(), "Document" );
msgContext.setOutgoingMessage( outMsg );
+ if ( Debug.DebugOn(2) ) {
+ Debug.Print( 2, "XML received:" );
+ Message m = new Message( parser.getDocument(), "Document" );
+ Debug.Print( 2, (String) m.getAs( "String" ) );
+ }
}
inp.close();
@@ -155,10 +176,11 @@
sock.close();
}
catch( Exception e ) {
- e.printStackTrace();
+ Debug.Print( 1, e );
if ( !(e instanceof AxisFault) ) e = new AxisFault(e);
throw (AxisFault) e ;
}
+ Debug.Print( 1, "Exit: HTTPDispatchHandler::invoke" );
}
public void undo(MessageContext msgContext) {
1.8 +6 -4 xml-axis/java/src/org/apache/axis/handlers/LogHandler.java
Index: LogHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/LogHandler.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- LogHandler.java 2001/01/26 20:55:02 1.7
+++ LogHandler.java 2001/02/01 22:21:27 1.8
@@ -77,7 +77,7 @@
}
public void invoke(MessageContext msgContext) throws AxisFault {
- System.err.println( "In LogHandler" );
+ Debug.Print( 1, "Enter: LogHandler::invoke" );
try {
FileWriter fw = new FileWriter( "axis.log", true );
PrintWriter pw = new PrintWriter( fw );
@@ -96,14 +96,15 @@
pw.close();
}
catch( Exception e ) {
- e.printStackTrace( System.err );
+ Debug.Print( 1, e );
throw new AxisFault( e );
}
+ Debug.Print( 1, "Exit: LogHandler::invoke" );
}
public void undo(MessageContext msgContext) {
+ Debug.Print( 1, "Exit: LogHandler::undo" );
try {
- System.err.println( "In LogHandler:undo" );
FileWriter fw = new FileWriter( "axis.log", true );
PrintWriter pw = new PrintWriter( fw );
pw.println( "=====================" );
@@ -111,8 +112,9 @@
pw.println( "=====================" );
pw.close();
} catch( Exception e ) {
- e.printStackTrace( System.err );
+ Debug.Print( 1, e );
}
+ Debug.Print( 1, "Exit: LogHandler::undo" );
}
public boolean canHandleBlock(QName qname) {
1.8 +6 -4 xml-axis/java/src/org/apache/axis/handlers/RPCDispatchHandler.java
Index: RPCDispatchHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/RPCDispatchHandler.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- RPCDispatchHandler.java 2001/01/28 18:05:34 1.7
+++ RPCDispatchHandler.java 2001/02/01 22:21:27 1.8
@@ -78,7 +78,7 @@
}
public void invoke(MessageContext msgContext) throws AxisFault {
- System.err.println("In RPCDispatchHandler");
+ Debug.Print( 1, "Enter: RPCDispatchHandler::invoke" );
/* Find the service we're invoking so we can grab it's options */
/***************************************************************/
@@ -130,7 +130,7 @@
resEnv = new SOAPEnvelope();
RPCBody resBody = new RPCBody();
resBody.setMethodName( mName + "Response" );
- resBody.setNamespace( body.getNamespace() );
+ resBody.setPrefix( body.getPrefix() );
resBody.setNamespaceURI( body.getNamespaceURI() );
RPCArg arg = new RPCArg();
arg.setName( "return" );
@@ -143,14 +143,16 @@
msgContext.setOutgoingMessage( outMsg );
}
catch( Exception e ) {
- e.printStackTrace();
+ Debug.Print( 1, e );
if ( !(e instanceof AxisFault) ) e = new AxisFault(e);
throw (AxisFault) e ;
}
+ Debug.Print( 1, "Exit: RPCDispatchHandler::invoke" );
}
public void undo(MessageContext msgContext) {
- System.err.println( "In DispatchHandler:undo" );
+ Debug.Print( 1, "Enter: RPCDispatchHandler::undo" );
+ Debug.Print( 1, "Exit: RPCDispatchHandler::undo" );
}
public boolean canHandleBlock(QName qname) {
1.1 xml-axis/java/src/org/apache/axis/handlers/MsgDispatchHandler.java
Index: MsgDispatchHandler.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, International
* Business Machines, Inc., http://www.ibm.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.axis.handlers ;
import java.io.* ;
import java.util.* ;
import java.lang.reflect.* ;
import org.w3c.dom.* ;
import org.apache.xerces.dom.DocumentImpl ;
import org.apache.axis.* ;
import org.apache.axis.utils.* ;
import org.apache.axis.message.* ;
/**
*
* @author Doug Davis (dug@us.ibm.com)
*/
public class MsgDispatchHandler implements Handler {
public Hashtable options ;
public void init() {
}
public void cleanup() {
}
/**
* This is pretty much a pass-thru to the util.Admin tool. This will just
* take the incoming xml file and call the Admin processing.
*/
public void invoke(MessageContext msgContext) throws AxisFault {
Debug.Print( 1, "Enter: MsgDispatcherHandler::invoke" );
/* Find the service we're invoking so we can grab it's options */
/***************************************************************/
Handler service ;
service = (Handler) msgContext.getProperty( Constants.MC_SVC_HANDLER );
/* Now get the service (RPC) specific info */
/********************************************/
String clsName = (String) service.getOption( "className" );
String methodName = (String) service.getOption( "methodName" );
Debug.Print( 2, "ClassName: " + clsName );
Debug.Print( 2, "MethodName: " + methodName );
try {
Class cls = Class.forName(clsName);
Object obj = cls.newInstance();
Class[] argClasses = new Class[2];
Object[] argObjects = new Object[2];
Message reqMsg = msgContext.getIncomingMessage();
SOAPEnvelope reqEnv = (SOAPEnvelope) reqMsg.getAs("SOAPEnvelope");
SOAPBody reqBody = reqEnv.getFirstBody();
argClasses[0] = Class.forName("org.apache.axis.MessageContext");
argClasses[1] = Class.forName("org.w3c.dom.Document");
argObjects[0] = (Object) msgContext ;
argObjects[1] = (Object) reqBody.getAsDocument();
Method method = cls.getMethod( methodName, argClasses );
Document retDoc = (Document) method.invoke( obj, argObjects );
SOAPBody resBody = new SOAPBody( retDoc );
SOAPEnvelope resEnv = new SOAPEnvelope( resBody );
Message resMsg = new Message( resEnv, "SOAPEnvelope" );
msgContext.setOutgoingMessage( resMsg );
}
catch( Exception exp ) {
exp.printStackTrace();
}
Debug.Print( 1, "Exit: MsgDispatcherHandler::invoke" );
}
public void undo(MessageContext msgContext) { }
public boolean canHandleBlock(QName qname) {
return( false );
}
/**
* Add the given option (name/value) to this handler's bag of options
*/
public void addOption(String name, Object value) {
if ( options == null ) options = new Hashtable();
options.put( name, value );
}
/**
* Returns the option corresponding to the 'name' given
*/
public Object getOption(String name) {
if ( options == null ) return( null );
return( options.get(name) );
}
/**
* Return the entire list of options
*/
public Hashtable getOptions() {
return( options );
}
public void setOptions(Hashtable opts) {
this.options = opts ;
}
};
1.7 +20 -24 xml-axis/java/src/org/apache/axis/message/RPCBody.java
Index: RPCBody.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCBody.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- RPCBody.java 2001/01/31 19:49:54 1.6
+++ RPCBody.java 2001/02/01 22:21:31 1.7
@@ -69,29 +69,26 @@
* @author Doug Davis (dug@us.ibm.com)
*/
public class RPCBody extends SOAPBody {
- protected String namespace ;
+ protected String methodName ;
+ protected String prefix ;
protected String namespaceURI ;
protected ArrayList args ; // RPCArgs
public RPCBody() {}
public RPCBody(Element elem) {
- NodeList list ;
-
- namespace = elem.getPrefix();
- namespaceURI = elem.getNamespaceURI();
- name = elem.getLocalName();
- parseArgs( elem.getChildNodes() );
+ setBody( elem );
}
public RPCBody(SOAPBody b) {
- setMethodName( b.getName() );
- setNamespace( b.getNamespace() );
- setNamespaceURI( b.getNamespaceURI() );
- Vector list = b.getData();
- if ( list != null )
- for ( int i = 0 ; i < list.size() ; i++ )
- addArg( new RPCArg( (Element) list.get(i) ) );
+ setBody( b.getRoot() );
+ }
+
+ public void setBody( Element root ) {
+ setMethodName( root.getLocalName() );
+ setPrefix( root.getPrefix() );
+ setNamespaceURI( root.getNamespaceURI() );
+ parseArgs( root.getChildNodes() );
}
public RPCBody(String methodName, Object[] args) {
@@ -104,11 +101,11 @@
}
}
- public String getMethodName() { return( name ); }
- public void setMethodName(String name) { this.name = name ; }
+ public String getMethodName() { return( this.methodName ); }
+ public void setMethodName(String name) { this.methodName = name ; }
- 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 ; }
@@ -138,13 +135,12 @@
public Element getAsXML(Document doc) {
Element root ;
- if ( namespace != null ) {
- root = doc.createElementNS(namespace, namespace + ":" + name );
- root.setAttribute( "xmlns:" + namespace, namespaceURI );
- }
- else {
- root = doc.createElement( name );
+ if ( prefix != null ) {
+ root = doc.createElementNS(prefix, prefix + ":" + methodName );
+ root.setAttribute( "xmlns:" + prefix, namespaceURI );
}
+ else
+ root = doc.createElement( methodName );
for ( int i = 0 ; args != null && i < args.size() ; i++ ) {
RPCArg arg = (RPCArg) args.get(i) ;
root.appendChild( arg.getAsXML(doc) );
1.7 +23 -48 xml-axis/java/src/org/apache/axis/message/SOAPBody.java
Index: SOAPBody.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPBody.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SOAPBody.java 2001/01/27 19:55:05 1.6
+++ SOAPBody.java 2001/02/01 22:21:31 1.7
@@ -61,6 +61,7 @@
import java.util.* ;
import org.w3c.dom.* ;
+import org.apache.xerces.dom.DocumentImpl ;
import org.xml.sax.InputSource ;
import org.apache.axis.message.* ;
@@ -69,63 +70,37 @@
* @author Doug Davis (dug@us.ibm.com)
*/
public class SOAPBody {
- protected String name ;
- protected String namespace ;
- protected String namespaceURI ;
- protected ArrayList data ;
+ protected Element root ;
public SOAPBody() {
+ root = null ;
}
+ public SOAPBody(Document doc) {
+ root = doc.getDocumentElement() ;
+ }
+
public SOAPBody(Element elem) {
- String value ;
- NodeList list ;
- namespace = elem.getPrefix();
- namespaceURI = elem.getNamespaceURI();
- name = elem.getLocalName();
- // setData( elem.getChildNodes() );
- setData( elem.getElementsByTagName("*") );
- }
-
- public String getName() { return( name ); }
- public void setName(String name) { this.name = name ; }
-
- public String getNamespace() { return( namespace ); }
- public void setNamespace(String ns) { namespace = ns; }
-
- public String getNamespaceURI() { return( namespaceURI ); }
- public void setNamespaceURI(String nsuri) { namespaceURI = nsuri ; }
-
- public Vector getData() {
- if ( data == null || data.size() == 0 ) return( null );
- Vector v = new Vector();
-
- for ( int i = 0 ;i < data.size() ; i++ )
- v.add( data.get(i) );
- return( v );
- }
-
- public void addDataNode(Node n) { data.add(n); };
-
- public void setData(NodeList nl) {
- data = null ;
- if ( nl == null || nl.getLength() == 0 ) return ;
- for ( int i = 0 ; i < nl.getLength() ; i++ ) {
- Node n = nl.item(i);
- if ( n.getNodeType() != Node.ELEMENT_NODE ) continue ;
- if ( data == null ) data = new ArrayList();
- data.add( n );
- }
+ root = elem ;
+ }
+
+ public Element getRoot() {
+ return( root );
}
+ public void setRoot(Element r) {
+ this.root = r ;
+ }
+
public Element getAsXML(Document doc) {
- Element root = doc.createElementNS(namespace, namespace + ":" +
- name );
- root.setAttribute( "xmlns:" + namespace, namespaceURI );
+ if ( doc == null ) return( root );
+ return( (Element) doc.importNode( (Node) root, true ) );
+ }
- for ( int i = 0 ; data != null && i < data.size() ; i++ )
- root.appendChild(doc.importNode( (Node) data.get(i), true ));
- return( root );
+ public Document getAsDocument() {
+ Document doc = new DocumentImpl();
+ doc.appendChild( doc.importNode( (Node) root, true ) );
+ return( doc );
}
};
1.7 +5 -0 xml-axis/java/src/org/apache/axis/message/SOAPEnvelope.java
Index: SOAPEnvelope.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPEnvelope.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SOAPEnvelope.java 2001/01/27 20:52:42 1.6
+++ SOAPEnvelope.java 2001/02/01 22:21:31 1.7
@@ -83,6 +83,10 @@
setEnvelope( doc.getDocumentElement() );
}
+ public SOAPEnvelope(SOAPBody bod) {
+ addBody( bod );
+ }
+
public void setEnvelope(Element elem) {
NodeList list ;
int i ;
@@ -193,6 +197,7 @@
elem.appendChild( root );
for ( i = 0 ; i < body.size() ; i++ )
root.appendChild( ((SOAPBody)body.get(i)).getAsXML(doc) );
+ // root.appendChild(doc.importNode( (Node) body.get(i), true ));
}
return( doc );
}
1.10 +5 -0 xml-axis/java/src/org/apache/axis/server/SimpleAxisEngine.java
Index: SimpleAxisEngine.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/server/SimpleAxisEngine.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- SimpleAxisEngine.java 2001/01/28 18:05:35 1.9
+++ SimpleAxisEngine.java 2001/02/01 22:21:32 1.10
@@ -79,6 +79,7 @@
*/
public void init() {
// Load the simple handler registry and init it
+ Debug.Print( 1, "Enter: SimpleAxisEngine::init" );
HandlerRegistry hr = new SimpleHandlerRegistry();
hr.init();
addOption( Constants.HANDLER_REGISTRY, hr );
@@ -87,6 +88,7 @@
HandlerRegistry sr = new SimpleServiceRegistry();
sr.init();
addOption( Constants.SERVICE_REGISTRY, sr );
+ Debug.Print( 1, "Exit: SimpleAxisEngine::init" );
}
public void cleanup() {
@@ -97,6 +99,7 @@
* handler for the desired service and invoke() it.
*/
public void invoke(MessageContext msgContext) throws AxisFault {
+ Debug.Print( 1, "Enter: SimpleAxisEngine::invoke" );
HandlerRegistry hr = (HandlerRegistry)getOption(Constants.HANDLER_REGISTRY);
HandlerRegistry sr = (HandlerRegistry)getOption(Constants.SERVICE_REGISTRY);
@@ -110,6 +113,7 @@
Handler h = sr.find( action );
if ( h == null ) {
+ Debug.Print( 1, "No service found by name: " + action );
throw new AxisFault( "Server.NoSuchService",
"Service '" + action + "' was not found",
null, null );
@@ -130,6 +134,7 @@
throw (AxisFault) e ;
}
h.cleanup(); // ???
+ Debug.Print( 1, "Exit: SimpleAxisEngine::invoke" );
};
public void undo(MessageContext msgContext) {
1.10 +4 -0 xml-axis/java/src/org/apache/axis/server/transports/AxisServlet.java
Index: AxisServlet.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/server/transports/AxisServlet.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- AxisServlet.java 2001/01/28 18:05:35 1.9
+++ AxisServlet.java 2001/02/01 22:21:33 1.10
@@ -100,6 +100,10 @@
}
}
+ /* For debugging - set the debug level */
+ /***************************************/
+ Debug.setDebugLevel( 1 ); // 0 = off, higher # => more detail
+
/* Place the incoming message in the MessagContext object - notice */
/* that we just leave it as a 'ServletRequest' object and let the */
/* Message processing routine convert it - we don't do it since we */
1.8 +18 -2 xml-axis/java/src/org/apache/axis/utils/Admin.java
Index: Admin.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/Admin.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Admin.java 2001/01/28 05:09:50 1.7
+++ Admin.java 2001/02/01 22:21:34 1.8
@@ -60,10 +60,12 @@
import java.io.* ;
import java.util.* ;
import org.w3c.dom.* ;
+import org.apache.xerces.dom.DocumentImpl ;
import org.apache.xerces.parsers.DOMParser ;
import org.xml.sax.InputSource ;
import org.apache.axis.registries.* ;
import org.apache.axis.handlers.* ;
+import org.apache.axis.utils.* ;
import org.apache.axis.* ;
@@ -99,12 +101,26 @@
}
}
+ public Document AdminService(MessageContext msgContext, Document xml) {
+ Debug.Print( 1, "Enter: Admin:AdminService" );
+ process( xml );
+ Document doc = new DocumentImpl();
+ Element root = doc.createElement( "Admin" );
+ doc.appendChild( root );
+ root.appendChild( doc.createTextNode( "Done processing" ) );
+ Debug.Print( 1, "Exit: Admin:AdminService" );
+ return( doc );
+ }
+
public void process(Document doc) {
+ process( doc.getDocumentElement() );
+ }
+
+ public void process(Element root) {
try {
init();
- Element root = doc.getDocumentElement();
String action = root.getTagName();
-
+
if ( !action.equals("deploy") && !action.equals("undeploy") )
Error( "Root element must be 'deploy' or 'undeploy'" );
1.7 +4 -2 xml-axis/java/src/org/apache/axis/utils/Constants.java
Index: Constants.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/Constants.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Constants.java 2001/01/28 18:05:35 1.6
+++ Constants.java 2001/02/01 22:21:34 1.7
@@ -68,8 +68,10 @@
// MessageContext Property Names
//////////////////////////////////////////////////////////////////////////
- public static String MC_TARGET = "TargetAction" ;
- public static String MC_SVC_HANDLER = "ServiceHandler" ;
+ public static String MC_TARGET = "TargetAction" ; // String
+ public static String MC_SVC_HANDLER = "ServiceHandler" ; // Handler
+ public static String MC_HTTP_STATUS_CODE = "HTTP_Status_Code" ; // Integer
+ public static String MC_HTTP_STATUS_LINE = "HTTP_Status_Line" ; // String
// Envelope Stuff
//////////////////////////////////////////////////////////////////////////
1.1 xml-axis/java/src/org/apache/axis/utils/Debug.java
Index: Debug.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, International
* Business Machines, Inc., http://www.ibm.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.axis.utils ;
/**
*
* @author Doug Davis (dug@us.ibm.com)
*/
// We should replace this with Log4J if we really want this stuff. But
// for now I want something that's easy and doesn't require any other
// jar files
import java.io.* ;
public class Debug {
private static int debugLevel = 0 ;
private static boolean toScreen = true ;
private static boolean toFile = false ;
public static void setDebugLevel( int dl ) {
debugLevel = dl ;
}
public static int getDebugLevel() {
return( debugLevel );
}
public static int incDebugLevel() {
return( ++debugLevel );
}
public static int decDebugLevel() {
return( debugLevel = ( (debugLevel == 0) ? 0 : (debugLevel-1) ) );
}
public static void setToScreen(boolean b) {
toScreen = b ;
}
public static void setToFile(boolean b) {
toFile = b ;
}
public static boolean DebugOn(int level) {
return( debugLevel >= level );
}
public static void Print( int level, Exception exp ) {
if ( debugLevel < level ) return ;
try {
String msg = "Exception: " + exp.getMessage() ;
if ( toScreen )
System.err.println( msg );
if ( toFile ) {
FileWriter fw = new FileWriter( "AxisDebug.log", true );
fw.write( msg, 0, msg.length() );
PrintWriter pw = new PrintWriter( fw );
exp.printStackTrace( pw );
pw.close();
fw.close();
}
}
catch( Exception e ) {
System.err.println( "Can't log debug info: " + e );
e.printStackTrace();
}
}
public static void Print( int level, String msg ) {
if ( debugLevel >= level ) {
if ( toScreen ) System.err.println( msg );
if ( toFile ) {
try {
FileWriter fw = new FileWriter( "AxisDebug.log", true );
fw.write( msg, 0, msg.length() );
fw.close();
}
catch( Exception e ) {
System.err.println( "Can't log debug info: " + e );
e.printStackTrace();
}
}
}
}
}