Author: thomas.diesler(a)jboss.com
Date: 2007-03-14 20:28:50 -0400 (Wed, 14 Mar 2007)
New Revision: 2617
Added:
trunk/jbossws-core/src/java/org/jboss/ws/core/DirectionHolder.java
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB21.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/HandlerDelegate.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/ConfigurationProvider.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.java
Log:
Fix jaxws handler issues and message context handling
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -76,9 +76,9 @@
/** Initialize the service endpoint */
@Override
- public void initServiceEndpoint(ServiceEndpointInfo seInfo)
+ public void init(ServiceEndpointInfo seInfo)
{
- super.initServiceEndpoint(seInfo);
+ super.init(seInfo);
ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
String ejbName = epMetaData.getLinkName();
@@ -139,7 +139,7 @@
/** Load the SEI implementation bean if necessary
*/
- public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
+ public Class loadServiceEndpoint()
{
if (server.isRegistered(objectName) == false)
throw new WSException("Cannot find service endpoint target: " +
objectName);
@@ -148,13 +148,13 @@
}
/** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpointInstance(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass)
+ public Object createServiceEndpointInstance(Object endpointContext, Class
seiImplClass)
{
return null;
}
/** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpointInstance(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws Exception
+ public void invokeServiceEndpointInstance(Object seiImpl, EndpointInvocation epInv)
throws Exception
{
log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
@@ -181,7 +181,8 @@
inv.setType(InvocationType.SERVICE_ENDPOINT);
// Set the handler callback and endpoint invocation
- inv.setValue(HandlerCallback.class.getName(), new HandlerCallback(seInfo),
PayloadKey.TRANSIENT);
+ ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
+ inv.setValue(HandlerCallback.class.getName(), new HandlerCallback(sepMetaData),
PayloadKey.TRANSIENT);
inv.setValue(EndpointInvocation.class.getName(), epInv, PayloadKey.TRANSIENT);
String[] sig = { Invocation.class.getName() };
@@ -195,40 +196,35 @@
}
/** Create an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpointInstance(ServiceEndpointInfo seInfo, Object
seiImpl)
+ public void destroyServiceEndpointInstance(Object seiImpl)
{
// do nothing
}
/** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ @Override
+ public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type)
{
if (type == HandlerType.PRE)
- return handlerDelegate.callRequestHandlerChain(seInfo, type);
+ return delegate.callRequestHandlerChain(sepMetaData, type);
else
return true;
}
/** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData,
HandlerType type)
{
if (type == HandlerType.PRE)
- return handlerDelegate.callResponseHandlerChain(seInfo, type);
+ return delegate.callResponseHandlerChain(sepMetaData, type);
else
return true;
}
/** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public void closeHandlerChain(ServiceEndpointInfo seInfo)
+ public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type, Exception ex)
{
- handlerDelegate.closeHandlerChain(seInfo);
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
- {
if (type == HandlerType.PRE)
- return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
+ return delegate.callFaultHandlerChain(sepMetaData, type, ex);
else
return true;
}
@@ -236,11 +232,11 @@
// The ServiceEndpointInterceptor calls the methods in this callback
public class HandlerCallback
{
- private ServiceEndpointInfo seInfo;
+ private ServerEndpointMetaData sepMetaData;
- public HandlerCallback(ServiceEndpointInfo seInfo)
+ public HandlerCallback(ServerEndpointMetaData sepMetaData)
{
- this.seInfo = seInfo;
+ this.sepMetaData = sepMetaData;
}
/** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
@@ -249,7 +245,7 @@
if (type == HandlerType.PRE)
return true;
else
- return handlerDelegate.callRequestHandlerChain(seInfo, type);
+ return delegate.callRequestHandlerChain(sepMetaData, type);
}
/** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
@@ -258,23 +254,16 @@
if (type == HandlerType.PRE)
return true;
else
- return handlerDelegate.callResponseHandlerChain(seInfo, type);
+ return delegate.callResponseHandlerChain(sepMetaData, type);
}
/** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public void closeHandlerChain(HandlerType type)
- {
- if (type != HandlerType.PRE)
- handlerDelegate.closeHandlerChain(seInfo);
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
public boolean callFaultHandlerChain(HandlerType type, Exception ex)
{
if (type == HandlerType.PRE)
return true;
else
- return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
+ return delegate.callFaultHandlerChain(sepMetaData, type, ex);
}
}
}
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -61,9 +61,9 @@
/** Initialize the service endpoint */
@Override
- public void initServiceEndpoint(ServiceEndpointInfo seInfo)
+ public void init(ServiceEndpointInfo seInfo)
{
- super.initServiceEndpoint(seInfo);
+ super.init(seInfo);
String ejbName = seInfo.getServerEndpointMetaData().getLinkName();
UnifiedDeploymentInfo udi = seInfo.getUnifiedDeploymentInfo();
@@ -78,7 +78,7 @@
/** Load the SEI implementation bean if necessary
*/
- public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
+ public Class loadServiceEndpoint()
{
if (server.isRegistered(objectName) == false)
throw new WSException("Cannot find service endpoint target: " +
objectName);
@@ -87,13 +87,13 @@
}
/** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpointInstance(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass)
+ public Object createServiceEndpointInstance(Object endpointContext, Class
seiImplClass)
{
return null;
}
/** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpointInstance(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws Exception
+ public void invokeServiceEndpointInstance(Object seiImpl, EndpointInvocation epInv)
throws Exception
{
log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
try
@@ -122,7 +122,7 @@
}
/** Create an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpointInstance(ServiceEndpointInfo seInfo, Object
seiImpl)
+ public void destroyServiceEndpointInstance(Object seiImpl)
{
// do nothing
}
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -28,7 +28,6 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
-import org.jboss.ws.core.server.ServiceEndpointInfo;
import org.jboss.ws.core.server.ServiceEndpointInvoker;
import org.jboss.ws.core.utils.ThreadLocalAssociation;
@@ -45,7 +44,7 @@
/** Load the SEI implementation bean if necessary
*/
- public Class loadServiceEndpoint(ServiceEndpointInfo seInfo) throws
ClassNotFoundException
+ public Class loadServiceEndpoint() throws ClassNotFoundException
{
return null;
}
@@ -58,13 +57,13 @@
/** Create an instance of the SEI implementation bean if necessary
*/
- public Object createServiceEndpointInstance(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass) throws InstantiationException,
IllegalAccessException
+ public Object createServiceEndpointInstance(Object endpointContext, Class
seiImplClass) throws InstantiationException, IllegalAccessException
{
return ThreadLocalAssociation.localInvokerMDBAssoc().get();
}
/** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpointInstance(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws Exception
+ public void invokeServiceEndpointInstance(Object seiImpl, EndpointInvocation epInv)
throws Exception
{
log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
try
@@ -89,7 +88,7 @@
}
/** Destroy an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpointInstance(ServiceEndpointInfo seInfo, Object
seiImpl)
+ public void destroyServiceEndpointInstance(Object seiImpl)
{
}
}
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB21.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB21.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB21.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -76,9 +76,9 @@
/** Initialize the service endpoint */
@Override
- public void initServiceEndpoint(ServiceEndpointInfo seInfo)
+ public void init(ServiceEndpointInfo seInfo)
{
- super.initServiceEndpoint(seInfo);
+ super.init(seInfo);
ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
String ejbName = epMetaData.getLinkName();
@@ -139,7 +139,7 @@
/** Load the SEI implementation bean if necessary
*/
- public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
+ public Class loadServiceEndpoint()
{
if (server.isRegistered(objectName) == false)
throw new WSException("Cannot find service endpoint target: " +
objectName);
@@ -148,13 +148,13 @@
}
/** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpointInstance(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass)
+ public Object createServiceEndpointInstance(Object endpointContext, Class
seiImplClass)
{
return null;
}
/** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpointInstance(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws Exception
+ public void invokeServiceEndpointInstance(Object seiImpl, EndpointInvocation epInv)
throws Exception
{
log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
@@ -181,7 +181,8 @@
inv.setType(InvocationType.SERVICE_ENDPOINT);
// Set the handler callback and endpoint invocation
- inv.setValue(HandlerCallback.class.getName(), new HandlerCallback(seInfo),
PayloadKey.TRANSIENT);
+ ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
+ inv.setValue(HandlerCallback.class.getName(), new HandlerCallback(sepMetaData),
PayloadKey.TRANSIENT);
inv.setValue(EndpointInvocation.class.getName(), epInv, PayloadKey.TRANSIENT);
String[] sig = { Invocation.class.getName() };
@@ -195,34 +196,35 @@
}
/** Create an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpointInstance(ServiceEndpointInfo seInfo, Object
seiImpl)
+ public void destroyServiceEndpointInstance(Object seiImpl)
{
// do nothing
}
/** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ @Override
+ public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type)
{
if (type == HandlerType.PRE)
- return handlerDelegate.callRequestHandlerChain(seInfo, type);
+ return delegate.callRequestHandlerChain(sepMetaData, type);
else
return true;
}
/** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData,
HandlerType type)
{
if (type == HandlerType.PRE)
- return handlerDelegate.callResponseHandlerChain(seInfo, type);
+ return delegate.callResponseHandlerChain(sepMetaData, type);
else
return true;
}
/** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
+ public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type, Exception ex)
{
if (type == HandlerType.PRE)
- return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
+ return delegate.callFaultHandlerChain(sepMetaData, type, ex);
else
return true;
}
@@ -230,11 +232,11 @@
// The ServiceEndpointInterceptor calls the methods in this callback
public class HandlerCallback
{
- private ServiceEndpointInfo seInfo;
+ private ServerEndpointMetaData sepMetaData;
- public HandlerCallback(ServiceEndpointInfo seInfo)
+ public HandlerCallback(ServerEndpointMetaData sepMetaData)
{
- this.seInfo = seInfo;
+ this.sepMetaData = sepMetaData;
}
/** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
@@ -243,7 +245,7 @@
if (type == HandlerType.PRE)
return true;
else
- return handlerDelegate.callRequestHandlerChain(seInfo, type);
+ return delegate.callRequestHandlerChain(sepMetaData, type);
}
/** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
@@ -252,7 +254,7 @@
if (type == HandlerType.PRE)
return true;
else
- return handlerDelegate.callResponseHandlerChain(seInfo, type);
+ return delegate.callResponseHandlerChain(sepMetaData, type);
}
/** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
@@ -261,8 +263,7 @@
if (type == HandlerType.PRE)
return true;
else
- return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
+ return delegate.callFaultHandlerChain(sepMetaData, type, ex);
}
-
}
}
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -70,9 +70,9 @@
/** Initialize the service endpoint */
@Override
- public void initServiceEndpoint(ServiceEndpointInfo seInfo)
+ public void init(ServiceEndpointInfo seInfo)
{
- super.initServiceEndpoint(seInfo);
+ super.init(seInfo);
String ejbName = seInfo.getServerEndpointMetaData().getLinkName();
UnifiedDeploymentInfo udi = seInfo.getUnifiedDeploymentInfo();
@@ -87,7 +87,7 @@
/** Load the SEI implementation bean if necessary
*/
- public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
+ public Class loadServiceEndpoint()
{
Dispatcher dispatcher = Dispatcher.singleton;
if (dispatcher.getRegistered(objectName.getCanonicalName()) == null)
@@ -97,13 +97,13 @@
}
/** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpointInstance(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass)
+ public Object createServiceEndpointInstance(Object endpointContext, Class
seiImplClass)
{
return null;
}
/** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpointInstance(ServiceEndpointInfo seInfo, Object
beanInstance, EndpointInvocation epInv) throws SOAPFaultException, Exception
+ public void invokeServiceEndpointInstance(Object beanInstance, EndpointInvocation
epInv) throws SOAPFaultException, Exception
{
log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
@@ -137,7 +137,7 @@
}
/** Create an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpointInstance(ServiceEndpointInfo seInfo, Object
seiImpl)
+ public void destroyServiceEndpointInstance(Object seiImpl)
{
// do nothing
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java 2007-03-14 10:35:45
UTC (rev 2616)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java 2007-03-15 00:28:50
UTC (rev 2617)
@@ -44,6 +44,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.DirectionHolder.Direction;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.jaxrpc.handler.HandlerChainBaseImpl;
@@ -212,6 +213,8 @@
protected abstract boolean callResponseHandlerChain(QName portName, HandlerType
type);
+ protected abstract boolean callFaultHandlerChain(QName portName, HandlerType type,
Exception ex);
+
protected abstract void closeHandlerChain(QName portName, HandlerType type);
protected abstract void setInboundContextProperties();
@@ -247,6 +250,10 @@
msgContext.setProperty(key, value);
}
+ // The direction of the message
+ DirectionHolder direction = new DirectionHolder(Direction.OutBound);
+
+ QName portName = epMetaData.getPortName();
try
{
// Get the binding from the provider
@@ -265,7 +272,6 @@
setOutboundContextProperties();
// Call the request handlers
- QName portName = epMetaData.getPortName();
boolean handlerPass = callRequestHandlerChain(portName, HandlerType.PRE);
handlerPass = handlerPass && callRequestHandlerChain(portName,
HandlerType.ENDPOINT);
handlerPass = handlerPass && callRequestHandlerChain(portName,
HandlerType.POST);
@@ -312,7 +318,7 @@
}
// at pivot the message context might be replaced
- msgContext = processPivot(msgContext);
+ msgContext = processPivotInternal(msgContext, direction);
// Associate response message with message context
msgContext.setSOAPMessage(resMessage);
@@ -337,7 +343,6 @@
handlerPass = handlerPass && callResponseHandlerChain(portName,
HandlerType.ENDPOINT);
handlerPass = handlerPass && callResponseHandlerChain(portName,
HandlerType.PRE);
- closeHandlerChain(portName, HandlerType.ALL);
// BP-1.0 R1027
if (handlerPass)
@@ -356,12 +361,36 @@
return retObj;
}
+ catch (Exception ex)
+ {
+ // Reverse the message direction
+ processPivotInternal(msgContext, direction);
+
+ callFaultHandlerChain(portName, HandlerType.POST, ex);
+ callFaultHandlerChain(portName, HandlerType.ENDPOINT, ex);
+ callFaultHandlerChain(portName, HandlerType.PRE, ex);
+ throw ex;
+ }
finally
{
resContext.putAll(msgContext.getProperties());
+
+ closeHandlerChain(portName, HandlerType.POST);
+ closeHandlerChain(portName, HandlerType.ENDPOINT);
+ closeHandlerChain(portName, HandlerType.PRE);
}
}
+ private CommonMessageContext processPivotInternal(CommonMessageContext msgContext,
DirectionHolder direction)
+ {
+ if (direction.getDirection() == Direction.OutBound)
+ {
+ msgContext = processPivot(msgContext);
+ direction.setDirection(Direction.InBound);
+ }
+ return msgContext;
+ }
+
protected void addAttachmentParts(SOAPMessage reqMessage)
{
for (AttachmentPart part : attachmentParts)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java 2007-03-14
10:35:45 UTC (rev 2616)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -47,6 +47,8 @@
// This property should be set the message context when it is ok to do so.
public static String ALLOW_EXPAND_TO_DOM = "org.jboss.ws.allow.expand.dom";
+ // The serialization context for this message ctx
+ private SerializationContext serContext;
// The operation for this message ctx
private EndpointMetaData epMetaData;
// The operation for this message ctx
@@ -66,6 +68,7 @@
this.epMetaData = msgContext.epMetaData;
this.opMetaData = msgContext.opMetaData;
this.soapMessage = msgContext.soapMessage;
+ this.serContext = msgContext.serContext;
this.props = msgContext.props;
}
@@ -102,8 +105,22 @@
this.soapMessage = soapMessage;
}
- public abstract SerializationContext getSerializationContext();
+ public SerializationContext getSerializationContext()
+ {
+ if (serContext == null)
+ {
+ serContext = createSerializationContext();
+ }
+ return serContext;
+ }
+ public abstract SerializationContext createSerializationContext();
+
+ public void setSerializationContext(SerializationContext serContext)
+ {
+ this.serContext = serContext;
+ }
+
/** Gets the namespace registry for this message context */
public NamespaceRegistry getNamespaceRegistry()
{
Added: trunk/jbossws-core/src/java/org/jboss/ws/core/DirectionHolder.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/DirectionHolder.java
(rev 0)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/DirectionHolder.java 2007-03-15 00:28:50
UTC (rev 2617)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core;
+
+// $Id:CommonClient.java 660 2006-08-01 16:29:43Z thomas.diesler(a)jboss.com $
+
+
+/**
+ * A holder for the message direction
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Mar-2007
+ */
+public class DirectionHolder
+{
+ public enum Direction
+ {
+ InBound, OutBound
+ }
+
+ private Direction direction;
+
+ public DirectionHolder(Direction direction)
+ {
+ this.direction = direction;
+ }
+
+ public Direction getDirection()
+ {
+ return direction;
+ }
+
+ public void setDirection(Direction direction)
+ {
+ this.direction = direction;
+ }
+}
Property changes on: trunk/jbossws-core/src/java/org/jboss/ws/core/DirectionHolder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java 2007-03-14
10:35:45 UTC (rev 2616)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -55,6 +55,7 @@
import org.jboss.ws.core.jaxrpc.binding.JBossXBDeserializerFactory;
import org.jboss.ws.core.jaxrpc.binding.JBossXBSerializerFactory;
import org.jboss.ws.core.jaxrpc.handler.HandlerChainBaseImpl;
+import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.utils.JavaUtils;
@@ -280,9 +281,9 @@
return invokeInternal(operationName, inputParams, false);
}
- protected CommonMessageContext processPivot(CommonMessageContext requestContext) {
- if(log.isDebugEnabled()) log.debug("Begin response processing");
- return requestContext;
+ protected CommonMessageContext processPivot(CommonMessageContext requestContext)
+ {
+ return MessageContextJAXRPC.processPivot(requestContext);
}
/** Returns a List values for the output parameters of the last invoked operation.
@@ -452,7 +453,8 @@
if (name.startsWith("javax.xml.rpc") &&
standardProperties.contains(name) == false)
throw new JAXRPCException("Unsupported property: " + name);
- if(log.isDebugEnabled()) log.debug("setProperty: [name=" + name +
",value=" + value + "]");
+ if (log.isDebugEnabled())
+ log.debug("setProperty: [name=" + name + ",value=" + value +
"]");
properties.put(name, value);
}
@@ -493,7 +495,7 @@
// Check or generate the the schema if this call is unconfigured
generateOrUpdateSchemas(opMetaData);
-
+
// Associate a message context with the current thread
SOAPMessageContextJAXRPC msgContext = new SOAPMessageContextJAXRPC();
MessageContextAssociation.pushMessageContext(msgContext);
@@ -537,7 +539,7 @@
if (type == HandlerType.ENDPOINT)
XOPContext.visitAndRestoreXOPData();
-
+
return status;
}
@@ -556,6 +558,20 @@
}
@Override
+ protected boolean callFaultHandlerChain(QName portName, HandlerType type, Exception
ex)
+ {
+ SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
+ HandlerChainBaseImpl handlerChain =
(HandlerChainBaseImpl)jaxrpcService.getHandlerChain(portName);
+
+ boolean status = true;
+ if (handlerChain != null)
+ {
+ status = handlerChain.handleFault(msgContext, type);
+ }
+ return status;
+ }
+
+ @Override
protected void closeHandlerChain(QName portName, HandlerType type)
{
// nothing to do for JAXRPC
@@ -630,7 +646,7 @@
{
EndpointMetaData epMetaData = getEndpointMetaData();
epMetaData.setConfigName(configName, configFile);
-
+
// Reinitialize the client handler chain
jaxrpcService.setupHandlerChain(epMetaData);
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -394,6 +394,16 @@
*/
public boolean handleFault(MessageContext msgContext)
{
+ return handleFaultInternal(msgContext, HandlerType.ALL);
+ }
+
+ public boolean handleFault(MessageContext msgContext, HandlerType type)
+ {
+ return handleFaultInternal(msgContext, type);
+ }
+
+ private boolean handleFaultInternal(MessageContext msgContext, HandlerType type)
+ {
boolean doNext = true;
if (handlers.size() > 0)
@@ -412,9 +422,14 @@
Handler currHandler = null;
for (; doNext && handlerIndex >= 0; handlerIndex--)
{
- currHandler = ((HandlerEntry)handlers.get(handlerIndex)).getHandler();
- log.debug("Handle fault: " + currHandler);
- doNext = currHandler.handleFault(msgContext);
+ HandlerEntry handlerEntry = (HandlerEntry)handlers.get(handlerIndex);
+ if (type == HandlerType.ALL || type == handlerEntry.getType())
+ {
+ currHandler = handlerEntry.getHandler();
+
+ log.debug("Handle fault: " + currHandler);
+ doNext = currHandler.handleFault(msgContext);
+ }
}
}
finally
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -27,6 +27,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Observable;
import java.util.Set;
import javax.xml.namespace.QName;
@@ -35,7 +36,6 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.server.HandlerDelegate;
-import org.jboss.ws.core.server.ServiceEndpointInfo;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
@@ -49,7 +49,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 19-Jan-2005
*/
-public class HandlerDelegateJAXRPC implements HandlerDelegate
+public class HandlerDelegateJAXRPC extends HandlerDelegate
{
// provide logging
private static Logger log = Logger.getLogger(HandlerDelegateJAXRPC.class);
@@ -61,27 +61,23 @@
// This endpoints handler chain
private ServerHandlerChain postHandlerChain;
- public HandlerDelegateJAXRPC()
+ public HandlerDelegateJAXRPC(ServerEndpointMetaData sepMetaData)
{
+ super(sepMetaData);
+ sepMetaData.registerConfigObserver(this);
}
- public void closeHandlerChain(ServiceEndpointInfo seInfo)
+ public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type)
{
- // nothing to do for JAXRPC
- }
-
- public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
- ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
// Initialize the handler chain
- if (sepMetaData.isHandlersInitialized() == false)
+ if (isInitialized() == false)
{
- initHandlerChain(seInfo, HandlerType.PRE);
- initHandlerChain(seInfo, HandlerType.ENDPOINT);
- initHandlerChain(seInfo, HandlerType.POST);
- sepMetaData.setHandlersInitialized(true);
+ initHandlerChain(sepMetaData, HandlerType.PRE);
+ initHandlerChain(sepMetaData, HandlerType.ENDPOINT);
+ initHandlerChain(sepMetaData, HandlerType.POST);
+ setInitialized(true);
}
boolean status = true;
@@ -108,7 +104,7 @@
return status;
}
- public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData,
HandlerType type)
{
SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
@@ -128,7 +124,7 @@
return status;
}
- public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
+ public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type, Exception ex)
{
SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
@@ -148,15 +144,19 @@
return status;
}
+ public void closeHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
+ {
+ // nothing to do for JAXRPC
+ }
+
/**
* Init the handler chain
*/
- private void initHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ private void initHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
{
Set<String> handlerRoles = new HashSet<String>();
List<HandlerInfo> hInfos = new ArrayList<HandlerInfo>();
- ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
for (HandlerMetaData handlerMetaData : sepMetaData.getHandlerMetaData(type))
{
HandlerMetaDataJAXRPC jaxrpcMetaData = (HandlerMetaDataJAXRPC)handlerMetaData;
@@ -180,10 +180,10 @@
hInfos.add(info);
}
- initHandlerChain(seInfo, hInfos, handlerRoles, type);
+ initHandlerChain(sepMetaData, hInfos, handlerRoles, type);
}
- private void initHandlerChain(ServiceEndpointInfo seInfo, List<HandlerInfo>
hInfos, Set<String> handlerRoles, HandlerType type)
+ private void initHandlerChain(ServerEndpointMetaData sepMetaData,
List<HandlerInfo> hInfos, Set<String> handlerRoles, HandlerType type)
{
if(log.isDebugEnabled()) log.debug("Init handler chain with [" +
hInfos.size() + "] handlers");
@@ -201,4 +201,8 @@
handlerChain.init(null);
}
}
+
+ public void update(Observable observable, Object object)
+ {
+ }
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -26,6 +26,7 @@
import javax.xml.rpc.handler.MessageContext;
import javax.xml.soap.SOAPMessage;
+import org.jboss.logging.Logger;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
@@ -46,14 +47,13 @@
*/
public class MessageContextJAXRPC extends CommonMessageContext implements MessageContext
{
+ private static Logger log = Logger.getLogger(MessageContextJAXRPC.class);
+
public static final String SERVLET_CONTEXT =
"javax.xml.ws.servlet.context";
public static final String SERVLET_REQUEST =
"javax.xml.ws.servlet.request";
public static final String SERVLET_RESPONSE =
"javax.xml.ws.servlet.response";
public static final String SERVLET_SESSION =
"javax.xml.ws.servlet.session";
- // The serialization context for this message ctx
- private SerializationContext serContext;
-
public MessageContextJAXRPC()
{
}
@@ -72,22 +72,18 @@
{
setSOAPMessage(message);
}
-
- /** Get or create the serialization context
+
+ /** Create the serialization context
*/
- public SerializationContext getSerializationContext()
+ public SerializationContext createSerializationContext()
{
- if (serContext == null)
- {
- EndpointMetaData epMetaData = getEndpointMetaData();
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
+ EndpointMetaData epMetaData = getEndpointMetaData();
+ ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
- SerializationContextJAXRPC jaxrpcContext = new SerializationContextJAXRPC();
- jaxrpcContext.setTypeMapping(serviceMetaData.getTypeMapping());
- jaxrpcContext.setJavaWsdlMapping(serviceMetaData.getJavaWsdlMapping());
- serContext = jaxrpcContext;
- }
- return serContext;
+ SerializationContextJAXRPC jaxrpcContext = new SerializationContextJAXRPC();
+ jaxrpcContext.setTypeMapping(serviceMetaData.getTypeMapping());
+ jaxrpcContext.setJavaWsdlMapping(serviceMetaData.getJavaWsdlMapping());
+ return jaxrpcContext;
}
/** Gets the namespace registry for this message context */
@@ -95,4 +91,11 @@
{
return getSerializationContext().getNamespaceRegistry();
}
+
+ public static CommonMessageContext processPivot(CommonMessageContext requestContext)
+ {
+ log.debug("Begin response processing");
+ return requestContext;
+ }
+
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -90,9 +90,9 @@
public List<Handler> getHandlerChain()
{
log.warn("[JBCTS-544] - Binding.getHandlerChain() expected to return a
modifyable list");
- // return Collections.unmodifiableList(handlerChain);
+ // return Collections.unmodifiableList(jaxwsHandlerChain);
- return jaxwsHandlerChain;
+ return new ArrayList<Handler>(jaxwsHandlerChain);
}
public void setHandlerChain(List<Handler> handlerChain)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-03-14
10:35:45 UTC (rev 2616)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -24,6 +24,7 @@
// $Id$
import java.rmi.RemoteException;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Observable;
@@ -75,6 +76,7 @@
private final EndpointMetaData epMetaData;
private final HandlerResolver handlerResolver;
+ private Map<HandlerType, HandlerChainExecutor> executorMap = new
HashMap<HandlerType, HandlerChainExecutor>();
public ClientImpl(EndpointMetaData epMetaData, HandlerResolver handlerResolver)
{
@@ -122,8 +124,6 @@
/**
* Callback when the config-name or config-file changes.
- * @param observable
- * @param object
*/
public void update(Observable observable, Object object)
{
@@ -137,7 +137,9 @@
protected boolean callRequestHandlerChain(QName portName, HandlerType type)
{
BindingExt binding = (BindingExt)getBindingProvider().getBinding();
- HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData,
binding.getHandlerChain(type));
+ HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData,
binding.getHandlerChain(type));
+ executorMap.put(type, executor);
+
MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
return executor.handleRequest(msgContext);
}
@@ -145,18 +147,25 @@
@Override
protected boolean callResponseHandlerChain(QName portName, HandlerType type)
{
- BindingExt binding = (BindingExt)getBindingProvider().getBinding();
- HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData,
binding.getHandlerChain(type));
MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
- return executor.handleResponse(msgContext);
+ HandlerChainExecutor executor = executorMap.get(type);
+ return (executor != null ? executor.handleResponse(msgContext) : true);
}
@Override
+ protected boolean callFaultHandlerChain(QName portName, HandlerType type, Exception
ex)
+ {
+ MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
+ HandlerChainExecutor executor = executorMap.get(type);
+ return (executor != null ? executor.handleFault(msgContext, ex) : true);
+ }
+
+ @Override
protected void closeHandlerChain(QName portName, HandlerType type)
{
- BindingExt binding = (BindingExt)getBindingProvider().getBinding();
- HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData,
binding.getHandlerChain(type));
- executor.close();
+ MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
+ HandlerChainExecutor executor = executorMap.get(type);
+ if (executor != null) executor.close(msgContext);
}
@Override
@@ -215,23 +224,7 @@
protected CommonMessageContext processPivot(CommonMessageContext requestContext)
{
- if(log.isDebugEnabled()) log.debug("Begin response processing");
-
- // MTOM setting need to pass past pivot
- boolean mtomEnabled = XOPContext.isMTOMEnabled();
-
- // remove existing context
- MessageContextAssociation.popMessageContext();
-
- SOAPMessageContextJAXWS responseContext = new
SOAPMessageContextJAXWS(requestContext);
- responseContext.setSOAPMessage(null);
- responseContext.clear(); // clear message context properties
- responseContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, mtomEnabled);
-
- // associate new context
- MessageContextAssociation.pushMessageContext(responseContext);
-
- return responseContext;
+ return MessageContextJAXWS.processPivot(requestContext);
}
/**
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -27,6 +27,7 @@
import java.util.List;
import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.Handler;
@@ -36,6 +37,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS;
import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -52,21 +54,33 @@
// The endpoint meta data
private EndpointMetaData epMetaData;
- // The List<Entry> objects
+ // The list of handlers
protected List<Handler> handlers = new ArrayList<Handler>();
+ // The list of handlers tp close
+ protected List<Handler> closeHandlers = new ArrayList<Handler>();
// The index of the first handler that returned false during processing
protected int falseIndex = -1;
- /**
- * Constructs a handler chain with the given handlers
- */
- public HandlerChainExecutor(EndpointMetaData epMetaData, List<Handler>
handlerList)
+ public HandlerChainExecutor(EndpointMetaData epMetaData, List<Handler>
unsortedChain)
{
this.epMetaData = epMetaData;
- log.debug("Create a handler executor: " + handlerList);
- for (Handler handler : handlerList)
+ // Sort handler logical handlers first
+ List<Handler> sortedChain = new ArrayList<Handler>();
+ for (Handler handler : unsortedChain)
{
+ if (handler instanceof LogicalHandler)
+ sortedChain.add(handler);
+ }
+ for (Handler handler : unsortedChain)
+ {
+ if ((handler instanceof LogicalHandler) == false)
+ sortedChain.add(handler);
+ }
+
+ log.debug("Create a handler executor: " + sortedChain);
+ for (Handler handler : sortedChain)
+ {
handlers.add(handler);
}
}
@@ -74,14 +88,14 @@
/**
* Indicates the end of lifecycle for a HandlerChain.
*/
- public void close()
+ public void close(MessageContext msgContext)
{
log.debug("close");
- int handlerIndex = handlers.size() - 1;
+ int handlerIndex = closeHandlers.size() - 1;
for (; handlerIndex >= 0; handlerIndex--)
{
- Handler currHandler = handlers.get(handlerIndex);
- currHandler.close(null);
+ Handler currHandler = closeHandlers.get(handlerIndex);
+ currHandler.close(msgContext);
}
}
@@ -120,7 +134,7 @@
}
}
}
- catch (Exception ex)
+ catch (RuntimeException ex)
{
doNext = false;
processHandlerFailure(ex);
@@ -129,7 +143,7 @@
{
// we start at this index in the response chain
if (doNext == false)
- falseIndex = (handlerIndex - 1);
+ falseIndex = handlerIndex;
soapContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
log.debug("Exit: handleRequest with status: " + doNext);
@@ -152,7 +166,7 @@
int handlerIndex = handlers.size() - 1;
if (falseIndex != -1)
- handlerIndex = falseIndex;
+ handlerIndex = falseIndex - 1;
Handler currHandler = null;
try
@@ -177,7 +191,7 @@
}
}
}
- catch (Exception ex)
+ catch (RuntimeException ex)
{
doNext = false;
processHandlerFailure(ex);
@@ -186,7 +200,7 @@
{
// we start at this index in the fault chain
if (doNext == false)
- falseIndex = (handlerIndex - 1);
+ falseIndex = handlerIndex;
soapContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
log.debug("Exit: handleResponse with status: " + doNext);
@@ -196,7 +210,7 @@
return doNext;
}
- public boolean handleFault(MessageContext msgContext)
+ public boolean handleFault(MessageContext msgContext, Exception ex)
{
boolean doNext = true;
@@ -206,19 +220,37 @@
SOAPMessageContextJAXWS soapContext = (SOAPMessageContextJAXWS)msgContext;
soapContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
+ SOAPMessage soapMessage = soapContext.getMessage();
- int handlerIndex = 0;
+ // If the message is not already a fault message then it is replaced with a
fault message
+ try
+ {
+ if (soapMessage == null || soapMessage.getSOAPBody().getFault() == null)
+ {
+ soapMessage = SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
+ soapContext.setMessage(soapMessage);
+ }
+ }
+ catch (SOAPException se)
+ {
+ throw new WebServiceException("Cannot convert exception to fault
message", ex);
+ }
+
+ int handlerIndex = handlers.size() - 1;
+ if (falseIndex != -1)
+ handlerIndex = falseIndex - 1;
+
Handler currHandler = null;
try
{
String lastMessageTrace = null;
- for (; doNext && handlerIndex < handlers.size(); handlerIndex++)
+ for (; doNext && handlerIndex >= 0; handlerIndex--)
{
currHandler = handlers.get(handlerIndex);
if (log.isTraceEnabled())
{
- SOAPPart soapPart = soapContext.getMessage().getSOAPPart();
+ SOAPPart soapPart = soapMessage.getSOAPPart();
lastMessageTrace = traceSOAPPart("BEFORE handleFault - " +
currHandler, soapPart, lastMessageTrace);
}
@@ -226,21 +258,21 @@
if (log.isTraceEnabled())
{
- SOAPPart soapPart = soapContext.getMessage().getSOAPPart();
+ SOAPPart soapPart = soapMessage.getSOAPPart();
lastMessageTrace = traceSOAPPart("AFTER handleFault - " +
currHandler, soapPart, lastMessageTrace);
}
}
}
- catch (Exception ex)
+ catch (RuntimeException rte)
{
doNext = false;
- processHandlerFailure(ex);
+ processHandlerFailure(rte);
}
finally
{
// we start at this index in the response chain
if (doNext == false)
- falseIndex = (handlerIndex - 1);
+ falseIndex = handlerIndex;
soapContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
log.debug("Exit: handleFault with status: " + doNext);
@@ -275,6 +307,9 @@
handlerContext = new LogicalMessageContextImpl(soapContext);
}
+ if (closeHandlers.contains(currHandler) == false)
+ closeHandlers.add(currHandler);
+
boolean doNext = currHandler.handleMessage(handlerContext);
return doNext;
@@ -285,9 +320,15 @@
MessageContext handlerContext = soapContext;
if (currHandler instanceof LogicalHandler)
{
+ if (epMetaData.getStyle() == Style.RPC)
+ throw new WebServiceException("Cannot use logical handler with
RPC");
+
handlerContext = new LogicalMessageContextImpl(soapContext);
}
+ if (closeHandlers.contains(currHandler) == false)
+ closeHandlers.add(currHandler);
+
boolean doNext = currHandler.handleFault(handlerContext);
return doNext;
@@ -295,7 +336,6 @@
/**
* Trace the SOAPPart, do nothing if the String representation is equal to the last
one.
- * @param logMsg TODO
*/
protected String traceSOAPPart(String logMsg, SOAPPart soapPart, String
lastMessageTrace)
{
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -24,14 +24,15 @@
// $Id:HandlerDelegateJAXWS.java 710 2006-08-08 20:19:52Z thomas.diesler(a)jboss.com $
import java.util.List;
+import java.util.Observable;
import javax.xml.namespace.QName;
import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.PortInfo;
import org.jboss.logging.Logger;
import org.jboss.ws.core.server.HandlerDelegate;
-import org.jboss.ws.core.server.ServiceEndpointInfo;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
@@ -43,61 +44,66 @@
* @author Thomas.Diesler(a)jboss.org
* @since 19-Jan-2005
*/
-public class HandlerDelegateJAXWS implements HandlerDelegate
+public class HandlerDelegateJAXWS extends HandlerDelegate
{
// provide logging
private static Logger log = Logger.getLogger(HandlerDelegateJAXWS.class);
private HandlerResolverImpl resolver = new HandlerResolverImpl();
+
+ private ThreadLocal<HandlerChainExecutor> preExecutor = new
ThreadLocal<HandlerChainExecutor>();
+ private ThreadLocal<HandlerChainExecutor> jaxwsExecutor = new
ThreadLocal<HandlerChainExecutor>();
+ private ThreadLocal<HandlerChainExecutor> postExecutor = new
ThreadLocal<HandlerChainExecutor>();
+
+ public HandlerDelegateJAXWS(ServerEndpointMetaData sepMetaData)
+ {
+ super(sepMetaData);
+ sepMetaData.registerConfigObserver(this);
+ }
- public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type)
{
log.debug("callRequestHandlerChain: " + type);
- SOAPMessageContextJAXWS msgContext =
(SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- EndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
// Initialize the handler chain
- if (epMetaData.isHandlersInitialized() == false)
+ if (isInitialized() == false)
{
- initResolverChain(epMetaData);
- epMetaData.setHandlersInitialized(true);
+ resolver.initHandlerChain(sepMetaData, HandlerType.PRE);
+ resolver.initHandlerChain(sepMetaData, HandlerType.ENDPOINT);
+ resolver.initHandlerChain(sepMetaData, HandlerType.POST);
+ setInitialized(true);
}
- List<Handler> handlerChain = getHandlerChain(epMetaData, type);
- boolean status = new HandlerChainExecutor(epMetaData,
handlerChain).handleRequest(msgContext);
- return status;
+ HandlerChainExecutor executor = createExecutor(sepMetaData, type);
+ MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
+ return executor.handleRequest(msgContext);
}
- public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData,
HandlerType type)
{
log.debug("callResponseHandlerChain: " + type);
- SOAPMessageContextJAXWS msgContext =
(SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- List<Handler> handlerChain = getHandlerChain(epMetaData, type);
- boolean status = new HandlerChainExecutor(epMetaData,
handlerChain).handleResponse(msgContext);
- return status;
+ HandlerChainExecutor executor = getExecutor(type);
+ MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
+ return (executor != null ? executor.handleResponse(msgContext) : true);
}
- public void closeHandlerChain(ServiceEndpointInfo seInfo)
+ public void closeHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
{
log.debug("closeHandlerChain");
- EndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
-
- List<Handler> handlerChain = getHandlerChain(epMetaData, HandlerType.POST);
- new HandlerChainExecutor(epMetaData, handlerChain).close();
- handlerChain = getHandlerChain(epMetaData, HandlerType.ENDPOINT);
- new HandlerChainExecutor(epMetaData, handlerChain).close();
- handlerChain = getHandlerChain(epMetaData, HandlerType.PRE);
- new HandlerChainExecutor(epMetaData, handlerChain).close();
+ HandlerChainExecutor executor = getExecutor(type);
+ MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
+ if (executor != null)
+ {
+ executor.close(msgContext);
+ removeExecutor(type);
+ }
}
- public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
+ public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type, Exception ex)
{
log.debug("callFaultHandlerChain: " + type);
- SOAPMessageContextJAXWS msgContext =
(SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- List<Handler> handlerChain = getHandlerChain(epMetaData, type);
- boolean status = new HandlerChainExecutor(epMetaData,
handlerChain).handleFault(msgContext);
- return status;
+ HandlerChainExecutor executor = getExecutor(type);
+ MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
+ return (executor != null ? executor.handleFault(msgContext, ex) : true);
}
private List<Handler> getHandlerChain(EndpointMetaData epMetaData, HandlerType
type)
@@ -106,13 +112,6 @@
return resolver.getHandlerChain(info, type);
}
- private void initResolverChain(EndpointMetaData epMetaData)
- {
- resolver.initHandlerChain(epMetaData, HandlerType.PRE);
- resolver.initHandlerChain(epMetaData, HandlerType.ENDPOINT);
- resolver.initHandlerChain(epMetaData, HandlerType.POST);
- }
-
private PortInfo getPortInfo(EndpointMetaData epMetaData)
{
QName serviceName = epMetaData.getServiceMetaData().getServiceName();
@@ -121,4 +120,53 @@
PortInfo info = new PortInfoImpl(serviceName, portName, bindingId);
return info;
}
+
+ private HandlerChainExecutor createExecutor(ServerEndpointMetaData sepMetaData,
HandlerType type)
+ {
+ if (type == HandlerType.ALL)
+ throw new IllegalArgumentException("Invalid handler type: " + type);
+
+ HandlerChainExecutor executor = new HandlerChainExecutor(sepMetaData,
getHandlerChain(sepMetaData, type));
+ if (type == HandlerType.PRE)
+ preExecutor.set(executor);
+ else if (type == HandlerType.ENDPOINT)
+ jaxwsExecutor.set(executor);
+ else if (type == HandlerType.POST)
+ postExecutor.set(executor);
+
+ return executor;
+ }
+
+ private HandlerChainExecutor getExecutor(HandlerType type)
+ {
+ if (type == HandlerType.ALL)
+ throw new IllegalArgumentException("Invalid handler type: " + type);
+
+ HandlerChainExecutor executor = null;
+ if (type == HandlerType.PRE)
+ executor = preExecutor.get();
+ else if (type == HandlerType.ENDPOINT)
+ executor = jaxwsExecutor.get();
+ else if (type == HandlerType.POST)
+ executor = postExecutor.get();
+
+ return executor;
+ }
+
+ private void removeExecutor(HandlerType type)
+ {
+ if (type == HandlerType.ALL)
+ throw new IllegalArgumentException("Invalid handler type: " + type);
+
+ if (type == HandlerType.PRE)
+ preExecutor.remove();
+ else if (type == HandlerType.ENDPOINT)
+ jaxwsExecutor.remove();
+ else if (type == HandlerType.POST)
+ postExecutor.remove();
+ }
+
+ public void update(Observable observable, Object object)
+ {
+ }
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -82,7 +82,7 @@
{
log.debug("getHandlerChain: [type=" + type + ",info=" + info +
"]");
- List<Handler> unsortedChain = new ArrayList<Handler>();
+ List<Handler> handlerChain = new ArrayList<Handler>();
String bindingID = info.getBindingID();
QName serviceName = info.getServiceName();
@@ -96,7 +96,7 @@
if (list != null)
{
log.debug("add protocol handlers: " + list);
- unsortedChain.addAll(list);
+ handlerChain.addAll(list);
}
}
@@ -106,7 +106,7 @@
if (list != null)
{
log.debug("add service handlers: " + list);
- unsortedChain.addAll(list);
+ handlerChain.addAll(list);
}
}
@@ -116,7 +116,7 @@
if (list != null)
{
log.debug("add port handlers: " + list);
- unsortedChain.addAll(list);
+ handlerChain.addAll(list);
}
}
@@ -124,23 +124,10 @@
if (list != null)
{
log.debug("add general handlers: " + list);
- unsortedChain.addAll(list);
+ handlerChain.addAll(list);
}
- // Sort handler logical handlers first
- List<Handler> sortedChain = new ArrayList<Handler>();
- for (Handler handler : unsortedChain)
- {
- if (handler instanceof LogicalHandler)
- sortedChain.add(handler);
- }
- for (Handler handler : unsortedChain)
- {
- if ((handler instanceof LogicalHandler) == false)
- sortedChain.add(handler);
- }
-
- return Collections.unmodifiableList(sortedChain);
+ return Collections.unmodifiableList(handlerChain);
}
public void initHandlerChain(EndpointMetaData epMetaData, HandlerType type)
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -28,16 +28,21 @@
import java.util.Map;
import java.util.Set;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import javax.xml.ws.handler.MessageContext;
+import org.jboss.logging.Logger;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.StubExt;
import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
import org.jboss.ws.core.jaxws.SerializationContextJAXWS;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.xb.binding.NamespaceRegistry;
-
/**
* The interface MessageContext abstracts the message context that is processed by a
handler in the handle method.
*
@@ -49,8 +54,8 @@
*/
public class MessageContextJAXWS extends CommonMessageContext implements MessageContext
{
- // The serialization context for this message ctx
- private SerializationContext serContext;
+ private static Logger log = Logger.getLogger(MessageContextJAXWS.class);
+
// The map of property scopes
private HashMap<String, Scope> scopes = new HashMap<String, Scope>();
@@ -63,20 +68,16 @@
super(msgContext);
}
- /** Get or create the serialization context
+ /** Create the serialization context
*/
- public SerializationContext getSerializationContext()
+ public SerializationContext createSerializationContext()
{
- if (serContext == null)
- {
- EndpointMetaData epMetaData = getEndpointMetaData();
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
+ EndpointMetaData epMetaData = getEndpointMetaData();
+ ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
- SerializationContextJAXWS jaxwsContext = new SerializationContextJAXWS();
- jaxwsContext.setTypeMapping(serviceMetaData.getTypeMapping());
- serContext = jaxwsContext;
- }
- return serContext;
+ SerializationContextJAXWS jaxwsContext = new SerializationContextJAXWS();
+ jaxwsContext.setTypeMapping(serviceMetaData.getTypeMapping());
+ return jaxwsContext;
}
/** Gets the namespace registry for this message context */
@@ -84,7 +85,7 @@
{
return getSerializationContext().getNamespaceRegistry();
}
-
+
/** Sets the scope of a property. */
public void setScope(String key, Scope scope)
{
@@ -97,6 +98,35 @@
return scopes.get(key);
}
+ public static CommonMessageContext processPivot(CommonMessageContext reqContext)
+ {
+ log.debug("Begin response processing");
+
+ // MTOM setting need to pass past pivot
+ boolean mtomEnabled = XOPContext.isMTOMEnabled();
+
+ // Reverse the direction
+ Boolean outbound =
(Boolean)reqContext.getProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+ outbound = new Boolean(!outbound.booleanValue());
+
+ // Preserve addressing properties
+ SOAPAddressingProperties addrProps =
(SOAPAddressingProperties)reqContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+
+ MessageContextAssociation.popMessageContext();
+ SOAPMessageContextJAXWS resContext = new SOAPMessageContextJAXWS(reqContext);
+ resContext.setSOAPMessage(null);
+ resContext.clear();
+
+ resContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, mtomEnabled);
+ resContext.setProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY, outbound);
+ resContext.setProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND,
addrProps);
+ MessageContextAssociation.pushMessageContext(resContext);
+
+ return resContext;
+ }
+
+ // Map interface
+
public int size()
{
return props.size();
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -36,7 +36,6 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.handler.MessageContext;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
@@ -44,10 +43,14 @@
import org.jboss.ws.core.CommonBindingProvider;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.CommonSOAPBinding;
+import org.jboss.ws.core.DirectionHolder;
import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.DirectionHolder.Direction;
import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
+import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
import org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS;
+import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.SOAPBodyImpl;
import org.jboss.ws.core.soap.SOAPMessageImpl;
@@ -63,76 +66,81 @@
* @author Thomas.Diesler(a)jboss.org
* @since 19-Jan-2005
*/
-public abstract class AbstractServiceEndpointInvoker implements ServiceEndpointInvoker,
HandlerDelegate
+public abstract class AbstractServiceEndpointInvoker implements ServiceEndpointInvoker
{
// provide logging
private static Logger log = Logger.getLogger(AbstractServiceEndpointInvoker.class);
+ protected ServiceEndpointInfo seInfo;
protected CommonBindingProvider bindingProvider;
- protected HandlerDelegate handlerDelegate;
+ protected HandlerDelegate delegate;
/** Initialize the service endpoint */
- public void initServiceEndpoint(ServiceEndpointInfo seInfo)
+ public void init(ServiceEndpointInfo seInfo)
{
+ this.seInfo = seInfo;
ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
if (sepMetaData.getType() == EndpointMetaData.Type.JAXRPC)
{
bindingProvider = new CommonBindingProvider(sepMetaData);
- handlerDelegate = new HandlerDelegateJAXRPC();
+ delegate = new HandlerDelegateJAXRPC(sepMetaData);
}
else
{
bindingProvider = new BindingProviderImpl(sepMetaData);
- handlerDelegate = new HandlerDelegateJAXWS();
+ delegate = new HandlerDelegateJAXWS(sepMetaData);
}
}
/** Load the SEI implementation bean if necessary */
- protected abstract Class loadServiceEndpoint(ServiceEndpointInfo seInfo) throws
ClassNotFoundException;
+ protected abstract Class loadServiceEndpoint() throws ClassNotFoundException;
/** Create the instance of the SEI implementation bean if necessary */
- protected abstract Object createServiceEndpointInstance(ServiceEndpointInfo seInfo,
Object context, Class seiImplClass) throws Exception;
+ protected abstract Object createServiceEndpointInstance(Object context, Class
seiImplClass) throws Exception;
/** Invoke the instance of the SEI implementation bean */
- protected abstract void invokeServiceEndpointInstance(ServiceEndpointInfo seInfo,
Object seiImpl, EndpointInvocation epInv) throws Exception;
+ protected abstract void invokeServiceEndpointInstance(Object seiImpl,
EndpointInvocation epInv) throws Exception;
/** Destroy the instance of the SEI implementation bean if necessary */
- protected abstract void destroyServiceEndpointInstance(ServiceEndpointInfo seInfo,
Object seiImpl);
+ protected abstract void destroyServiceEndpointInstance(Object seiImpl);
- public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type)
{
- return handlerDelegate.callRequestHandlerChain(seInfo, type);
+ return delegate.callRequestHandlerChain(sepMetaData, type);
}
- public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData,
HandlerType type)
{
- return handlerDelegate.callResponseHandlerChain(seInfo, type);
+ return delegate.callResponseHandlerChain(sepMetaData, type);
}
- public void closeHandlerChain(ServiceEndpointInfo seInfo)
+ public void closeHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
{
- handlerDelegate.closeHandlerChain(seInfo);
+ delegate.closeHandlerChain(sepMetaData, type);
}
- public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
+ public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type, Exception ex)
{
- return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
+ return delegate.callFaultHandlerChain(sepMetaData, type, ex);
}
/** Invoke the the service endpoint */
- public SOAPMessage invoke(ServiceEndpointInfo seInfo, Object context) throws
Exception
+ public SOAPMessage invoke(Object context) throws Exception
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
+ ServerEndpointMetaData sepMetaData =
(ServerEndpointMetaData)msgContext.getEndpointMetaData();
SOAPMessageImpl reqMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
// Load the endpoint implementation bean
- Class seImpl = loadServiceEndpoint(seInfo);
+ Class seImpl = loadServiceEndpoint();
// Create an instance of the endpoint implementation bean
- Object seInstance = createServiceEndpointInstance(seInfo, context, seImpl);
+ Object seInstance = createServiceEndpointInstance(context, seImpl);
+ // The direction of the message
+ DirectionHolder direction = new DirectionHolder(Direction.InBound);
+
try
{
boolean oneway = false;
@@ -141,7 +149,7 @@
OperationMetaData opMetaData = null;
// call the handler chain
- boolean handlersPass = callRequestHandlerChain(seInfo, HandlerType.PRE);
+ boolean handlersPass = callRequestHandlerChain(sepMetaData, HandlerType.PRE);
// Unbind the request message
if (handlersPass)
@@ -150,7 +158,7 @@
binding = bindingProvider.getCommonBinding();
// Get the operation meta data from the SOAP message
- opMetaData = getDispatchDestination(epMetaData, reqMessage);
+ opMetaData = getDispatchDestination(sepMetaData, reqMessage);
msgContext.setOperationMetaData(opMetaData);
oneway = opMetaData.isOneWay();
@@ -158,36 +166,32 @@
epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
}
- handlersPass = handlersPass && callRequestHandlerChain(seInfo,
HandlerType.ENDPOINT);
- handlersPass = handlersPass && callRequestHandlerChain(seInfo,
HandlerType.POST);
+ handlersPass = handlersPass && callRequestHandlerChain(sepMetaData,
HandlerType.ENDPOINT);
+ handlersPass = handlersPass && callRequestHandlerChain(sepMetaData,
HandlerType.POST);
- // Check if protocol handlers modified the payload
- if (((SOAPBodyImpl)reqMessage.getSOAPBody()).isModifiedFromSource())
+ if (handlersPass)
{
- if (log.isDebugEnabled())
+ // Check if protocol handlers modified the payload
+ if (((SOAPBodyImpl)reqMessage.getSOAPBody()).isModifiedFromSource())
+ {
log.debug("Handler modified body payload, unbind message
again");
- epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
- }
+ epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
+ }
- if (handlersPass)
- {
// Invoke the service endpoint
msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
try
{
- invokeServiceEndpointInstance(seInfo, seInstance, epInv);
+ invokeServiceEndpointInstance(seInstance, epInv);
}
finally
{
msgContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
}
- msgContext = processPivot(msgContext);
+ // Reverse the message direction
+ msgContext = processPivotInternal(msgContext, direction);
- // Set the outbound property
- if (epMetaData.getType() == EndpointMetaData.Type.JAXWS)
- msgContext.setProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY,
Boolean.TRUE);
-
if (binding instanceof CommonSOAPBinding)
XOPContext.setMTOMEnabled(((CommonSOAPBinding)binding).isMTOMEnabled());
@@ -195,50 +199,73 @@
SOAPMessage resMessage = (SOAPMessage)binding.bindResponseMessage(opMetaData,
epInv);
msgContext.setSOAPMessage(resMessage);
}
+ else
+ {
+ // Reverse the message direction without calling the endpoint
+ SOAPMessage resMessage = msgContext.getSOAPMessage();
+ msgContext = processPivotInternal(msgContext, direction);
+ msgContext.setSOAPMessage(resMessage);
+ }
// call the handler chain
if (oneway == false)
{
- handlersPass = callResponseHandlerChain(seInfo, HandlerType.POST);
- handlersPass = handlersPass && callResponseHandlerChain(seInfo,
HandlerType.ENDPOINT);
- handlersPass = handlersPass && callResponseHandlerChain(seInfo,
HandlerType.PRE);
- closeHandlerChain(seInfo);
+ handlersPass = callResponseHandlerChain(sepMetaData, HandlerType.POST);
+ handlersPass = handlersPass && callResponseHandlerChain(sepMetaData,
HandlerType.ENDPOINT);
+ handlersPass = handlersPass && callResponseHandlerChain(sepMetaData,
HandlerType.PRE);
}
SOAPMessage resMessage = msgContext.getSOAPMessage();
return resMessage;
}
- catch (Exception ex)
+ catch (RuntimeException ex)
{
+ // Reverse the message direction
+ processPivotInternal(msgContext, direction);
+
try
{
CommonBinding binding = bindingProvider.getCommonBinding();
binding.bindFaultMessage(ex);
// call the handler chain
- boolean handlersPass = callFaultHandlerChain(seInfo, HandlerType.POST, ex);
- handlersPass = handlersPass && callFaultHandlerChain(seInfo,
HandlerType.ENDPOINT, ex);
- handlersPass = handlersPass && callFaultHandlerChain(seInfo,
HandlerType.PRE, ex);
- closeHandlerChain(seInfo);
+ boolean handlersPass = callFaultHandlerChain(sepMetaData, HandlerType.POST,
ex);
+ handlersPass = handlersPass && callFaultHandlerChain(sepMetaData,
HandlerType.ENDPOINT, ex);
+ handlersPass = handlersPass && callFaultHandlerChain(sepMetaData,
HandlerType.PRE, ex);
}
- catch (Exception subEx)
+ catch (RuntimeException subEx)
{
- log.warn("Cannot process handlerChain.handleFault, ignoring: ",
subEx);
+ log.warn("Exception while processing handleFault: ", ex);
+ ex = subEx;
}
throw ex;
}
finally
{
- destroyServiceEndpointInstance(seInfo, seInstance);
+ closeHandlerChain(sepMetaData, HandlerType.POST);
+ closeHandlerChain(sepMetaData, HandlerType.ENDPOINT);
+ closeHandlerChain(sepMetaData, HandlerType.PRE);
+
+ destroyServiceEndpointInstance(seInstance);
}
}
- protected CommonMessageContext processPivot(CommonMessageContext requestContext)
+ private CommonMessageContext processPivotInternal(CommonMessageContext msgContext,
DirectionHolder direction)
{
- if (log.isDebugEnabled())
- log.debug("Begin response processing");
- // TODO: implement
- return requestContext;
+ if (direction.getDirection() == Direction.InBound)
+ {
+ EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
+ if (epMetaData.getType() == EndpointMetaData.Type.JAXRPC)
+ {
+ msgContext = MessageContextJAXRPC.processPivot(msgContext);
+ }
+ else
+ {
+ msgContext = MessageContextJAXWS.processPivot(msgContext);
+ }
+ direction.setDirection(Direction.OutBound);
+ }
+ return msgContext;
}
private OperationMetaData getDispatchDestination(EndpointMetaData epMetaData,
SOAPMessageImpl reqMessage) throws SOAPException
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/HandlerDelegate.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/HandlerDelegate.java 2007-03-14
10:35:45 UTC (rev 2616)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/HandlerDelegate.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -23,19 +23,38 @@
// $Id$
+import org.jboss.ws.metadata.config.Configurable;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* @author Thomas.Diesler(a)jboss.org
* @since 19-Jan-2005
*/
-public interface HandlerDelegate
+public abstract class HandlerDelegate implements Configurable
{
- public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type);
+ private ServerEndpointMetaData sepMetaData;
+
+ public HandlerDelegate(ServerEndpointMetaData sepMetaData)
+ {
+ this.sepMetaData = sepMetaData;
+ }
- public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType
type);
+ public abstract boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData,
HandlerType type);
+
+ public abstract boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData,
HandlerType type);
- public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex);
+ public abstract boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData,
HandlerType type, Exception ex);
- public void closeHandlerChain(ServiceEndpointInfo seInfo);
+ public abstract void closeHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType
type);
+
+ protected boolean isInitialized()
+ {
+ return sepMetaData.isHandlersInitialized();
+ }
+
+ protected void setInitialized(boolean flag)
+ {
+ sepMetaData.setHandlersInitialized(flag);
+ }
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java 2007-03-14
10:35:45 UTC (rev 2616)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -201,7 +201,7 @@
// Invoke the service endpoint
ServiceEndpointInvoker seInvoker = seInfo.getInvoker();
- SOAPMessage resMessage = seInvoker.invoke(seInfo, context);
+ SOAPMessage resMessage = seInvoker.invoke(context);
if (resMessage != null)
postProcessResponse(headerSource, resMessage);
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -32,9 +32,9 @@
*/
public interface ServiceEndpointInvoker
{
- /** Initialize the service endpoint */
- void initServiceEndpoint(ServiceEndpointInfo seInfo);
+ /** Initialize the invoker */
+ void init(ServiceEndpointInfo seInfo);
/** Invoke the the service endpoint */
- SOAPMessage invoke(ServiceEndpointInfo seInfo, Object endpointContext) throws
Exception;
+ SOAPMessage invoke(Object endpointContext) throws Exception;
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -54,7 +54,7 @@
private Logger log = Logger.getLogger(ServiceEndpointInvokerJSE.class);
/** Load the SEI implementation bean if necessary */
- public Class loadServiceEndpoint(ServiceEndpointInfo seInfo) throws
ClassNotFoundException
+ public Class loadServiceEndpoint() throws ClassNotFoundException
{
ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
ClassLoader cl = epMetaData.getClassLoader();
@@ -64,7 +64,7 @@
}
/** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpointInstance(ServiceEndpointInfo seInfo, Object
context, Class seiImplClass) throws IllegalAccessException, InstantiationException
+ public Object createServiceEndpointInstance(Object context, Class seiImplClass) throws
IllegalAccessException, InstantiationException
{
Object seiImpl = seiImplClass.newInstance();
if (seiImpl instanceof ServiceLifecycle && context != null)
@@ -84,7 +84,7 @@
}
/** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpointInstance(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException, Exception
+ public void invokeServiceEndpointInstance(Object seiImpl, EndpointInvocation epInv)
throws SOAPFaultException, Exception
{
if(log.isDebugEnabled()) log.debug("invokeServiceEndpoint: " +
epInv.getJavaMethod().getName());
try
@@ -111,7 +111,7 @@
}
/** Destroy an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpointInstance(ServiceEndpointInfo seInfo, Object
seiImpl)
+ public void destroyServiceEndpointInstance(Object seiImpl)
{
if (seiImpl instanceof ServiceLifecycle)
{
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -438,6 +438,9 @@
try
{
SOAPMessage resMessage = wsEndpoint.handleRequest(headerSource, context,
inStream);
+
+ // REplace the message context with the response context
+ msgContext = MessageContextAssociation.peekMessageContext();
Map<String, List<String>> headers = (Map<String,
List<String>>)msgContext.getProperty(MessageContextJAXWS.HTTP_RESPONSE_HEADERS);
if (headers != null)
@@ -480,7 +483,7 @@
private void sendResponse(OutputStream outputStream, CommonMessageContext msgContext,
boolean isFault) throws SOAPException, IOException
{
- SOAPMessage soapMessage = msgContext.getSOAPMessage();
+ SOAPMessage resMessage = msgContext.getSOAPMessage();
String wsaTo = null;
// Get the destination from the AddressingProperties
@@ -495,11 +498,11 @@
if (wsaTo != null)
{
if(log.isDebugEnabled()) log.debug("Sending response to addressing
destination: " + wsaTo);
- new SOAPConnectionImpl().callOneWay(soapMessage, wsaTo);
+ new SOAPConnectionImpl().callOneWay(resMessage, wsaTo);
}
else
{
- soapMessage.writeTo(outputStream);
+ resMessage.writeTo(outputStream);
}
}
@@ -602,7 +605,7 @@
throw new WSException("Service already registerd: " + sepID);
ServiceEndpointInvoker seInvoker = getServiceEndpointInvoker(seInfo);
- seInvoker.initServiceEndpoint(seInfo);
+ seInvoker.init(seInfo);
seInfo.setInvoker(seInvoker);
// Load/Create the service endpoint impl
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/ConfigurationProvider.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/ConfigurationProvider.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/ConfigurationProvider.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -43,9 +43,7 @@
static final String DEFAULT_CLIENT_CONFIG_NAME = "Standard Client";
/**
- * Callback for components that require configuration through jbossws-dd
- *
- * @param configurable
+ * Callback for components that require configuration
*/
void configure(Configurable configurable);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -240,8 +240,7 @@
if (use == null)
{
use = Use.getDefaultUse();
- if (log.isDebugEnabled())
- log.debug("Using default encoding style: " + use);
+ log.debug("Using default encoding style: " + use);
}
return use;
}
@@ -260,8 +259,7 @@
if (style == null)
{
style = Style.getDefaultStyle();
- if (log.isDebugEnabled())
- log.debug("Using default style: " + style);
+ log.debug("Using default style: " + style);
}
return style;
}
@@ -280,8 +278,7 @@
if (parameterStyle == null)
{
parameterStyle = ParameterStyle.WRAPPED;
- if (log.isDebugEnabled())
- log.debug("Using default parameter style: " + parameterStyle);
+ log.debug("Using default parameter style: " + parameterStyle);
}
return parameterStyle;
}
@@ -291,8 +288,7 @@
if (value != null && parameterStyle != null &&
!parameterStyle.equals(value))
throw new WSException("Mixed SOAP parameter styles not supported");
- if (log.isDebugEnabled())
- log.debug("setParameterStyle: " + value);
+ log.debug("setParameterStyle: " + value);
this.parameterStyle = value;
}
@@ -607,15 +603,13 @@
// SOAPBinding configuration
if (configurable instanceof CommonBindingProvider)
{
- if (log.isDebugEnabled())
- log.debug("Configure SOAPBinding");
+ log.debug("Configure SOAPBinding");
if (config.hasFeature(EndpointFeature.MTOM))
{
CommonBindingProvider provider = (CommonBindingProvider)configurable;
((CommonSOAPBinding)provider.getCommonBinding()).setMTOMEnabled(true);
- if (log.isDebugEnabled())
- log.debug("Enable MTOM on endpoint " + this.getPortName());
+ log.debug("Enable MTOM on endpoint " + getPortName());
}
}
}
@@ -627,7 +621,7 @@
public void registerConfigObserver(Configurable observer)
{
- this.configObservable.addObserver(observer);
+ configObservable.addObserver(observer);
}
public String getConfigFile()
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.java 2007-03-14
10:35:45 UTC (rev 2616)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.java 2007-03-15
00:28:50 UTC (rev 2617)
@@ -26,16 +26,12 @@
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceRef;
import org.jboss.logging.Logger;
@@ -43,36 +39,12 @@
{
private static Logger log = Logger.getLogger(ServletClient.class);
- private SOAPEndpoint port;
+ @WebServiceRef(wsdlLocation =
"http://localhost:8080/jaxws-handlerlifecycle/soap?wsdl")
+ public static SOAPEndpoint port;
+
+ @WebServiceRef(wsdlLocation =
"http://localhost:8080/jaxws-handlerlifecycle/tracker?wsdl")
private TrackerEndpoint trackerPort;
- public void init(ServletConfig config) throws ServletException
- {
- super.init(config);
-
- try
- {
- if (port == null)
- {
- URL wsdlURL = new
URL("http://localhost:8080/jaxws-handlerlifecycle/soap?wsdl");
- QName serviceName = new
QName("http://org.jboss.ws/jaxws/handlerlifecycle",
"SOAPEndpointService");
- Service service = Service.create(wsdlURL, serviceName);
- port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
- }
- if (trackerPort == null)
- {
- URL wsdlURL = new
URL("http://localhost:8080/jaxws-handlerlifecycle/tracker?wsdl");
- QName serviceName = new
QName("http://org.jboss.ws/jaxws/handlerlifecycle",
"TrackerEndpointService");
- Service service = Service.create(wsdlURL, serviceName);
- trackerPort = (TrackerEndpoint)service.getPort(TrackerEndpoint.class);
- }
- }
- catch (MalformedURLException ex)
- {
- throw new ServletException(ex);
- }
- }
-
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
{
String message;
@@ -83,6 +55,11 @@
method.invoke(this, new Object[]{});
message = "pass";
}
+ catch (InvocationTargetException ex)
+ {
+ log.error(ex.getTargetException());
+ message = ex.getTargetException().toString();
+ }
catch (Exception ex)
{
log.error(ex);