Author: jim.ma
Date: 2010-02-27 06:37:19 -0500 (Sat, 27 Feb 2010)
New Revision: 11699
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2927/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2927/JBWS2927TestCase.java
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
stack/native/branches/jbossws-native-3.1.2/modules/jaxws-ext/src/main/java/javax/xml/ws/addressing/MapRequiredException.java
Log:
[JBPAPP-3808]:Fixed the jaxws2.1 standalone tck test failures in
com/sun/ts/tests/jaxws/wsa/j2w/document/literal/addressingfeature module
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2010-02-27
11:34:52 UTC (rev 11698)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2010-02-27
11:37:19 UTC (rev 11699)
@@ -38,6 +38,7 @@
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.addressing.MapRequiredException;
import javax.xml.ws.soap.SOAPBinding;
import javax.xml.ws.soap.SOAPFaultException;
@@ -257,7 +258,16 @@
SOAPBody soapBody = soapMessage.getSOAPBody();
- SOAPFault soapFault = soapBody.addFault(getFallbackFaultCode(),
getFallbackFaultString(ex));
+ SOAPFault soapFault = null;
+ if(ex instanceof MapRequiredException)
+ {
+ MapRequiredException addrException = (MapRequiredException)ex;
+ soapFault = soapBody.addFault(addrException.getSubcode(),
addrException.getMessage());
+ }
+ else
+ {
+ soapFault = soapBody.addFault(getFallbackFaultCode(),
getFallbackFaultString(ex));
+ }
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
SerializationContext serContext = msgContext.getSerializationContext();
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java 2010-02-27
11:34:52 UTC (rev 11698)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java 2010-02-27
11:37:19 UTC (rev 11699)
@@ -155,7 +155,7 @@
public QName getMapRequiredQName()
{
- return new QName(URI_ADDRESSING, "MessageInformationHeaderRequired",
PREFIX_ADDRESSING);
+ return new QName(URI_ADDRESSING, "MessageAddressingHeaderRequired",
PREFIX_ADDRESSING);
}
public QName getDestinationUnreachableQName()
@@ -200,6 +200,6 @@
public String getMapRequiredText()
{
- return "Map Required";
+ return "A required header representing a Message Addressing Property is not
present";
}
}
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2010-02-27
11:34:52 UTC (rev 11698)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2010-02-27
11:37:19 UTC (rev 11699)
@@ -137,7 +137,8 @@
{
SOAPAddressingBuilder builder =
(SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
SOAPAddressingProperties addrProps =
(SOAPAddressingProperties)builder.newAddressingProperties();
- addrProps.readHeaders(soapMessage);
+ soapMessage.setProperty("isClientInbound", "true");
+ addrProps.readHeaders(soapMessage);
msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addrProps);
msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES,
Scope.APPLICATION);
msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND,
addrProps);
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java 2010-02-27
11:34:52 UTC (rev 11698)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java 2010-02-27
11:37:19 UTC (rev 11699)
@@ -39,6 +39,7 @@
import javax.xml.ws.addressing.AddressingConstants;
import javax.xml.ws.addressing.AddressingException;
import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.MapRequiredException;
import javax.xml.ws.addressing.ReferenceParameters;
import javax.xml.ws.addressing.Relationship;
import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
@@ -76,10 +77,10 @@
private String getRequiredHeaderContent(SOAPHeader soapHeader, QName qname)
{
Element element = DOMUtils.getFirstChildElement(soapHeader, qname);
- if(null == element) throw new AddressingException("Required element
"+qname+" is missing");
+ if(null == element) throw new MapRequiredException(qname);
String value = DOMUtils.getTextContent(element);
- if(null == value || value.equals("")) throw new
AddressingException("Required element "+qname+" is missing");
+ if(null == value || value.equals("")) throw new MapRequiredException(qname);
return value;
}
@@ -146,8 +147,19 @@
// wsa:Action
// This REQUIRED element of type xs:anyURI conveys the [action] property.
// The [children] of this element convey the value of this property.
- String action = getRequiredHeaderContent(soapHeader, ADDR.getActionQName());
- setAction(builder.newURI(action));
+ if (message.getProperty("isClientInbound") != null)
+ {
+ String action = getOptionalHeaderContent(soapHeader,
ADDR.getActionQName());
+ if (action != null)
+ {
+ setAction(builder.newURI(action));
+ }
+ }
+ else
+ {
+ String action = getRequiredHeaderContent(soapHeader,
ADDR.getActionQName());
+ setAction(builder.newURI(action));
+ }
// Read wsa:MessageID
// This OPTIONAL element (whose content is of type xs:anyURI) conveys the [message id]
property.
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/jaxws-ext/src/main/java/javax/xml/ws/addressing/MapRequiredException.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/jaxws-ext/src/main/java/javax/xml/ws/addressing/MapRequiredException.java 2010-02-27
11:34:52 UTC (rev 11698)
+++
stack/native/branches/jbossws-native-3.1.2/modules/jaxws-ext/src/main/java/javax/xml/ws/addressing/MapRequiredException.java 2010-02-27
11:37:19 UTC (rev 11699)
@@ -38,7 +38,9 @@
public MapRequiredException(QName name)
{
- super(fMessage + ": " + name);
+ //TODO:Add the exact missing header qname in soap header
+ super(fMessage);
+
}
public QName getSubcode()
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2927/JBWS2927TestCase.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2927/JBWS2927TestCase.java
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2927/JBWS2927TestCase.java 2010-02-27
11:37:19 UTC (rev 11699)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.jbws2927;
+
+
+/**
+ * JBWS2927TestCase.
+ *
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class JBWS2927TestCase extends TestCase
+{
+
+}