Author: thomas.diesler(a)jboss.com
Date: 2007-03-30 13:33:56 -0400 (Fri, 30 Mar 2007)
New Revision: 2732
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.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/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/spi/ProviderImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxws/CommonConfigJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClient.java
Log:
Add support for handlers defined on the Service
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java 2007-03-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -109,7 +109,8 @@
epMetaData.clearHandlers();
for (HandlerInfo info : infos)
{
- HandlerMetaDataJAXRPC handler = new HandlerMetaDataJAXRPC(epMetaData,
HandlerType.ENDPOINT);
+ HandlerMetaDataJAXRPC handler = new
HandlerMetaDataJAXRPC(HandlerType.ENDPOINT);
+ handler.setEndpointMetaData(epMetaData);
handler.setHandlerClassName(info.getHandlerClass().getName());
handler.setSoapRoles(roles);
if(log.isDebugEnabled()) log.debug("Add handler to: " + portName +
handler);
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-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -89,7 +89,7 @@
public List<Handler> getHandlerChain()
{
- log.warn("[JBCTS-544] - Binding.getHandlerChain() expected to return a
modifyable list");
+ log.warn("[JBCTS-544] - Binding.getHandlerChain() expected to return a
modifiable list");
// return Collections.unmodifiableList(jaxwsHandlerChain);
return new ArrayList<Handler>(jaxwsHandlerChain);
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-30
16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -76,7 +76,7 @@
{
// provide logging
private static Logger log = Logger.getLogger(ClientImpl.class);
-
+
private final EndpointMetaData epMetaData;
private final HandlerResolver handlerResolver;
private Map<HandlerType, HandlerChainExecutor> executorMap = new
HashMap<HandlerType, HandlerChainExecutor>();
@@ -89,7 +89,7 @@
this.epMetaData = epMetaData;
this.handlerResolver = handlerResolver;
- resetCreateBindingHandlerChain();
+ initBindingHandlerChain(false);
// The config may change at some later point in time
// when applications utilize the ServiceDecorator API
@@ -100,7 +100,7 @@
/**
* Reset or create the client handler chain in the binding.<br>
*/
- private void resetCreateBindingHandlerChain()
+ private void initBindingHandlerChain(boolean clearExistingHandlers)
{
BindingExt binding = (BindingExt)getBindingProvider().getBinding();
PortInfoImpl portInfo = new PortInfoImpl(epMetaData);
@@ -108,9 +108,9 @@
if (handlerResolver instanceof HandlerResolverImpl)
{
HandlerResolverImpl impl = (HandlerResolverImpl)handlerResolver;
- impl.initHandlerChain(epMetaData, HandlerType.PRE);
- impl.initHandlerChain(epMetaData, HandlerType.ENDPOINT);
- impl.initHandlerChain(epMetaData, HandlerType.POST);
+ impl.initHandlerChain(epMetaData, HandlerType.PRE, clearExistingHandlers);
+ impl.initHandlerChain(epMetaData, HandlerType.ENDPOINT, clearExistingHandlers);
+ impl.initHandlerChain(epMetaData, HandlerType.POST, clearExistingHandlers);
List<Handler> preChain = impl.getHandlerChain(portInfo, HandlerType.PRE);
binding.setHandlerChain(preChain, HandlerType.PRE);
@@ -133,7 +133,7 @@
log.debug("Configuration change event received. Reconfigure handler chain:
" + object);
// re-populate the binding handler chain
- resetCreateBindingHandlerChain();
+ initBindingHandlerChain(true);
}
@Override
@@ -176,15 +176,15 @@
protected void setInboundContextProperties()
{
MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
-
+
// Map of attachments to a message for the inbound message, key is the MIME
Content-ID, value is a DataHandler
msgContext.put(MessageContext.INBOUND_MESSAGE_ATTACHMENTS, new HashMap<String,
DataHandler>());
-
+
// Remoting meta data are available on successfull call completion
if (msgContext.containsKey(CommonMessageContext.REMOTING_METADATA))
{
Map<?, ?> remotingMetadata =
(Map)msgContext.get(CommonMessageContext.REMOTING_METADATA);
-
+
// Get the HTTP_RESPONSE_CODE
Integer resposeCode =
(Integer)remotingMetadata.get(HTTPMetadataConstants.RESPONSE_CODE);
if (resposeCode != null)
@@ -207,7 +207,7 @@
// Mark the message context as outbound
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.put(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);
-
+
// Map of attachments to a message for the outbound message, key is the MIME
Content-ID, value is a DataHandler
msgContext.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS, new HashMap<String,
DataHandler>());
}
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-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -76,9 +76,9 @@
// Initialize the handler chain
if (isInitialized() == false)
{
- resolver.initHandlerChain(sepMetaData, HandlerType.PRE);
- resolver.initHandlerChain(sepMetaData, HandlerType.ENDPOINT);
- resolver.initHandlerChain(sepMetaData, HandlerType.POST);
+ resolver.initHandlerChain(sepMetaData, HandlerType.PRE, true);
+ resolver.initHandlerChain(sepMetaData, HandlerType.ENDPOINT, true);
+ resolver.initHandlerChain(sepMetaData, HandlerType.POST, true);
setInitialized(true);
}
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-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -26,7 +26,6 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -49,6 +48,7 @@
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
@@ -104,54 +104,75 @@
if (scopedHandler.matches(info))
handlers.add(scopedHandler.handler);
}
- return Collections.unmodifiableList(handlers);
+
+ log.warn("[JBCTS-544] - HandlerResolver.getHandlerChain() expected to return a
modifiable list");
+ // return Collections.unmodifiableList(jaxwsHandlerChain);
+
+ return handlers;
}
- public void initHandlerChain(EndpointMetaData epMetaData, HandlerType type)
+ public void initServiceHandlerChain(ServiceMetaData serviceMetaData)
{
- log.debug("initHandlerChain: " + type);
+ log.debug("initServiceHandlerChain: " +
serviceMetaData.getServiceName());
// clear all exisisting handler to avoid double registration
- List<ScopedHandler> handlerMap = getHandlerMap(type);
+ List<ScopedHandler> handlerMap = getHandlerMap(HandlerType.ENDPOINT);
handlerMap.clear();
+ ClassLoader classLoader = serviceMetaData.getUnifiedMetaData().getClassLoader();
+ for (HandlerMetaData handlerMetaData : serviceMetaData.getHandlerMetaData())
+ addHandler(classLoader, HandlerType.ENDPOINT, handlerMetaData);
+ }
+
+ public void initHandlerChain(EndpointMetaData epMetaData, HandlerType type, boolean
clearExistingHandlers)
+ {
+ log.debug("initHandlerChain: " + type);
+
+ List<ScopedHandler> handlerMap = getHandlerMap(type);
+
+ if (clearExistingHandlers)
+ handlerMap.clear();
+
+ ClassLoader classLoader = epMetaData.getClassLoader();
for (HandlerMetaData handlerMetaData : epMetaData.getHandlerMetaData(type))
+ addHandler(classLoader, type, handlerMetaData);
+ }
+
+ private void addHandler(ClassLoader classLoader, HandlerType type, HandlerMetaData
handlerMetaData)
+ {
+ HandlerMetaDataJAXWS jaxwsMetaData = (HandlerMetaDataJAXWS)handlerMetaData;
+ String handlerName = jaxwsMetaData.getHandlerName();
+ String className = jaxwsMetaData.getHandlerClassName();
+ Set<QName> soapHeaders = jaxwsMetaData.getSoapHeaders();
+
+ try
{
- HandlerMetaDataJAXWS jaxwsMetaData = (HandlerMetaDataJAXWS)handlerMetaData;
- String handlerName = jaxwsMetaData.getHandlerName();
- String className = jaxwsMetaData.getHandlerClassName();
- Set<QName> soapHeaders = jaxwsMetaData.getSoapHeaders();
+ // Load the handler class using the deployments top level CL
+ Class hClass = classLoader.loadClass(className);
+ Handler handler = (Handler)hClass.newInstance();
- try
- {
- // Load the handler class using the deployments top level CL
- ClassLoader classLoader = epMetaData.getClassLoader();
- Class hClass = classLoader.loadClass(className);
- Handler handler = (Handler)hClass.newInstance();
+ if (handler instanceof GenericHandler)
+ ((GenericHandler)handler).setHandlerName(handlerName);
- if (handler instanceof GenericHandler)
- ((GenericHandler)handler).setHandlerName(handlerName);
+ if (handler instanceof GenericSOAPHandler)
+ ((GenericSOAPHandler)handler).setHeaders(soapHeaders);
- if (handler instanceof GenericSOAPHandler)
- ((GenericSOAPHandler)handler).setHeaders(soapHeaders);
+ // Inject resources
+ injectResources(handler);
- // Inject resources
- injectResources(handler);
+ // Call @PostConstruct
+ callPostConstruct(handler);
- // Call @PostConstruct
- callPostConstruct(handler);
-
- addHandler(jaxwsMetaData, handler, type);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot load handler: " + className, ex);
- }
+ addHandler(jaxwsMetaData, handler, type);
}
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot load handler: " + className, ex);
+ }
}
private void injectResources(Handler handler)
@@ -223,18 +244,18 @@
QName servicePattern;
QName portPattern;
String protocols;
-
+
Set<String> bindings;
ScopedHandler(Handler handler)
{
this.handler = handler;
}
-
+
boolean matches(PortInfo info)
{
boolean match = true;
- if (match && servicePattern != null)
+ if (servicePattern != null)
{
QName serviceName = info.getServiceName();
match = matchQNamePattern(servicePattern, serviceName);
@@ -271,10 +292,10 @@
{
if (localPart.endsWith("*"))
localPart = localPart.substring(0, localPart.length() - 1);
-
+
String qnameStr = qname.toString();
String patternStr = new QName(nsURI, localPart).toString();
- match = qnameStr.startsWith(patternStr);
+ match = qnameStr.startsWith(patternStr);
}
return match;
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2007-03-30
16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -58,7 +58,7 @@
@Override
public ServiceDelegate createServiceDelegate(URL wsdlLocation, QName serviceName,
Class serviceClass)
{
- ServiceDelegateImpl delegate = new ServiceDelegateImpl(wsdlLocation, serviceName);
+ ServiceDelegateImpl delegate = new ServiceDelegateImpl(wsdlLocation, serviceName,
serviceClass);
return delegate;
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-03-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -56,14 +56,20 @@
import org.jboss.ws.integration.ResourceLoaderAdapter;
import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
+import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* Service delegates are used internally by Service objects to allow pluggability of
JAX-WS implementations.
@@ -86,22 +92,20 @@
// The ServiceRefMetaData supplied by the ServiceObjectFactory
private UnifiedServiceRefMetaData usRef;
// The handler resolver
- private HandlerResolver handlerResolver = new HandlerResolverImpl();
+ private HandlerResolver handlerResolver;
// The executor service
private ExecutorService executor;
// A list of annotated ports
private List<QName> annotatedPorts = new ArrayList<QName>();
- public ServiceDelegateImpl(URL wsdlURL, QName serviceName)
+ public ServiceDelegateImpl(URL wsdlURL, QName serviceName, Class serviceClass)
{
+ // If this Service was constructed through the ServiceObjectFactory
+ // this thread local association should be available
usRef = ServiceObjectFactory.getServiceRefAssociation();
- UnifiedVirtualFile vfsRoot;
- if(usRef!=null)
- vfsRoot = usRef.getVfsRoot();
- else
- vfsRoot = new ResourceLoaderAdapter();
+ UnifiedVirtualFile vfsRoot = (usRef != null ? usRef.getVfsRoot() : new
ResourceLoaderAdapter());
if (wsdlURL != null)
{
@@ -114,15 +118,28 @@
serviceMetaData = new ServiceMetaData(wsMetaData, serviceName);
wsMetaData.addService(serviceMetaData);
}
+
+ handlerResolver = new HandlerResolverImpl();
- // If this Service was constructed through the ServiceObjectFactory
- // this thread local association should be available
-
if (usRef != null)
{
serviceMetaData.setServiceRefName(usRef.getServiceRefName());
+
+ // Setup the service handlers
if (usRef.getHandlerChain() != null)
- serviceMetaData.setHandlerChain(usRef.getHandlerChain());
+ {
+ String filename = usRef.getHandlerChain();
+ UnifiedHandlerChainsMetaData handlerChainsMetaData =
JAXWSMetaDataBuilder.getHandlerChainsMetaData(serviceClass, filename);
+ for (UnifiedHandlerChainMetaData UnifiedHandlerChainMetaData :
handlerChainsMetaData.getHandlerChains())
+ {
+ for (UnifiedHandlerMetaData uhmd :
UnifiedHandlerChainMetaData.getHandlers())
+ {
+ HandlerMetaDataJAXWS handler =
uhmd.getHandlerMetaDataJAXWS(HandlerType.ENDPOINT);
+ serviceMetaData.addHandler(handler);
+ }
+ }
+
((HandlerResolverImpl)handlerResolver).initServiceHandlerChain(serviceMetaData);
+ }
}
}
@@ -324,15 +341,15 @@
private <T> T createProxy(Class<T> seiClass, EndpointMetaData epMetaData)
throws WebServiceException
{
try
- {
+ {
ExecutorService executor = (ExecutorService)getExecutor();
ClientProxy handler = new ClientProxy(executor, new ClientImpl(epMetaData,
handlerResolver));
ClassLoader cl = epMetaData.getClassLoader();
T proxy = (T)Proxy.newProxyInstance(cl, new Class[] { seiClass,
BindingProvider.class, StubExt.class }, handler);
-
+
// Configure the stub
configureStub((StubExt)proxy);
-
+
return proxy;
}
catch (WebServiceException ex)
@@ -344,16 +361,17 @@
throw new WebServiceException("Cannot create proxy", ex);
}
}
-
+
private void configureStub(StubExt stub)
{
EndpointMetaData epMetaData = stub.getEndpointMetaData();
String seiName = epMetaData.getServiceEndpointInterfaceName();
QName portName = epMetaData.getPortName();
- if(usRef == null || usRef.getPortComponentRefs().size() == 0)
+ if (usRef == null || usRef.getPortComponentRefs().size() == 0)
{
- if(log.isDebugEnabled()) log.debug("No port configuration for: " +
portName);
+ if (log.isDebugEnabled())
+ log.debug("No port configuration for: " + portName);
return;
}
@@ -370,8 +388,7 @@
{
if (piSEI != null && piPort != null)
match = seiName.equals(piSEI) && portName.equals(piPort);
- else
- match = seiName.equals(piSEI) || portName.equals(piPort);
+ else match = seiName.equals(piSEI) || portName.equals(piPort);
}
if (match == true)
{
@@ -392,9 +409,11 @@
}
if (match == false)
- if(log.isDebugEnabled()) log.debug("No matching port configuration for:
[portName=" + portName + ",seiName=" + seiName + "]");
+ if (log.isDebugEnabled())
+ log.debug("No matching port configuration for: [portName=" +
portName + ",seiName=" + seiName + "]");
- if(log.isDebugEnabled()) log.debug("Configure Stub: [configName=" +
configName + ",configFile=" + configFile + "]");
+ if (log.isDebugEnabled())
+ log.debug("Configure Stub: [configName=" + configName +
",configFile=" + configFile + "]");
if (configName != null || configFile != null)
stub.setConfigName(configName, configFile);
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2007-03-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -228,7 +228,7 @@
Set<String> portNames = uhmd.getPortNames();
if (portNames.size() == 0 || portNames.contains(portName.getLocalPart()))
{
- epMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(epMetaData,
HandlerType.ENDPOINT));
+
epMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(HandlerType.ENDPOINT));
}
}
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2007-03-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -227,7 +227,7 @@
Set<String> portNames = uhmd.getPortNames();
if (portNames.size() == 0 ||
portNames.contains(portName.getLocalPart()))
{
- sepMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(sepMetaData,
HandlerType.ENDPOINT));
+
sepMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(HandlerType.ENDPOINT));
}
}
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-03-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -113,7 +113,8 @@
{
if (wsClass.isAnnotationPresent(BindingType.class))
{
- if(log.isDebugEnabled()) log.debug("processBindingType on: " +
wsClass.getName());
+ if (log.isDebugEnabled())
+ log.debug("processBindingType on: " + wsClass.getName());
BindingType anBindingType =
(BindingType)wsClass.getAnnotation(BindingType.class);
epMetaData.setBindingId(anBindingType.value());
}
@@ -123,7 +124,8 @@
{
if (wsClass.isAnnotationPresent(SOAPBinding.class))
{
- if(log.isDebugEnabled()) log.debug("processSOAPBinding on: " +
wsClass.getName());
+ if (log.isDebugEnabled())
+ log.debug("processSOAPBinding on: " + wsClass.getName());
SOAPBinding anSoapBinding = wsClass.getAnnotation(SOAPBinding.class);
SOAPBinding.Style attrStyle = anSoapBinding.style();
@@ -157,17 +159,25 @@
if (wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
throw new WSException("Cannot combine @HandlerChain with
@SOAPMessageHandlers");
- // The explicit handler chain on the service has priority
- String filename = epMetaData.getServiceMetaData().getHandlerChain();
+ if (wsClass.isAnnotationPresent(HandlerChain.class))
+ {
+ HandlerChain anHandlerChain = wsClass.getAnnotation(HandlerChain.class);
+ String filename = anHandlerChain.file();
- HandlerChain anHandlerChain = wsClass.getAnnotation(HandlerChain.class);
- if (filename == null && anHandlerChain != null)
- filename = anHandlerChain.file();
+ // Setup the endpoint handlers
+ UnifiedHandlerChainsMetaData handlerChainsMetaData =
getHandlerChainsMetaData(wsClass, filename);
+ for (UnifiedHandlerChainMetaData UnifiedHandlerChainMetaData :
handlerChainsMetaData.getHandlerChains())
+ {
+ for (UnifiedHandlerMetaData uhmd :
UnifiedHandlerChainMetaData.getHandlers())
+ {
+
epMetaData.addHandler(uhmd.getHandlerMetaDataJAXWS(HandlerType.ENDPOINT));
+ }
+ }
+ }
+ }
- // Nothing to do
- if (filename == null)
- return;
-
+ public static UnifiedHandlerChainsMetaData getHandlerChainsMetaData(Class<?>
wsClass, String filename)
+ {
URL fileURL = null;
log.debug("processHandlerChain [" + filename + "] on: " +
wsClass.getName());
@@ -199,7 +209,7 @@
// Try the filename as Resource
if (fileURL == null)
{
- fileURL = epMetaData.getClassLoader().getResource(filename);
+ fileURL = wsClass.getClassLoader().getResource(filename);
}
// Try the filename relative to class
@@ -214,15 +224,15 @@
filepath = filepath.substring(3);
resourcePath = packagePath + "/" + filepath;
}
- fileURL = epMetaData.getClassLoader().getResource(resourcePath);
+ fileURL = wsClass.getClassLoader().getResource(resourcePath);
}
if (fileURL == null)
throw new WSException("Cannot resolve handler file '" + filename +
"' on " + wsClass.getName());
+ UnifiedHandlerChainsMetaData handlerChainsMetaData = null;
try
{
- UnifiedHandlerChainsMetaData UnifiedHandlerChainsMetaData = null;
InputStream is = fileURL.openStream();
try
{
@@ -231,21 +241,13 @@
unmarshaller.setSchemaValidation(true);
unmarshaller.setEntityResolver(new JBossWSEntityResolver());
ObjectModelFactory factory = new HandlerChainsObjectFactory();
- UnifiedHandlerChainsMetaData =
(UnifiedHandlerChainsMetaData)unmarshaller.unmarshal(is, factory, null);
+ handlerChainsMetaData =
(UnifiedHandlerChainsMetaData)unmarshaller.unmarshal(is, factory, null);
}
finally
{
is.close();
}
- // Setup the endpoint handlers
- for (UnifiedHandlerChainMetaData UnifiedHandlerChainMetaData :
UnifiedHandlerChainsMetaData.getHandlerChains())
- {
- for (UnifiedHandlerMetaData uhmd :
UnifiedHandlerChainMetaData.getHandlers())
- {
- epMetaData.addHandler(uhmd.getHandlerMetaDataJAXWS(epMetaData,
HandlerType.ENDPOINT));
- }
- }
}
catch (RuntimeException rte)
{
@@ -255,13 +257,15 @@
{
throw new WSException("Cannot process handler chain: " + filename,
ex);
}
+
+ return handlerChainsMetaData;
}
private void addFault(OperationMetaData omd, Class<?> exception)
{
if (omd.isOneWay())
throw new IllegalStateException("JSR-181 4.3.1 - A JSR-181 processor is
REQUIRED to report an error if an operation marked "
- + "@Oneway has a return value, declares any checked exceptions or has
any INOUT or OUT parameters.");
+ + "@Oneway has a return value, declares any checked exceptions or has
any INOUT or OUT parameters.");
WebFault annotation = exception.getAnnotation(WebFault.class);
@@ -467,7 +471,7 @@
if (namespace == null && (opMetaData.isDocumentBare() || header))
namespace = opMetaData.getQName().getNamespaceURI();
- // RPC body parts must have no namespace
+ // RPC body parts must have no namespace
else if (opMetaData.isRPCLiteral() && !header)
namespace = null;
@@ -502,7 +506,7 @@
if (namespace == null && (opMetaData.isDocumentBare() || header))
namespace = opMetaData.getQName().getNamespaceURI();
- // RPC body parts must have no namespace
+ // RPC body parts must have no namespace
else if (opMetaData.isRPCLiteral() && !header)
namespace = null;
@@ -522,12 +526,13 @@
AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
Action anAction = method.getAnnotation(Action.class);
- if(anAction!=null)
+ if (anAction != null)
{
addrExt.setInboundAction(anAction.input());
addrExt.setOutboundAction(anAction.output());
}
- else // default action values
+ else
+ // default action values
{
// TODO: figure out a way to assign message name instead of IN and OUT
String tns = epMetaData.getPortName().getNamespaceURI();
@@ -774,29 +779,29 @@
{
// process SWA metadata
WSDLDefinitions wsdlDef = epMetaData.getServiceMetaData().getWsdlDefinitions();
- if(wsdlDef!=null)
+ if (wsdlDef != null)
{
- for(WSDLBinding binding : wsdlDef.getBindings())
+ for (WSDLBinding binding : wsdlDef.getBindings())
{
- for(WSDLBindingOperation bindingOp : binding.getOperations())
+ for (WSDLBindingOperation bindingOp : binding.getOperations())
{
// it might an input or output parameter
- WSDLBindingMessageReference[] inOrOutPut =
- (paramMetaData.getMode().equals(ParameterMode.IN) ||
paramMetaData.getMode().equals(ParameterMode.INOUT)) ?
- ( WSDLBindingMessageReference[])bindingOp.getInputs() : (
WSDLBindingMessageReference[])bindingOp.getOutputs();
+ WSDLBindingMessageReference[] inOrOutPut =
(paramMetaData.getMode().equals(ParameterMode.IN) ||
paramMetaData.getMode().equals(ParameterMode.INOUT)) ?
(WSDLBindingMessageReference[])bindingOp
+ .getInputs()
+ : (WSDLBindingMessageReference[])bindingOp.getOutputs();
- if(inOrOutPut.length > 0)
+ if (inOrOutPut.length > 0)
{
// find matching operation
- if(bindingOp.getRef().equals( opMetaData.getQName()))
+ if (bindingOp.getRef().equals(opMetaData.getQName()))
{
WSDLBindingMessageReference bindingInput = inOrOutPut[0];
for (WSDLMIMEPart mimePart : bindingInput.getMimeParts())
{
String partName = mimePart.getPartName();
- if(paramMetaData.getPartName().equals(partName))
+ if (paramMetaData.getPartName().equals(partName))
{
- log.debug("Identified 'mime:content' binding:
" + partName + ", mimeTypes=" +mimePart.getMimeTypes());
+ log.debug("Identified 'mime:content' binding:
" + partName + ", mimeTypes=" + mimePart.getMimeTypes());
paramMetaData.setSwA(true);
paramMetaData.setMimeTypes(mimePart.getMimeTypes());
break;
@@ -851,8 +856,7 @@
// Use the dynamic generator by default. Otherwise reset the last
if (wrapperGenerator == null)
wrapperGenerator = new DynamicWrapperGenerator(loader);
- else
- wrapperGenerator.reset(loader);
+ else wrapperGenerator.reset(loader);
}
protected void resetMetaDataBuilder(ClassLoader loader)
@@ -868,7 +872,8 @@
try
{
String targetNS = epMetaData.getPortTypeName().getNamespaceURI().intern();
- if(log.isDebugEnabled()) log.debug("JAXBContext [types=" + javaTypes +
",tns=" + targetNS + "]");
+ if (log.isDebugEnabled())
+ log.debug("JAXBContext [types=" + javaTypes + ",tns=" +
targetNS + "]");
jaxbCtx = JAXBRIContext.newInstance(javaTypes.toArray(new Class[0]), typeRefs,
targetNS, false);
}
catch (JAXBException ex)
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-03-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -230,7 +230,7 @@
{
for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
{
- HandlerMetaDataJAXWS handlerMetaDataJAXWS =
uhmd.getHandlerMetaDataJAXWS(sepMetaData, HandlerMetaData.HandlerType.ENDPOINT);
+ HandlerMetaDataJAXWS handlerMetaDataJAXWS =
uhmd.getHandlerMetaDataJAXWS(HandlerMetaData.HandlerType.ENDPOINT);
sepMetaData.addHandler(handlerMetaDataJAXWS);
log.debug("Contribute handler from webservices.xml:
" + handlerMetaDataJAXWS.getHandlerName());
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java 2007-03-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -82,7 +82,7 @@
{
for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
{
- handlers.add(uhmd.getHandlerMetaDataJAXRPC(epMetaData, type));
+ handlers.add(uhmd.getHandlerMetaDataJAXRPC(type));
}
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxws/CommonConfigJAXWS.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxws/CommonConfigJAXWS.java 2007-03-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxws/CommonConfigJAXWS.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -29,6 +29,7 @@
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
// $Id$
@@ -81,7 +82,9 @@
{
for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
{
- handlers.add(uhmd.getHandlerMetaDataJAXWS(epMetaData, type));
+ HandlerMetaDataJAXWS handler = uhmd.getHandlerMetaDataJAXWS(type);
+ handler.setEndpointMetaData(epMetaData);
+ handlers.add(handler);
}
}
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java 2007-03-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -128,9 +128,9 @@
portNames.add(value);
}
- public HandlerMetaDataJAXRPC getHandlerMetaDataJAXRPC (EndpointMetaData epMetaData,
HandlerType type)
+ public HandlerMetaDataJAXRPC getHandlerMetaDataJAXRPC (HandlerType type)
{
- HandlerMetaDataJAXRPC hmd = new HandlerMetaDataJAXRPC(epMetaData, type);
+ HandlerMetaDataJAXRPC hmd = new HandlerMetaDataJAXRPC(type);
hmd.setHandlerName(getHandlerName());
hmd.setHandlerClassName(getHandlerClass());
hmd.seiInitParams(getInitParams());
@@ -140,9 +140,9 @@
return hmd;
}
- public HandlerMetaDataJAXWS getHandlerMetaDataJAXWS (EndpointMetaData epMetaData,
HandlerType type)
+ public HandlerMetaDataJAXWS getHandlerMetaDataJAXWS (HandlerType type)
{
- HandlerMetaDataJAXWS hmd = new HandlerMetaDataJAXWS(epMetaData, type);
+ HandlerMetaDataJAXWS hmd = new HandlerMetaDataJAXWS(type);
hmd.setHandlerName(getHandlerName());
hmd.setHandlerClassName(getHandlerClass());
hmd.seiInitParams(getInitParams());
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-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -446,6 +446,7 @@
public void addHandler(HandlerMetaData handler)
{
+ handler.setEndpointMetaData(this);
handlers.add(handler);
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java 2007-03-30
16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -66,9 +66,8 @@
// The cached handler class
private Class handlerClass;
- public HandlerMetaData(EndpointMetaData epMetaData, HandlerType type)
+ public HandlerMetaData(HandlerType type)
{
- this.epMetaData = epMetaData;
this.handlerType = type;
}
@@ -112,7 +111,7 @@
{
try
{
- ClassLoader loader = epMetaData.getClassLoader();
+ ClassLoader loader = getClassLoader();
localClass = loader.loadClass(handlerClassName);
}
catch (ClassNotFoundException ex)
@@ -123,6 +122,13 @@
return localClass;
}
+ private ClassLoader getClassLoader()
+ {
+ // The EndpointMetaData classloader is not availabel for a handler associaated with
a JAXWS Service.handlerResolver
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ return (epMetaData != null ? epMetaData.getClassLoader() : ctxLoader);
+ }
+
public HandlerType getHandlerType()
{
return handlerType;
@@ -156,7 +162,7 @@
securityHandlers.add(org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer.class.getName());
securityHandlers.add(org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient.class.getName());
- if (securityHandlers.contains(handlerClassName))
+ if (securityHandlers.contains(handlerClassName) && epMetaData != null)
{
if (epMetaData.getServiceMetaData().getSecurityConfiguration() == null)
log.warn("WS-Security requires security configuration");
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java 2007-03-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -42,9 +42,9 @@
// The optional <port-name> elements
private Set<String> portNames = new HashSet<String>();
- public HandlerMetaDataJAXRPC(EndpointMetaData epMetaData, HandlerType type)
+ public HandlerMetaDataJAXRPC(HandlerType type)
{
- super(epMetaData, type);
+ super(type);
}
public void setSoapRoles(Set<String> soapRoles)
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java 2007-03-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -43,9 +43,9 @@
// The JAXWS protocol bindings
private String protocolBindings;
- public HandlerMetaDataJAXWS(EndpointMetaData epMetaData, HandlerType type)
+ public HandlerMetaDataJAXWS(HandlerType type)
{
- super(epMetaData, type);
+ super(type);
}
public QName getPortNamePattern()
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2007-03-30
16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -27,6 +27,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -76,8 +77,10 @@
private URL wsdlLocation;
private String wsdlFile;
private URL mappingLocation;
- private String handlerChain;
private String wsdlPublishLocation;
+
+ // The optional service handlers
+ private List<HandlerMetaDataJAXWS> handlers = new
ArrayList<HandlerMetaDataJAXWS>();
// The type mapping that is maintained by this service
private TypesMetaData types;
@@ -158,16 +161,6 @@
this.wsdlLocation = wsdlLocation;
}
- public String getHandlerChain()
- {
- return handlerChain;
- }
-
- public void setHandlerChain(String handlerChain)
- {
- this.handlerChain = handlerChain;
- }
-
public String getWsdlPublishLocation()
{
return wsdlPublishLocation;
@@ -193,6 +186,16 @@
return types;
}
+ public void addHandler(HandlerMetaDataJAXWS handler)
+ {
+ handlers.add(handler);
+ }
+
+ public List<HandlerMetaDataJAXWS> getHandlerMetaData()
+ {
+ return Collections.unmodifiableList(handlers);
+ }
+
public List<EndpointMetaData> getEndpoints()
{
return new ArrayList<EndpointMetaData>(endpoints.values());
@@ -440,7 +443,6 @@
buffer.append("\n wsdlFile=" + wsdlFile);
buffer.append("\n wsdlLocation=" + wsdlLocation);
buffer.append("\n jaxrpcMapping=" + mappingLocation);
- buffer.append("\n handlerChain=" + handlerChain);
buffer.append("\n publishLocation=" + wsdlPublishLocation);
buffer.append("\n securityConfig=" + (securityConfig != null ?
"found" : null));
buffer.append("\n properties=" + properties);
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClient.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClient.java 2007-03-30
16:46:50 UTC (rev 2731)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClient.java 2007-03-30
17:33:56 UTC (rev 2732)
@@ -24,11 +24,16 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceRef;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.HandlerResolver;
+import javax.xml.ws.handler.PortInfo;
import org.jboss.logging.Logger;
@@ -36,9 +41,9 @@
{
// provide logging
private static final Logger log = Logger.getLogger(HandlerChainClient.class);
-
+
@WebServiceRef(name = "Service1")
- @HandlerChain(file = "jaxws-handlers-client.xml")
+ @HandlerChain(file = "jaxws-handlers-client.xml")
static Service service1;
// Service2 should have no client side handler chain
@@ -54,7 +59,7 @@
{
String testName = args[0];
String reqStr = args[1];
-
+
HandlerChainClient client = new HandlerChainClient();
Method method = HandlerChainClient.class.getMethod(testName, new Class[] {
String.class });
try
@@ -76,6 +81,29 @@
public String testService1(String reqStr) throws Exception
{
+ PortInfo info = new PortInfo()
+ {
+ public String getBindingID()
+ {
+ return "http://schemas.xmlsoap.org/wsdl/soap/http";
+ }
+
+ public QName getPortName()
+ {
+ return null;
+ }
+
+ public QName getServiceName()
+ {
+ return null;
+ }
+ };
+
+ HandlerResolver resolver = service1.getHandlerResolver();
+ List<Handler> handlerChain = resolver.getHandlerChain(info);
+ if("[LogHandler, AuthorizationHandler, RoutingHandler,
MimeHandler]".equals(handlerChain.toString()) == false)
+ throw new IllegalStateException("Unexpected resolver handlers: " +
handlerChain);
+
Endpoint port = service1.getPort(Endpoint.class);
return port.echo(reqStr);
}