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/05/31 18:30:19 UTC
cvs commit: xml-axis/java/test/functional TestHTTPEcho.java
dug 01/05/31 09:30:18
Modified: java/src/org/apache/axis/client/http HTTPClient.java
java/src/org/apache/axis/handlers DebugHandler.java
SimpleAuthenticationHandler.java
SimpleAuthorizationHandler.java
java/src/org/apache/axis/handlers/http HTTPAuthHandler.java
java/src/org/apache/axis/server AxisServer.java
java/test/functional TestHTTPEcho.java
Log:
Misc fixes
Revision Changes Path
1.2 +1 -1 xml-axis/java/src/org/apache/axis/client/http/HTTPClient.java
Index: HTTPClient.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/http/HTTPClient.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HTTPClient.java 2001/05/31 09:39:34 1.1
+++ HTTPClient.java 2001/05/31 16:29:26 1.2
@@ -121,7 +121,7 @@
String userID, passwd;
if ( (userID = serviceClient.get(AxisClient.USER)) != null ) {
mc.setProperty( MessageContext.USERID, userID );
- if ( (passwd = serviceClient.get(AxisClient.USER))!= null )
+ if ( (passwd = serviceClient.get(AxisClient.PASSWORD))!= null )
mc.setProperty( MessageContext.PASSWORD, passwd );
}
1.13 +2 -1 xml-axis/java/src/org/apache/axis/handlers/DebugHandler.java
Index: DebugHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/DebugHandler.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DebugHandler.java 2001/05/22 05:25:34 1.12
+++ DebugHandler.java 2001/05/31 16:29:36 1.13
@@ -77,7 +77,8 @@
Message msg = msgContext.getRequestMessage();
SOAPEnvelope message = (SOAPEnvelope)msg.getAs("SOAPEnvelope");
- SOAPHeader header = message.getHeaderByName(Constants.URI_DEBUG, "Debug");
+ SOAPHeader header = message.getHeaderByName(Constants.URI_DEBUG,
+ "Debug");
if ((header != null) && (header instanceof DebugHeader)) {
int debugVal = ((DebugHeader)header).getDebugLevel();
Debug.Print( 1, "Setting debug level to: " + debugVal );
1.12 +4 -4 xml-axis/java/src/org/apache/axis/handlers/SimpleAuthenticationHandler.java
Index: SimpleAuthenticationHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/SimpleAuthenticationHandler.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- SimpleAuthenticationHandler.java 2001/05/02 23:43:40 1.11
+++ SimpleAuthenticationHandler.java 2001/05/31 16:29:39 1.12
@@ -123,8 +123,8 @@
// in order to authenticate, the user must exist
if ( userID == null || userID.equals("") || !entries.containsKey(userID) )
- throw new AxisFault( "Server.Unauthorized",
- "User not authorized",
+ throw new AxisFault( "Server.Unauthenticated",
+ "User '" + userID + "' not authenticated (unknown user)",
null, null );
String passwd = (String) msgContext.getProperty( MessageContext.PASSWORD );
@@ -133,8 +133,8 @@
// if a password is defined, then it must match
if ( valid.length()>0 && !valid.equals(passwd) )
- throw new AxisFault( "Server.Unauthorized",
- "User not authenticated",
+ throw new AxisFault( "Server.Unauthenticated",
+ "User '" + userID + "' not authenticated (bad password)",
null, null );
Debug.Print( 1, "User '", userID, "' authenticated to server" );
1.13 +4 -4 xml-axis/java/src/org/apache/axis/handlers/SimpleAuthorizationHandler.java
Index: SimpleAuthorizationHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/SimpleAuthorizationHandler.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- SimpleAuthorizationHandler.java 2001/05/02 23:43:41 1.12
+++ SimpleAuthorizationHandler.java 2001/05/31 16:29:42 1.13
@@ -125,7 +125,7 @@
* Authorize the user and targetService from the msgContext
*/
public void invoke(MessageContext msgContext) throws AxisFault {
- Debug.Print( 1, "Enter: SimpleAuthenticationHandler::invoke" );
+ Debug.Print( 1, "Enter: SimpleAuthorizationHandler::invoke" );
String userID = (String) msgContext.getProperty( MessageContext.USERID );
String action = msgContext.getTargetService();
@@ -138,7 +138,7 @@
Hashtable authlist = (Hashtable) entries.get(userID);
if ( authlist == null || !authlist.containsKey(action) ) {
throw new AxisFault( "Server.Unauthorized",
- "User not authorized",
+ "User '" + userID + "' not authorized to '" + action + "'",
null, null );
}
}
@@ -152,7 +152,7 @@
* Nothing to undo
*/
public void undo(MessageContext msgContext) {
- Debug.Print( 1, "Enter: SimpleAuthenticationHandler::undo" );
- Debug.Print( 1, "Exit: SimpleAuthenticationHandler::undo" );
+ Debug.Print( 1, "Enter: SimpleAuthorizationHandler::undo" );
+ Debug.Print( 1, "Exit: SimpleAuthorizationHandler::undo" );
}
};
1.2 +4 -1 xml-axis/java/src/org/apache/axis/handlers/http/HTTPAuthHandler.java
Index: HTTPAuthHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/http/HTTPAuthHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HTTPAuthHandler.java 2001/04/29 00:38:25 1.1
+++ HTTPAuthHandler.java 2001/05/31 16:29:54 1.2
@@ -91,11 +91,14 @@
if ( i == -1 ) user = tmp ;
else user = tmp.substring( 0, i);
msgContext.setProperty( MessageContext.USERID, user );
+ Debug.Print(3, "HTTP userid: " + user );
if ( i != -1 ) {
String pwd = tmp.substring(i+1);
if ( pwd != null && pwd.equals("") ) pwd = null ;
- if ( pwd != null )
+ if ( pwd != null ) {
msgContext.setProperty( MessageContext.PASSWORD, pwd );
+ Debug.Print(3, "HTTP passwd: " + pwd );
+ }
}
}
1.12 +3 -1 xml-axis/java/src/org/apache/axis/server/AxisServer.java
Index: AxisServer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/server/AxisServer.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- AxisServer.java 2001/05/31 05:14:48 1.11
+++ AxisServer.java 2001/05/31 16:30:04 1.12
@@ -70,7 +70,9 @@
*/
public class AxisServer extends BasicHandler
{
- public AxisServer() {}
+ public AxisServer() {
+ // Debug.setDebugLevel(3);
+ }
/**
* Allows the Listener to specify which handler/service registry
1.2 +1 -1 xml-axis/java/test/functional/TestHTTPEcho.java
Index: TestHTTPEcho.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/functional/TestHTTPEcho.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestHTTPEcho.java 2001/05/31 09:25:21 1.1
+++ TestHTTPEcho.java 2001/05/31 16:30:13 1.2
@@ -94,7 +94,7 @@
public void doTestStock () throws Exception {
try {
- String[] args = { "-d3", "-uuser1", "-wpass1", "XXX" };
+ String[] args = { "-d", "-uuser1", "-wpass1", "XXX" };
float val = new GetQuote().getQuote(args);
assertEquals("TestHTTPEcho: stock price is 55.25", val, 55.25, 0.01);
}