[savara-commits] savara SVN: r388 - in trunk: validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Sep 3 10:58:24 EDT 2010


Author: objectiser
Date: 2010-09-03 10:58:23 -0400 (Fri, 03 Sep 2010)
New Revision: 388

Modified:
   trunk/distribution/src/main/release/install/build.xml
   trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
   trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
Log:
Fixed deploy issue with jbossws-native configuration, and updated the interceptors to extract the WSDL service name, which is consistent across inbound/outbound requests on both the client and server interceptors.

Modified: trunk/distribution/src/main/release/install/build.xml
===================================================================
--- trunk/distribution/src/main/release/install/build.xml	2010-09-02 16:46:14 UTC (rev 387)
+++ trunk/distribution/src/main/release/install/build.xml	2010-09-03 14:58:23 UTC (rev 388)
@@ -61,22 +61,22 @@
 
     <target name="register-jbossws-native-interceptor">
 		<echo message="register the jbossws-native interceptor" />
-        <delete file="${deployers.dir}/jbossws.deployer/standard-jaxws-client-config.xml" />
-        <delete file="${deployers.dir}/jbossws.deployer/standard-jaxws-endpoint-config.xml" />
+        <delete file="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-client-config.xml" />
+        <delete file="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-endpoint-config.xml" />
 		<copy file="${modules}/conf/jbossws-native/standard-jaxws-client-config-validator.xml"
-						tofile="${deployers.dir}/jbossws.deployer/standard-jaxws-client-config.xml" />
+						tofile="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-client-config.xml" />
 		<copy file="${modules}/conf/jbossws-native/standard-jaxws-endpoint-config-validator.xml"
-						tofile="${deployers.dir}/jbossws.deployer/standard-jaxws-endpoint-config.xml" />
+						tofile="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-endpoint-config.xml" />
     </target>
 
     <target name="unregister-jbossws-native-interceptor">
 		<echo message="unregister the jbossws-native interceptor" />
-        <delete file="${deployers.dir}/jbossws.deployer/standard-jaxws-client-config.xml" />
-        <delete file="${deployers.dir}/jbossws.deployer/standard-jaxws-endpoint-config.xml" />
+        <delete file="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-client-config.xml" />
+        <delete file="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-endpoint-config.xml" />
 		<copy file="${modules}/conf/jbossws-native/standard-jaxws-client-config-original.xml"
-						tofile="${deployers.dir}/jbossws.deployer/standard-jaxws-client-config.xml" />
+						tofile="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-client-config.xml" />
 		<copy file="${modules}/conf/jbossws-native/standard-jaxws-endpoint-config-original.xml"
-						tofile="${deployers.dir}/jbossws.deployer/standard-jaxws-endpoint-config.xml" />
+						tofile="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-endpoint-config.xml" />
     </target>
 	
 </project>

Modified: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java	2010-09-02 16:46:14 UTC (rev 387)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java	2010-09-03 14:58:23 UTC (rev 388)
@@ -17,118 +17,65 @@
  */
 package org.jboss.savara.validator.jbosswsnative;
 
-import java.net.URL;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.namespace.QName;
 import javax.xml.soap.SOAPEnvelope;
 import javax.xml.soap.SOAPException;
 import javax.xml.ws.handler.MessageContext;
 import javax.xml.ws.handler.soap.SOAPMessageContext;
 
-import org.jboss.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.EndpointAssociation;
 import org.jboss.wsf.common.handler.GenericSOAPHandler;
 
-public class JBossWSNativeClientInterceptor extends GenericSOAPHandler
-{
-   // provide logging
-   private static Logger log = Logger.getLogger(JBossWSNativeClientInterceptor.class);
+public class JBossWSNativeClientInterceptor extends GenericSOAPHandler {
+	
+	private static Log logger = LogFactory.getLog(JBossWSNativeClientInterceptor.class);
+
+	public JBossWSNativeClientInterceptor() {
+		if (logger.isDebugEnabled()) {
+			logger.debug("JBossWSClientListener created");
+		}
+	}
    
-   public JBossWSNativeClientInterceptor() {
-	   System.out.println(">> JBossWSClientListener CREATED");
-   }
-   
-   @SuppressWarnings("unchecked")
-   protected boolean handleInbound(MessageContext ctx)
-   {
-System.out.println(">> ====================================================");   
-System.out.println(">> JBossWSClientListener.handleInbound: ctx="+ctx);   
-System.out.println(">> JBossWSClientListener.handleInbound: op="+(QName)ctx.get(MessageContext.WSDL_OPERATION));
-         HttpServletResponse httpServletResponse = (HttpServletResponse)ctx.get(MessageContext.SERVLET_RESPONSE);
-         if (httpServletResponse != null)
-         {
-            try
-            {
-                System.out.println(">> JBossWSClientListener.handleInbound: response="+
-            		   	httpServletResponse);
-            }
-            catch (Exception e)
-            {
-               log.warn("Unable to read from the http servlet response! " + e.getMessage());
-            }
-         }
-         
-         	//skip message processing if not required since it's very time-consuming
-            SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
-            try
-            {
-               SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
-               if (soapEnv != null)
-               {
-                  System.out.println(DOMWriter.printNode(soapEnv, true));
-               }
-            }
-            catch (SOAPException ex)
-            {
-               log.error("Cannot trace SOAPMessage", ex);
-            }
+	protected boolean handleInbound(MessageContext ctx) {
+		SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
 
-      return true;
-   }
+		try {
+			Object service=ctx.get(MessageContext.WSDL_SERVICE);
+            
+			logger.info("Client: Inbound message for service="+service);
 
-   @SuppressWarnings("unchecked")
-   protected boolean handleOutbound(MessageContext ctx)
-   {
-System.out.println(">> ====================================================");   
-System.out.println(">> JBossWSClientListener.handleOutbound: ctx="+ctx);   
-System.out.println(">> JBossWSClientListener.handleOutbound: op="+(QName)ctx.get(MessageContext.WSDL_OPERATION));
-
-			HttpServletRequest httpServletRequest = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
-			if (httpServletRequest != null)
-			{
-			   try
-			   {
-			       System.out.println(">> JBossWSClientListener.handleOutbound: destination url="+
-			   		   	httpServletRequest.getRequestURL().toString());
-			       System.out.println(">> JBossWSClientListener.handleOutbound: destination host="+
-			   		   	new URL(httpServletRequest.getRequestURL().toString()).getHost());
-			       System.out.println(">> JBossWSClientListener.handleOutbound: source host="+
-			       			httpServletRequest.getRemoteHost());
-			   }
-			   catch (Exception e)
-			   {
-			      log.warn("Unable to read from the http servlet request! " + e.getMessage());
-			   }
+			SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+			if (soapEnv != null) {
+				System.out.println(DOMWriter.printNode(soapEnv, true));
 			}
+		} catch (SOAPException ex) {
+			logger.error("Cannot trace SOAPMessage", ex);
+		}
 
-			//skip message processing if not required since it's very time-consuming
-            SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
-            try
-            {
-               SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
-               if (soapEnv != null)
-               {
-            	   System.out.println(DOMWriter.printNode(soapEnv, true));
-               }
-            }
-            catch (SOAPException ex)
-            {
-               log.error("Cannot trace SOAPMessage", ex);
-            }
+		return true;
+	}
 
-      return true;
-   }
+	protected boolean handleOutbound(MessageContext ctx) {
+		SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
 
-   public boolean handleFault(MessageContext ctx)
-   {
-      return handleOutbound(ctx);
-   }
+		try {
+			Object service=ctx.get(MessageContext.WSDL_SERVICE);
+               
+			logger.info("Client: Outbound message for service="+service);
+
+			SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+			if (soapEnv != null) {
+				System.out.println(DOMWriter.printNode(soapEnv, true));
+			}
+		} catch (SOAPException ex) {
+			logger.error("Cannot trace SOAPMessage", ex);
+		}
+
+		return true;
+	}
+
+	public boolean handleFault(MessageContext ctx) {
+		return handleOutbound(ctx);
+	}
 }

Modified: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java	2010-09-02 16:46:14 UTC (rev 387)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java	2010-09-03 14:58:23 UTC (rev 388)
@@ -17,103 +17,66 @@
  */
 package org.jboss.savara.validator.jbosswsnative;
 
-import java.net.URL;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.xml.namespace.QName;
 import javax.xml.soap.SOAPEnvelope;
 import javax.xml.soap.SOAPException;
 import javax.xml.ws.handler.MessageContext;
 import javax.xml.ws.handler.soap.SOAPMessageContext;
 
-import org.jboss.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.EndpointAssociation;
 import org.jboss.wsf.common.handler.GenericSOAPHandler;
 
-public class JBossWSNativeServerInterceptor extends GenericSOAPHandler
-{
-   // provide logging
-   private static Logger log = Logger.getLogger(JBossWSNativeServerInterceptor.class);
+public class JBossWSNativeServerInterceptor extends GenericSOAPHandler {
+	
+	private static Log logger = LogFactory.getLog(JBossWSNativeServerInterceptor.class);
    
-   public JBossWSNativeServerInterceptor() {
-	   System.out.println(">> JBossWSListener CREATED");
-   }
+	public JBossWSNativeServerInterceptor() {
+		if (logger.isDebugEnabled()) {
+			logger.debug("JBossWSNativeServerInterceptor created");
+		}
+	}
    
-   @SuppressWarnings("unchecked")
-   protected boolean handleInbound(MessageContext ctx)
-   {
-System.out.println(">> ====================================================");   
-System.out.println(">> JBossWSListener.handleInbound: ctx="+ctx);   
-System.out.println(">> JBossWSListener.handleInbound: op="+(QName)ctx.get(MessageContext.WSDL_OPERATION));
-         HttpServletRequest httpServletRequest = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
-         if (httpServletRequest != null)
-         {
-            try
-            {
-                System.out.println(">> JBossWSListener.handleInbound: destination url="+
-            		   	httpServletRequest.getRequestURL().toString());
-                System.out.println(">> JBossWSListener.handleInbound: destination host="+
-            		   	new URL(httpServletRequest.getRequestURL().toString()).getHost());
-                System.out.println(">> JBossWSListener.handleInbound: source host="+
-                			httpServletRequest.getRemoteHost());
-            }
-            catch (Exception e)
-            {
-               log.warn("Unable to read from the http servlet request! " + e.getMessage());
-            }
-         }
-         
-         	//skip message processing if not required since it's very time-consuming
-            SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
-            try
-            {
-               SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
-               if (soapEnv != null)
-               {
-                  System.out.println(DOMWriter.printNode(soapEnv, true));
-               }
-            }
-            catch (SOAPException ex)
-            {
-               log.error("Cannot trace SOAPMessage", ex);
-            }
-            
-      return true;
-   }
+	protected boolean handleInbound(MessageContext ctx) {
+		SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+		
+		try {
+			Object service=ctx.get(MessageContext.WSDL_SERVICE);
+               
+			logger.info("Server: Inbound message for service="+service);
 
-   @SuppressWarnings("unchecked")
-   protected boolean handleOutbound(MessageContext ctx)
-   {
-System.out.println(">> ====================================================");   
-System.out.println(">> JBossWSListener.handleOutbound: ctx="+ctx);   
-System.out.println(">> JBossWSListener.handleOutbound: op="+(QName)ctx.get(MessageContext.WSDL_OPERATION));
+			SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+			if (soapEnv != null) {
+				System.out.println(DOMWriter.printNode(soapEnv, true));
+			}
+               
+		} catch (SOAPException ex) {
+			logger.error("Cannot trace SOAPMessage", ex);
+		}
 
-			//skip message processing if not required since it's very time-consuming
-            SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
-            try
-            {
-               SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
-               if (soapEnv != null)
-               {
-                  System.out.println(DOMWriter.printNode(soapEnv, true));
-               }
+		return true;
+	}
+
+	protected boolean handleOutbound(MessageContext ctx) {
+		SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+		
+		try {
+            Object service=ctx.get(MessageContext.WSDL_SERVICE);
+            
+            logger.info("Server: Outbound message for service="+service);
+            
+            SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+            if (soapEnv != null) {
+            	System.out.println(DOMWriter.printNode(soapEnv, true));
             }
-            catch (SOAPException ex)
-            {
-               log.error("Cannot trace SOAPMessage", ex);
-            }
+		} catch (SOAPException ex) {
+			logger.error("Cannot trace SOAPMessage", ex);
+		}
 
-      return true;
-   }
+		return true;
+	}
 
-   public boolean handleFault(MessageContext ctx)
-   {
-      return handleOutbound(ctx);
-   }
+	public boolean handleFault(MessageContext ctx) {
+		return handleOutbound(ctx);
+	}
 }



More information about the savara-commits mailing list