Author: thomas.diesler(a)jboss.com
Date: 2007-03-28 09:49:39 -0400 (Wed, 28 Mar 2007)
New Revision: 2703
Modified:
trunk/build/ant-import/build-thirdparty.xml
trunk/integration-jboss40/.classpath
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/JBWS1179TestCase.java
Log:
Fix jbossws-tests regression
Modified: trunk/build/ant-import/build-thirdparty.xml
===================================================================
--- trunk/build/ant-import/build-thirdparty.xml 2007-03-28 10:11:05 UTC (rev 2702)
+++ trunk/build/ant-import/build-thirdparty.xml 2007-03-28 13:49:39 UTC (rev 2703)
@@ -40,7 +40,7 @@
<get src="${jboss.repository}/gnu-getopt/${gnu-getopt}/lib/getopt.jar"
dest="${thirdparty.dir}/getopt.jar" usetimestamp="true"
verbose="true"/>
<get src="${jboss.repository}/hibernate/${hibernate}/lib/hibernate3.jar"
dest="${thirdparty.dir}/hibernate3.jar" usetimestamp="true"
verbose="true"/>
<get src="${jboss.repository}/ibm-wsdl4j/${ibm-wsdl4j}/lib/wsdl4j.jar"
dest="${thirdparty.dir}/wsdl4j.jar" usetimestamp="true"
verbose="true"/>
- <!--get
src="${jboss.repository}/ibm-wsdl4j/${ibm-wsdl4j}/lib/wsdl4j-src.jar"
dest="${thirdparty.dir}/wsdl4j-src.jar" usetimestamp="true"
verbose="true"/-->
+ <get
src="${jboss.repository}/ibm-wsdl4j/${ibm-wsdl4j}/lib/wsdl4j-src.jar"
dest="${thirdparty.dir}/wsdl4j-src.jar" usetimestamp="true"
verbose="true"/>
<get src="${jboss.repository}/jaxen/${jaxen}/lib/jaxen.jar"
dest="${thirdparty.dir}/jaxen.jar" usetimestamp="true"
verbose="true"/>
<get src="${jboss.repository}/javassist/${javassist}/lib/javassist.jar"
dest="${thirdparty.dir}/javassist.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/backport-concurrent/${jboss-backport-concurrent}/lib/jboss-backport-concurrent.jar"
dest="${thirdparty.dir}/jboss-backport-concurrent.jar"
usetimestamp="true" verbose="true"/>
Modified: trunk/integration-jboss40/.classpath
===================================================================
--- trunk/integration-jboss40/.classpath 2007-03-28 10:11:05 UTC (rev 2702)
+++ trunk/integration-jboss40/.classpath 2007-03-28 13:49:39 UTC (rev 2703)
@@ -17,7 +17,7 @@
<classpathentry kind="lib"
path="/build/thirdparty/jboss-logging-spi.jar"/>
<classpathentry kind="lib"
path="/build/thirdparty/jboss-remoting.jar"/>
<classpathentry kind="lib"
path="/build/thirdparty/jboss-xml-binding.jar"/>
- <classpathentry kind="lib"
path="/build/thirdparty/wsdl4j.jar"/>
+ <classpathentry kind="lib" path="/build/thirdparty/wsdl4j.jar"
sourcepath="/build/thirdparty/wsdl4j-src.jar"/>
<classpathentry kind="lib"
path="/build/thirdparty/xmlsec.jar"/>
<classpathentry kind="lib"
path="/build/thirdparty/ejb3.deployer/jboss-annotations-ejb3.jar"/>
<classpathentry kind="lib"
path="/build/thirdparty/ejb3.deployer/jboss-ejb3x.jar"/>
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-28 10:11:05
UTC (rev 2702)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java 2007-03-28 13:49:39
UTC (rev 2703)
@@ -301,14 +301,12 @@
try
{
URL wsaToURL = new URL(wsaTo);
- if (log.isDebugEnabled())
- log.debug("Sending request to addressing destination: "
+ wsaToURL);
+ log.debug("Sending request to addressing destination: " +
wsaToURL);
targetAddress = wsaToURL.toExternalForm();
}
catch (MalformedURLException ex)
{
- if (log.isDebugEnabled())
- log.debug("Not a valid URL: " + wsaTo);
+ log.debug("Not a valid URL: " + wsaTo);
}
}
}
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-28
10:11:05 UTC (rev 2702)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-03-28
13:49:39 UTC (rev 2703)
@@ -37,6 +37,7 @@
import javax.xml.ws.Binding;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.EndpointReference;
+import javax.xml.ws.ProtocolException;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.Handler;
import javax.xml.ws.handler.HandlerResolver;
@@ -176,24 +177,30 @@
@Override
protected void setInboundContextProperties()
{
- // Get the HTTP_RESPONSE_CODE
MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
- Map<?, ?> remotingMetadata =
(Map)msgContext.get(CommonMessageContext.REMOTING_METADATA);
- Integer resposeCode =
(Integer)remotingMetadata.get(HTTPMetadataConstants.RESPONSE_CODE);
- if (resposeCode != null)
- msgContext.put(MessageContextJAXWS.HTTP_RESPONSE_CODE, resposeCode);
// 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>());
- // [JBREM-728] Improve access to HTTP response headers
- Map<String, List> headers = new HashMap<String, List>();
- for (Map.Entry en : remotingMetadata.entrySet())
+ // Remoting meta data are available on successfull call completion
+ if (msgContext.containsKey(CommonMessageContext.REMOTING_METADATA))
{
- if (en.getKey() instanceof String && en.getValue() instanceof List)
- headers.put((String)en.getKey(), (List)en.getValue());
+ Map<?, ?> remotingMetadata =
(Map)msgContext.get(CommonMessageContext.REMOTING_METADATA);
+
+ // Get the HTTP_RESPONSE_CODE
+ Integer resposeCode =
(Integer)remotingMetadata.get(HTTPMetadataConstants.RESPONSE_CODE);
+ if (resposeCode != null)
+ msgContext.put(MessageContextJAXWS.HTTP_RESPONSE_CODE, resposeCode);
+
+ // [JBREM-728] Improve access to HTTP response headers
+ Map<String, List> headers = new HashMap<String, List>();
+ for (Map.Entry en : remotingMetadata.entrySet())
+ {
+ if (en.getKey() instanceof String && en.getValue() instanceof List)
+ headers.put((String)en.getKey(), (List)en.getValue());
+ }
+ msgContext.put(MessageContext.HTTP_RESPONSE_HEADERS, headers);
}
- msgContext.put(MessageContext.HTTP_RESPONSE_HEADERS, headers);
}
@Override
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2007-03-28
10:11:05 UTC (rev 2702)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2007-03-28
13:49:39 UTC (rev 2703)
@@ -207,8 +207,15 @@
{
// Unwrap the cause if it is an Application Exception, otherwise use a protocol
exception
Throwable cause = ex.getCause();
- if (cause instanceof Exception && !(cause instanceof RuntimeException)
&& !(cause instanceof SOAPException))
- th = cause;
+ if (cause instanceof Exception)
+ {
+ if (cause instanceof WebServiceException)
+ th = cause;
+ else if (cause instanceof SOAPException)
+ th = ex;
+ else if (cause instanceof RuntimeException)
+ th = ex;
+ }
}
throw th;
}
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-28
10:11:05 UTC (rev 2702)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-03-28
13:49:39 UTC (rev 2703)
@@ -493,7 +493,7 @@
}
// Copy the cookies to the response
- HttpSession httpSession = httpRequest.getSession();
+ HttpSession httpSession = httpRequest.getSession(false);
Set<Cookie> sessionCoookies = httpSession != null ?
(Set<Cookie>)httpSession.getAttribute(SESSION_COOKIES) : null;
if (sessionCoookies != null)
{
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-03-28
10:11:05 UTC (rev 2702)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-03-28
13:49:39 UTC (rev 2703)
@@ -37,9 +37,8 @@
import javax.wsdl.Import;
import javax.wsdl.Port;
import javax.wsdl.Service;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.UnknownExtensibilityElement;
import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.extensions.soap12.SOAP12Address;
import javax.xml.namespace.QName;
import javax.xml.ws.addressing.AddressingProperties;
@@ -79,7 +78,6 @@
import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.w3c.dom.Element;
/** An abstract meta data builder.
*
@@ -130,7 +128,6 @@
}
}
-
public static void initEndpointAddress(UnifiedDeploymentInfo udi,
ServerEndpointMetaData sepMetaData, String linkName)
{
String contextRoot = sepMetaData.getContextRoot();
@@ -232,7 +229,6 @@
return ObjectNameFactory.create(idstr.toString());
}
-
/** Get the web service address for a given path
*/
public static String getServiceEndpointAddress(String uriScheme, String servicePath)
@@ -299,7 +295,7 @@
}
sepMetaData.setTransportGuarantee(transportGuarantee);
}
-
+
/** Replace the address locations for a given port component.
*/
public static void replaceAddressLocation(ServerEndpointMetaData sepMetaData)
@@ -333,7 +329,8 @@
if (alwaysModify || uriScheme == null ||
orgAddress.indexOf("REPLACE_WITH_ACTUAL_URL") >= 0)
{
- if(log.isDebugEnabled()) log.debug("Replace service endpoint
address '" + orgAddress + "' with '" + serviceEndpointURL +
"'");
+ if (log.isDebugEnabled())
+ log.debug("Replace service endpoint address '" +
orgAddress + "' with '" + serviceEndpointURL + "'");
wsdlEndpoint.setAddress(serviceEndpointURL);
sepMetaData.setEndpointAddress(serviceEndpointURL);
@@ -343,7 +340,8 @@
}
else
{
- if(log.isDebugEnabled()) log.debug("Don't replace service
endpoint address '" + orgAddress + "'");
+ if (log.isDebugEnabled())
+ log.debug("Don't replace service endpoint address
'" + orgAddress + "'");
try
{
sepMetaData.setEndpointAddress(new
URL(orgAddress).toExternalForm());
@@ -393,8 +391,6 @@
private static Port modifySOAPAddress(String tnsURI, QName portQName, String
serviceEndpointURL, Map services)
{
- QName SOAP12_ADDRESS = new QName(Constants.NS_SOAP12, "address");
-
Port wsdlOneOnePort = null;
Iterator itServices = services.values().iterator();
while (itServices.hasNext())
@@ -411,16 +407,15 @@
List extElements = wsdlOneOnePort.getExtensibilityElements();
for (Object extElement : extElements)
{
- QName elementType =
((ExtensibilityElement)extElement).getElementType();
if (extElement instanceof SOAPAddress)
{
SOAPAddress address = (SOAPAddress)extElement;
address.setLocationURI(serviceEndpointURL);
}
- else if (SOAP12_ADDRESS.equals(elementType))
+ if (extElement instanceof SOAP12Address)
{
- Element domElement =
((UnknownExtensibilityElement)extElement).getElement();
- domElement.setAttribute("location", serviceEndpointURL);
+ SOAP12Address address = (SOAP12Address)extElement;
+ address.setLocationURI(serviceEndpointURL);
}
}
}
@@ -461,7 +456,7 @@
// extract the root element NS
String notificationRootElementNS = null;
WSDLInterfaceOperation wsdlInterfaceOperation =
wsdlInterface.getOperations()[0];
- if(wsdlInterfaceOperation.getOutputs().length > 0 )
+ if (wsdlInterfaceOperation.getOutputs().length > 0)
{
WSDLInterfaceOperationOutput wsdlInterfaceOperationOutput =
wsdlInterfaceOperation.getOutputs()[0];
notificationRootElementNS =
wsdlInterfaceOperationOutput.getElement().getNamespaceURI();
@@ -470,8 +465,7 @@
{
// WSDL operation of an WSDL interface that is marked as an event source
// requires to carry an output message.
- throw new WSException("Unable to resolve eventing root element NS. No
operation output found at "+
- wsdlInterfaceOperation.getName());
+ throw new WSException("Unable to resolve eventing root element NS. No
operation output found at " + wsdlInterfaceOperation.getName());
}
EventingEpMetaExt ext = new
EventingEpMetaExt(EventingConstants.NS_EVENTING);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2007-03-28
10:11:05 UTC (rev 2702)
+++ trunk/jbossws-core/src/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2007-03-28
13:49:39 UTC (rev 2703)
@@ -64,6 +64,10 @@
import javax.wsdl.extensions.soap.SOAPBody;
import javax.wsdl.extensions.soap.SOAPHeader;
import javax.wsdl.extensions.soap.SOAPOperation;
+import javax.wsdl.extensions.soap12.SOAP12Address;
+import javax.wsdl.extensions.soap12.SOAP12Binding;
+import javax.wsdl.extensions.soap12.SOAP12Body;
+import javax.wsdl.extensions.soap12.SOAP12Operation;
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
@@ -116,16 +120,6 @@
// provide logging
private static final Logger log = Logger.getLogger(WSDL11Reader.class);
- private static QName HTTP_BINDING = new QName(Constants.NS_HTTP,
"binding");
-
- private static QName SOAP12_BINDING = new QName(Constants.NS_SOAP12,
"binding");
-
- private static QName SOAP12_BODY = new QName(Constants.NS_SOAP12, "body");
-
- private static QName SOAP12_OPERATION = new QName(Constants.NS_SOAP12,
"operation");
-
- private static QName SOAP12_ADDRESS = new QName(Constants.NS_SOAP12,
"address");
-
private WSDLDefinitions destWsdl;
// Maps wsdl message parts to their corresponding element names
@@ -449,7 +443,7 @@
String path = parentURL.toExternalForm();
path = path.substring(0, path.lastIndexOf("/"));
-
+
while (location.startsWith("../"))
{
path = path.substring(0, path.lastIndexOf("/"));
@@ -797,10 +791,10 @@
SOAPOperation soapOp = (SOAPOperation)extElement;
operationStyle = soapOp.getStyle();
}
- else if (SOAP12_OPERATION.equals(elementType))
+ else if (extElement instanceof SOAP12Operation)
{
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- operationStyle = getOptionalAttribute(domElement, "style");
+ SOAP12Operation soapOp = (SOAP12Operation)extElement;
+ operationStyle = soapOp.getStyle();
}
}
@@ -814,10 +808,10 @@
SOAPBinding soapBinding = (SOAPBinding)extElement;
operationStyle = soapBinding.getStyle();
}
- else if (SOAP12_BINDING.equals(elementType))
+ else if (extElement instanceof SOAP12Binding)
{
- Element domElement =
((UnknownExtensibilityElement)extElement).getElement();
- operationStyle = getOptionalAttribute(domElement, "style");
+ SOAP12Binding soapBinding = (SOAP12Binding)extElement;
+ operationStyle = soapBinding.getStyle();
}
}
}
@@ -846,7 +840,7 @@
{
bindingType = Constants.NS_SOAP11;
}
- else if (SOAP12_BINDING.equals(elementType))
+ else if (extElement instanceof SOAP12Binding)
{
bindingType = Constants.NS_SOAP12;
}
@@ -883,10 +877,10 @@
SOAPBinding soapBinding = (SOAPBinding)extElement;
bindingStyle = soapBinding.getStyle();
}
- else if (SOAP12_BINDING.equals(elementType))
+ else if (extElement instanceof SOAP12Binding)
{
- Element domElement =
((UnknownExtensibilityElement)extElement).getElement();
- bindingStyle = getOptionalAttribute(domElement, "style");
+ SOAP12Binding soapBinding = (SOAP12Binding)extElement;
+ bindingStyle = soapBinding.getStyle();
}
}
@@ -1026,16 +1020,15 @@
List<ExtensibilityElement> extList =
srcBindingOperation.getExtensibilityElements();
for (ExtensibilityElement extElement : extList)
{
- QName elementType = extElement.getElementType();
if (extElement instanceof SOAPOperation)
{
SOAPOperation soapOp = (SOAPOperation)extElement;
destBindingOperation.setSOAPAction(soapOp.getSoapActionURI());
}
- else if (SOAP12_OPERATION.equals(elementType))
+ else if (extElement instanceof SOAP12Operation)
{
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- destBindingOperation.setSOAPAction(getOptionalAttribute(domElement,
"soapAction"));
+ SOAP12Operation soapOp = (SOAP12Operation)extElement;
+ destBindingOperation.setSOAPAction(soapOp.getSoapActionURI());
}
}
@@ -1126,24 +1119,28 @@
processBindingReference(srcWsdl, destBindingOperation, destIntfOperation, extList,
output, srcBindingOperation, cb);
}
- private void processBindingReference(Definition srcWsdl, WSDLBindingOperation
destBindingOperation, WSDLInterfaceOperation destIntfOperation,
List<ExtensibilityElement> extList,
- WSDLBindingMessageReference reference, BindingOperation srcBindingOperation,
ReferenceCallback callback)
+ private void processBindingReference(Definition srcWsdl, WSDLBindingOperation
destBindingOperation, WSDLInterfaceOperation destIntfOperation,
+ List<ExtensibilityElement> extList, WSDLBindingMessageReference reference,
BindingOperation srcBindingOperation, ReferenceCallback callback)
throws WSDLException
{
for (ExtensibilityElement extElement : extList)
{
- QName elementType = extElement.getElementType();
if (extElement instanceof SOAPBody)
{
- processEncodingStyle(extElement, destBindingOperation);
-
+ SOAPBody body = (SOAPBody)extElement;
+ processEncodingStyle(body, destBindingOperation);
+
// <soap:body use="encoded"
namespace="http://MarshallTestW2J.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- String namespaceURI = ((SOAPBody)extElement).getNamespaceURI();
+ String namespaceURI = body.getNamespaceURI();
destBindingOperation.setNamespaceURI(namespaceURI);
}
- else if (SOAP12_BODY.equals(elementType))
+ else if (extElement instanceof SOAP12Body)
{
- processEncodingStyle(extElement, destBindingOperation);
+ SOAP12Body body = (SOAP12Body)extElement;
+ processEncodingStyle(body, destBindingOperation);
+
+ String namespaceURI = body.getNamespaceURI();
+ destBindingOperation.setNamespaceURI(namespaceURI);
}
else if (extElement instanceof SOAPHeader)
{
@@ -1241,7 +1238,6 @@
log.trace("processEncodingStyle");
String encStyle = null;
- QName elementType = extElement.getElementType();
if (extElement instanceof SOAPBody)
{
SOAPBody body = (SOAPBody)extElement;
@@ -1257,10 +1253,10 @@
}
}
}
- else if (SOAP12_BODY.equals(elementType))
+ else if (extElement instanceof SOAP12Body)
{
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- encStyle = getOptionalAttribute(domElement, "encodingStyle");
+ SOAP12Body body = (SOAP12Body)extElement;
+ encStyle = body.getEncodingStyle();
}
if (encStyle != null)
@@ -1355,10 +1351,10 @@
soapAddress = addr.getLocationURI();
break;
}
- else if (SOAP12_ADDRESS.equals(elementType))
+ else if (extElement instanceof SOAP12Address)
{
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- soapAddress = getOptionalAttribute(domElement, "location");
+ SOAP12Address addr = (SOAP12Address)extElement;
+ soapAddress = addr.getLocationURI();
break;
}
else if ("address".equals(elementType.getLocalPart()))
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/JBWS1179TestCase.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/JBWS1179TestCase.java 2007-03-28
10:11:05 UTC (rev 2702)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/JBWS1179TestCase.java 2007-03-28
13:49:39 UTC (rev 2703)
@@ -60,14 +60,6 @@
}
}
- protected int getActiveSessions() throws Exception
- {
- MBeanServerConnection server = getServer();
- ObjectName objectName = new
ObjectName("jboss.web:host=localhost,path=/jaxrpc-jbws1179,type=Manager");
-
- return ((Integer)server.getAttribute(objectName,
"activeSessions")).intValue();
- }
-
public void testCallCreateNoSession() throws Exception
{
int originalSessions = getActiveSessions();
@@ -89,4 +81,12 @@
assertEquals("activeSessions after call", originalSessions + 1,
finalSessions);
}
+
+ private int getActiveSessions() throws Exception
+ {
+ MBeanServerConnection server = getServer();
+ ObjectName objectName = new
ObjectName("jboss.web:host=localhost,path=/jaxrpc-jbws1179,type=Manager");
+
+ return ((Integer)server.getAttribute(objectName,
"activeSessions")).intValue();
+ }
}