Author: alessio.soldano(a)jboss.com
Date: 2008-02-22 09:54:55 -0500 (Fri, 22 Feb 2008)
New Revision: 5771
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
Log:
[JBWS-2010] Operation metadata selection with Dispatch
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2008-02-22
14:48:06 UTC (rev 5770)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2008-02-22
14:54:55 UTC (rev 5771)
@@ -74,12 +74,14 @@
import org.jboss.ws.metadata.config.ConfigurationProvider;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.wsse.WSSecurityConfigFactory;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
+
/**
* The Dispatch interface provides support for the dynamic invocation of a service
endpoint operations.
* The javax.xml.ws.Service interface acts as a factory for the creation of Dispatch
instances.
@@ -211,6 +213,9 @@
msgContext.setEndpointMetaData(epMetaData);
msgContext.setSOAPMessage(reqMsg);
msgContext.putAll(reqContext);
+ // Try to find out the operation metadata corresponding to the message we're
sending
+ msgContext.setOperationMetaData(getOperationMetaData(epMetaData,reqMsg));
+
// The contents of the request context are used to initialize the message context
(see section 9.4.1)
// prior to invoking any handlers (see chapter 9) for the outbound message. Each
property within the
@@ -606,4 +611,21 @@
if (executor != null)
executor.close(msgContext);
}
+
+ private OperationMetaData getOperationMetaData(EndpointMetaData epMetaData,
MessageAbstraction reqMessage) throws SOAPException
+ {
+ OperationMetaData opMetaData = null;
+ if (HTTPBinding.HTTP_BINDING.equals(epMetaData.getBindingId()) &&
epMetaData.getOperations().size() == 1)
+ {
+ opMetaData = epMetaData.getOperations().get(0);
+ }
+ else if (reqMessage instanceof SOAPMessageImpl)
+ {
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)reqMessage;
+ opMetaData = soapMessage.getOperationMetaData(epMetaData);
+ }
+ if (opMetaData == null)
+ log.debug("Cannot find the right operation metadata!");
+ return opMetaData;
+ }
}
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2008-02-22
14:48:06 UTC (rev 5770)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2008-02-22
14:54:55 UTC (rev 5771)
@@ -93,6 +93,7 @@
if (childNode instanceof SOAPBodyElement)
{
soapBodyElement = (SOAPBodyElement)childNode;
+ soapBodyElement.getValue(); //force transition to DOM-Valid model
}
}