JBossWS SVN: r9053 - stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-01-15 12:41:17 -0500 (Thu, 15 Jan 2009)
New Revision: 9053
Modified:
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
Log:
[JBWS-2454] Setting javax.xml.ws.reference.parameters property in the message context
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2009-01-15 16:32:26 UTC (rev 9052)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2009-01-15 17:41:17 UTC (rev 9053)
@@ -27,6 +27,7 @@
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.wsf.common.handler.GenericSOAPHandler;
+import org.w3c.dom.Element;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
@@ -43,6 +44,8 @@
import java.net.URISyntaxException;
import java.util.Collections;
import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Set;
/**
@@ -131,6 +134,8 @@
msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, Scope.APPLICATION);
msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, addrProps);
msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, Scope.APPLICATION);
+ msgContext.put(MessageContext.REFERENCE_PARAMETERS, convertToElementList(addrProps.getReferenceParameters().getElements()));
+ msgContext.setScope(MessageContext.REFERENCE_PARAMETERS, Scope.APPLICATION);
}
}
catch (SOAPException ex)
@@ -140,4 +145,18 @@
return true;
}
+
+ private static List<Element> convertToElementList(List<Object> objects)
+ {
+ if (objects == null) return null;
+ List<Element> elements = new LinkedList<Element>();
+ for (Object o : objects)
+ {
+ if (o instanceof Element)
+ {
+ elements.add((Element)o);
+ }
+ }
+ return elements;
+ }
}
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2009-01-15 16:32:26 UTC (rev 9052)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2009-01-15 17:41:17 UTC (rev 9053)
@@ -27,6 +27,7 @@
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.wsf.common.handler.GenericSOAPHandler;
+import org.w3c.dom.Element;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPMessage;
@@ -40,6 +41,8 @@
import java.net.URISyntaxException;
import java.util.Collections;
import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Set;
/**
@@ -82,9 +85,24 @@
addrProps.readHeaders(soapMessage);
msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, addrProps);
msgContext.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, Scope.APPLICATION);
-
+ msgContext.put(MessageContext.REFERENCE_PARAMETERS, convertToElementList(addrProps.getReferenceParameters().getElements()));
+ msgContext.setScope(MessageContext.REFERENCE_PARAMETERS, Scope.APPLICATION);
return true;
}
+
+ private static List<Element> convertToElementList(List<Object> objects)
+ {
+ if (objects == null) return null;
+ List<Element> elements = new LinkedList<Element>();
+ for (Object o : objects)
+ {
+ if (o instanceof Element)
+ {
+ elements.add((Element)o);
+ }
+ }
+ return elements;
+ }
protected boolean handleOutbound(MessageContext msgContext)
{
15 years, 11 months
JBossWS SVN: r9052 - in stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws: metadata/builder/jaxws and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-01-15 11:32:26 -0500 (Thu, 15 Jan 2009)
New Revision: 9052
Modified:
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientFeatureProcessor.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
Log:
[JBWS-2459] Added comments
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientFeatureProcessor.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientFeatureProcessor.java 2009-01-15 16:25:19 UTC (rev 9051)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientFeatureProcessor.java 2009-01-15 16:32:26 UTC (rev 9052)
@@ -116,7 +116,7 @@
List<WSDLExtensibilityElement> notUnderstoodList = extendable.getNotUnderstoodExtElements();
for (WSDLExtensibilityElement el : notUnderstoodList)
{
- boolean disabledByFeature = false; //TODO
+ boolean disabledByFeature = false; //TODO [JBWS-2459]
if (el.isRequired() && !disabledByFeature)
{
String s = DOMWriter.printNode(el.getElement(), true);
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java 2009-01-15 16:25:19 UTC (rev 9051)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java 2009-01-15 16:32:26 UTC (rev 9052)
@@ -184,7 +184,7 @@
List<WSDLExtensibilityElement> notUnderstoodList = extendable.getNotUnderstoodExtElements();
for (WSDLExtensibilityElement el : notUnderstoodList)
{
- boolean disabledByFeature = false; //TODO
+ boolean disabledByFeature = false; //TODO [JBWS-2459]
if (el.isRequired() && !disabledByFeature)
{
String s = DOMWriter.printNode(el.getElement(), true);
15 years, 11 months
JBossWS SVN: r9051 - in stack/native/branches/jaxws21/modules: core/src/main/java/org/jboss/ws/metadata/builder/jaxws and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-01-15 11:25:19 -0500 (Thu, 15 Jan 2009)
New Revision: 9051
Modified:
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientFeatureProcessor.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java
stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLExtensElemTestCase.java
Log:
[JBWS-2449] @RespectBinding and RespectBindingFeature support
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientFeatureProcessor.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientFeatureProcessor.java 2009-01-15 16:15:20 UTC (rev 9050)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientFeatureProcessor.java 2009-01-15 16:25:19 UTC (rev 9051)
@@ -24,15 +24,26 @@
import java.util.List;
import javax.xml.ws.BindingProvider;
+import javax.xml.ws.RespectBindingFeature;
+import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.handler.Handler;
import javax.xml.ws.soap.AddressingFeature;
import javax.xml.ws.soap.MTOMFeature;
import javax.xml.ws.soap.SOAPBinding;
+import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxws.binding.BindingExt;
import org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.wsdl.Extendable;
+import org.jboss.ws.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
+import org.jboss.ws.metadata.wsdl.WSDLService;
+import org.jboss.wsf.common.DOMWriter;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
/**
@@ -44,11 +55,14 @@
*/
public class ClientFeatureProcessor
{
+ private static Logger log = Logger.getLogger(ClientFeatureProcessor.class);
+
public static <T> void processFeature(WebServiceFeature feature, EndpointMetaData epMetaData, T stub)
{
epMetaData.addFeature(feature);
processAddressingFeature(feature, epMetaData, stub);
processMTOMFeature(feature, epMetaData, stub);
+ processRespectBindingFeature(feature, epMetaData, stub);
}
@SuppressWarnings("unchecked")
@@ -71,5 +85,44 @@
binding.setMTOMEnabled(feature.isEnabled());
}
}
+
+ private static <T> void processRespectBindingFeature(WebServiceFeature feature, EndpointMetaData epMetaData, T stub)
+ {
+ if (feature instanceof RespectBindingFeature && feature.isEnabled())
+ {
+ ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
+ WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
+
+ WSDLService wsdlService = wsdlDefinitions.getService(serviceMetaData.getServiceName());
+ if (wsdlService != null)
+ {
+ WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoint(epMetaData.getPortName());
+ if (wsdlEndpoint != null)
+ {
+ checkNotUnderstoodExtElements(wsdlEndpoint, epMetaData);
+ WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(wsdlEndpoint.getBinding());
+ checkNotUnderstoodExtElements(wsdlBinding, epMetaData);
+ }
+ else
+ {
+ log.warn("Cannot find port " + epMetaData.getPortName());
+ }
+ }
+ }
+ }
+
+ private static void checkNotUnderstoodExtElements(Extendable extendable, EndpointMetaData epMetaData)
+ {
+ List<WSDLExtensibilityElement> notUnderstoodList = extendable.getNotUnderstoodExtElements();
+ for (WSDLExtensibilityElement el : notUnderstoodList)
+ {
+ boolean disabledByFeature = false; //TODO
+ if (el.isRequired() && !disabledByFeature)
+ {
+ String s = DOMWriter.printNode(el.getElement(), true);
+ throw new WebServiceException("RespectBindingFeature enabled and a required not understood element was found: " + s);
+ }
+ }
+ }
}
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java 2009-01-15 16:15:20 UTC (rev 9050)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java 2009-01-15 16:25:19 UTC (rev 9051)
@@ -24,7 +24,11 @@
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.net.URL;
+import java.util.List;
+import javax.xml.ws.RespectBinding;
+import javax.xml.ws.RespectBindingFeature;
+import javax.xml.ws.WebServiceException;
import javax.xml.ws.soap.Addressing;
import javax.xml.ws.soap.AddressingFeature;
import javax.xml.ws.soap.MTOM;
@@ -42,6 +46,15 @@
import org.jboss.ws.feature.SchemaValidationFeature;
import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.wsdl.Extendable;
+import org.jboss.ws.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
+import org.jboss.ws.metadata.wsdl.WSDLService;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -89,6 +102,12 @@
JsonEncodingFeature feature = new JsonEncodingFeature(anFeature.enabled());
sepMetaData.addFeature(feature);
}
+ else if (an.annotationType() == RespectBinding.class)
+ {
+ RespectBinding anFeature = sepClass.getAnnotation(RespectBinding.class);
+ RespectBindingFeature feature = new RespectBindingFeature(anFeature.enabled());
+ sepMetaData.addFeature(feature);
+ }
}
}
@@ -96,6 +115,7 @@
{
setupAddressingFeature(sepMetaData);
setupMTOMFeature(sepMetaData);
+ setupRespectBindingFeature(sepMetaData); //this need to be processed last
}
private static void setupAddressingFeature(ServerEndpointMetaData sepMetaData)
@@ -131,6 +151,47 @@
}
}
}
+
+ private static void setupRespectBindingFeature(ServerEndpointMetaData sepMetaData)
+ {
+ RespectBindingFeature respectBindingFeature = sepMetaData.getFeature(RespectBindingFeature.class);
+ if (respectBindingFeature != null && respectBindingFeature.isEnabled())
+ {
+ log.debug("RespectBindingFeature found, looking for required not understood extensibility elements...");
+ ServiceMetaData serviceMetaData = sepMetaData.getServiceMetaData();
+ WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
+
+ WSDLService wsdlService = wsdlDefinitions.getService(serviceMetaData.getServiceName());
+ if (wsdlService != null)
+ {
+ WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoint(sepMetaData.getPortName());
+ if (wsdlEndpoint != null)
+ {
+ checkNotUnderstoodExtElements(wsdlEndpoint, sepMetaData);
+ WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(wsdlEndpoint.getBinding());
+ checkNotUnderstoodExtElements(wsdlBinding, sepMetaData);
+ }
+ else
+ {
+ log.warn("Cannot find port " + sepMetaData.getPortName());
+ }
+ }
+ }
+ }
+
+ private static void checkNotUnderstoodExtElements(Extendable extendable, ServerEndpointMetaData sepMetaData)
+ {
+ List<WSDLExtensibilityElement> notUnderstoodList = extendable.getNotUnderstoodExtElements();
+ for (WSDLExtensibilityElement el : notUnderstoodList)
+ {
+ boolean disabledByFeature = false; //TODO
+ if (el.isRequired() && !disabledByFeature)
+ {
+ String s = DOMWriter.printNode(el.getElement(), true);
+ throw new WebServiceException("RespectBindingFeature enabled and a required not understood element was found: " + s);
+ }
+ }
+ }
private void processSchemaValidation(Deployment dep, ServerEndpointMetaData sepMetaData, Class<?> sepClass)
{
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java 2009-01-15 16:15:20 UTC (rev 9050)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java 2009-01-15 16:25:19 UTC (rev 9051)
@@ -44,7 +44,7 @@
private Map features = new LinkedHashMap();
private Map properties = new LinkedHashMap();
private Map<String,List<WSDLExtensibilityElement>> extElements = new LinkedHashMap<String,List<WSDLExtensibilityElement>>();
- private List<WSDLExtensibilityElement> notUnderstoodExtElement = new LinkedList<WSDLExtensibilityElement>();
+ private List<WSDLExtensibilityElement> notUnderstoodExtElements = new LinkedList<WSDLExtensibilityElement>();
public WSDLFeature[] getFeatures()
{
@@ -115,18 +115,18 @@
return list;
}
- public List<WSDLExtensibilityElement> getNotUnderstoodExtElement()
+ public List<WSDLExtensibilityElement> getNotUnderstoodExtElements()
{
- return notUnderstoodExtElement;
+ return notUnderstoodExtElements;
}
- public void setNotUnderstoodExtElement(List<WSDLExtensibilityElement> notUnderstoodExtElement)
+ public void setNotUnderstoodExtElements(List<WSDLExtensibilityElement> notUnderstoodExtElement)
{
- this.notUnderstoodExtElement = notUnderstoodExtElement;
+ this.notUnderstoodExtElements = notUnderstoodExtElement;
}
public void addNotUnderstoodExtElement(WSDLExtensibilityElement element)
{
- notUnderstoodExtElement.add(element);
+ notUnderstoodExtElements.add(element);
}
}
Modified: stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLExtensElemTestCase.java
===================================================================
--- stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLExtensElemTestCase.java 2009-01-15 16:15:20 UTC (rev 9050)
+++ stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLExtensElemTestCase.java 2009-01-15 16:25:19 UTC (rev 9051)
@@ -60,7 +60,7 @@
assertNotNull(extPortList);
assertEquals(extPortList.size(),1);
assertPolicyRef(extPortList.get(0),"uselessPortPolicy");
- List<WSDLExtensibilityElement> portNotUnderstoodList = wsdlEndpoint.getNotUnderstoodExtElement();
+ List<WSDLExtensibilityElement> portNotUnderstoodList = wsdlEndpoint.getNotUnderstoodExtElements();
assertNotNull(portNotUnderstoodList);
assertEquals(0, portNotUnderstoodList.size());
@@ -71,7 +71,7 @@
assertEquals(extBinding.size(),2);
assertPolicyRef(extBinding.get(0),"RmPolicy");
assertPolicyRef(extBinding.get(1),"X509EndpointPolicy");
- List<WSDLExtensibilityElement> bindingNotUnderstoodList = wsdlBinding.getNotUnderstoodExtElement();
+ List<WSDLExtensibilityElement> bindingNotUnderstoodList = wsdlBinding.getNotUnderstoodExtElements();
assertNotNull(bindingNotUnderstoodList);
assertEquals(0, bindingNotUnderstoodList.size());
}
@@ -91,7 +91,7 @@
assertNotNull(extPortList);
assertEquals(extPortList.size(),1);
assertPolicyRef(extPortList.get(0),"uselessPortPolicy");
- List<WSDLExtensibilityElement> portNotUnderstoodList = wsdlEndpoint.getNotUnderstoodExtElement();
+ List<WSDLExtensibilityElement> portNotUnderstoodList = wsdlEndpoint.getNotUnderstoodExtElements();
assertNotNull(portNotUnderstoodList);
assertEquals(1, portNotUnderstoodList.size());
assertUnknownExtElem(portNotUnderstoodList.get(0), "foo1", "http://foo.org/foo1", "bar", true);
@@ -103,7 +103,7 @@
assertEquals(extBinding.size(),2);
assertPolicyRef(extBinding.get(0),"RmPolicy");
assertPolicyRef(extBinding.get(1),"X509EndpointPolicy");
- List<WSDLExtensibilityElement> bindingNotUnderstoodList = wsdlBinding.getNotUnderstoodExtElement();
+ List<WSDLExtensibilityElement> bindingNotUnderstoodList = wsdlBinding.getNotUnderstoodExtElements();
assertNotNull(bindingNotUnderstoodList);
assertEquals(2, bindingNotUnderstoodList.size());
assertUnknownExtElem(bindingNotUnderstoodList.get(0), "foo1", "http://foo.org/foo1", "bar", false);
@@ -124,5 +124,6 @@
QName qName = new QName(el.getNamespaceURI(),el.getLocalName(),el.getPrefix());
assertEquals(qName, new QName(namespaceURI, localName, prefix));
assertEquals(required, "true".equals(el.getAttributeNS(Constants.NS_WSDL11, "required")));
+ assertEquals(required, extEl.isRequired());
}
}
15 years, 11 months
JBossWS SVN: r9050 - in framework/branches/jaxws21/testsuite/test: java/org/jboss/test/ws/jaxws and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-01-15 11:15:20 -0500 (Thu, 15 Jan 2009)
New Revision: 9050
Added:
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/Endpoint.java
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/EndpointImpl.java
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/JBWS2449TestCase.java
framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/
framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/
framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/wsdl/
framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/wsdl/test.wsdl
Modified:
framework/branches/jaxws21/testsuite/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-2449] Adding testcase for RespectBindingFeature
Modified: framework/branches/jaxws21/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/branches/jaxws21/testsuite/test/ant-import/build-jars-jaxws.xml 2009-01-15 15:11:11 UTC (rev 9049)
+++ framework/branches/jaxws21/testsuite/test/ant-import/build-jars-jaxws.xml 2009-01-15 16:15:20 UTC (rev 9050)
@@ -576,6 +576,17 @@
</webinf>
</war>
+ <!-- jaxws-jbws2449 -->
+ <jar jarfile="${tests.output.dir}/test-libs/jaxws-jbws2449.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2449/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws2449/*TestCase.class"/>
+ </fileset>
+ <metainf dir="${tests.output.dir}/test-resources/jaxws/jbws2449/META-INF">
+ <include name="wsdl/*"/>
+ </metainf>
+ </jar>
+
<!-- jaxws namespace -->
<war warfile="${tests.output.dir}/test-libs/jaxws-namespace.war" webxml="${tests.output.dir}/test-resources/jaxws/namespace/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added: framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/Endpoint.java
===================================================================
--- framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/Endpoint.java (rev 0)
+++ framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/Endpoint.java 2009-01-15 16:15:20 UTC (rev 9050)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.jbws2449;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+@WebService(name = "Endpoint", targetNamespace = "http://org.jboss.ws/jbws2449")
+public interface Endpoint
+{
+ String echo(String input);
+}
Property changes on: framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/Endpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/EndpointImpl.java
===================================================================
--- framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/EndpointImpl.java (rev 0)
+++ framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/EndpointImpl.java 2009-01-15 16:15:20 UTC (rev 9050)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.jbws2449;
+
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.wsf.spi.annotation.WebContext;
+
+@Stateless
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+@WebContext(contextRoot="jaxws-jbws2449", urlPattern="/*")
+@WebService
+(
+ name = "Endpoint",
+ portName = "EndpointPort",
+ serviceName = "EndpointService",
+ targetNamespace = "http://org.jboss.ws/jbws2449",
+ wsdlLocation = "META-INF/wsdl/test.wsdl"
+)
+public class EndpointImpl implements Endpoint
+{
+ @WebMethod
+ public String echo(String input)
+ {
+ return input;
+ }
+}
Property changes on: framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/EndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/JBWS2449TestCase.java
===================================================================
--- framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/JBWS2449TestCase.java (rev 0)
+++ framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/JBWS2449TestCase.java 2009-01-15 16:15:20 UTC (rev 9050)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.jbws2449;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.RespectBindingFeature;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2449] Test RespectBindingFeature
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 15-Jan-2009
+ */
+public class JBWS2449TestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2449";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS2449TestCase.class, "jaxws-jbws2449.jar");
+ }
+
+ public void test() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jbws2449", "EndpointService");
+ Endpoint port = Service.create(wsdlURL, serviceName).getPort(Endpoint.class);
+ String retObj = port.echo("Hello");
+ assertEquals("Hello", retObj);
+ }
+
+ public void testWithRespectBinding() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jbws2449", "EndpointService");
+ try
+ {
+ Service.create(wsdlURL, serviceName).getPort(Endpoint.class, new RespectBindingFeature(true));
+ fail("Exception expected, the wsdl has an understood required extensibility element!");
+ }
+ catch (Exception e)
+ {
+ //NOOP
+ }
+ }
+
+ public void testWithRespectBinding2() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jbws2449", "EndpointService");
+ Endpoint port = Service.create(wsdlURL, serviceName).getPort(Endpoint.class, new RespectBindingFeature(false));
+ String retObj = port.echo("Hello");
+ assertEquals("Hello", retObj);
+ }
+}
Property changes on: framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2449/JBWS2449TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/wsdl/test.wsdl
===================================================================
--- framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/wsdl/test.wsdl (rev 0)
+++ framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/wsdl/test.wsdl 2009-01-15 16:15:20 UTC (rev 9050)
@@ -0,0 +1,54 @@
+<definitions name='EndpointService' targetNamespace='http://org.jboss.ws/jbws2449'
+ xmlns='http://schemas.xmlsoap.org/wsdl/'
+ xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
+ xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+ xmlns:tns='http://org.jboss.ws/jbws2449'
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'
+ xmlns:foo='http://foo.org/foo'>
+ <types>
+ <xs:schema targetNamespace='http://org.jboss.ws/jbws2449' version='1.0' xmlns:tns='http://org.jboss.ws/jbws2449' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:element name='echo' type='tns:echo'/>
+ <xs:element name='echoResponse' type='tns:echoResponse'/>
+ <xs:complexType name='echo'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='arg0' type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name='echoResponse'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='return' type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name='Endpoint_echo'>
+ <part element='tns:echo' name='echo'></part>
+ </message>
+ <message name='Endpoint_echoResponse'>
+ <part element='tns:echoResponse' name='echoResponse'></part>
+ </message>
+ <portType name='Endpoint'>
+ <operation name='echo' parameterOrder='echo'>
+ <input message='tns:Endpoint_echo'></input>
+ <output message='tns:Endpoint_echoResponse'></output>
+ </operation>
+ </portType>
+ <binding name='EndpointBinding' type='tns:Endpoint'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <foo:bar wsdl:required="true"/>
+ <operation name='echo'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='EndpointService'>
+ <port binding='tns:EndpointBinding' name='EndpointPort'>
+ <soap:address location='http://127.0.0.1:8080/jaxws-jbws2449'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: framework/branches/jaxws21/testsuite/test/resources/jaxws/jbws2449/META-INF/wsdl/test.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
15 years, 11 months
JBossWS SVN: r9049 - in stack/native/branches/jaxws21/modules: core/src/main/java/org/jboss/ws/tools/wsdl and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-01-15 10:11:11 -0500 (Thu, 15 Jan 2009)
New Revision: 9049
Added:
stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLExtensElemTestCase.java
stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachmentAndUnknownExtElem.wsdl
Modified:
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
Log:
[JBWS-2449] Parsing not understood extensibility elements
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java 2009-01-15 13:44:26 UTC (rev 9048)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java 2009-01-15 15:11:11 UTC (rev 9049)
@@ -44,6 +44,7 @@
private Map features = new LinkedHashMap();
private Map properties = new LinkedHashMap();
private Map<String,List<WSDLExtensibilityElement>> extElements = new LinkedHashMap<String,List<WSDLExtensibilityElement>>();
+ private List<WSDLExtensibilityElement> notUnderstoodExtElement = new LinkedList<WSDLExtensibilityElement>();
public WSDLFeature[] getFeatures()
{
@@ -113,4 +114,19 @@
}
return list;
}
+
+ public List<WSDLExtensibilityElement> getNotUnderstoodExtElement()
+ {
+ return notUnderstoodExtElement;
+ }
+
+ public void setNotUnderstoodExtElement(List<WSDLExtensibilityElement> notUnderstoodExtElement)
+ {
+ this.notUnderstoodExtElement = notUnderstoodExtElement;
+ }
+
+ public void addNotUnderstoodExtElement(WSDLExtensibilityElement element)
+ {
+ notUnderstoodExtElement.add(element);
+ }
}
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2009-01-15 13:44:26 UTC (rev 9048)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2009-01-15 15:11:11 UTC (rev 9049)
@@ -313,33 +313,78 @@
for (int i = 0; i < extElements.size(); i++)
{
ExtensibilityElement extElement = (ExtensibilityElement)extElements.get(i);
- processPolicyElements(extElement, dest);
- //add processing of further extensibility element types below
+ if (extElement instanceof UnknownExtensibilityElement)
+ {
+ UnknownExtensibilityElement uee = (UnknownExtensibilityElement)extElement;
+ boolean understood = false;
+ understood = understood || processPolicyElements(uee, dest);
+ understood = understood || processUseAddressing(uee, dest);
+ //add processing of further extensibility element types below
+
+ if (!understood)
+ {
+ processNotUnderstoodExtesibilityElement(uee, dest);
+ }
+ }
}
}
- private void processPolicyElements(ExtensibilityElement extElement, Extendable dest)
+ /**
+ * Process the provided extensibility element looking for policies or policy references.
+ * Returns true if the provided element is policy related, false otherwise.
+ *
+ * @param extElement
+ * @param dest
+ * @return
+ */
+ private boolean processPolicyElements(UnknownExtensibilityElement extElement, Extendable dest)
{
- if (extElement instanceof UnknownExtensibilityElement)
+ boolean result = false;
+ Element srcElement = extElement.getElement();
+ if (Constants.URI_WS_POLICY.equals(srcElement.getNamespaceURI()))
{
- Element srcElement = ((UnknownExtensibilityElement)extElement).getElement();
- if (Constants.URI_WS_POLICY.equals(srcElement.getNamespaceURI()))
+ //copy missing namespaces from the source element to our element
+ Element element = (Element)srcElement.cloneNode(true);
+ copyMissingNamespaceDeclarations(element, srcElement);
+ if (element.getLocalName().equals("Policy"))
{
- //copy missing namespaces from the source element to our element
- Element element = (Element)srcElement.cloneNode(true);
- copyMissingNamespaceDeclarations(element, srcElement);
- if (element.getLocalName().equals("Policy"))
- {
- dest.addExtensibilityElement(new WSDLExtensibilityElement(Constants.WSDL_ELEMENT_POLICY, element));
- }
- else if (element.getLocalName().equals("PolicyReference"))
- {
- dest.addExtensibilityElement(new WSDLExtensibilityElement(Constants.WSDL_ELEMENT_POLICYREFERENCE, element));
- }
-
+ WSDLExtensibilityElement el = new WSDLExtensibilityElement(Constants.WSDL_ELEMENT_POLICY, element);
+ el.setRequired("true".equalsIgnoreCase(element.getAttribute("required")));
+ dest.addExtensibilityElement(el);
+ result = true;
}
+ else if (element.getLocalName().equals("PolicyReference"))
+ {
+ WSDLExtensibilityElement el = new WSDLExtensibilityElement(Constants.WSDL_ELEMENT_POLICYREFERENCE, element);
+ el.setRequired("true".equalsIgnoreCase(element.getAttribute("required")));
+ dest.addExtensibilityElement(el);
+ result = true;
+ }
}
+ return result;
}
+
+ /**
+ * Process the provided extensibility element looking for UsingAddressing.
+ * Returns true if the provided element is UsingAddressing, false otherwise.
+ *
+ * @param extElement
+ * @param dest
+ * @return
+ */
+ private boolean processUseAddressing(UnknownExtensibilityElement extElement, Extendable dest)
+ {
+ log.warn("UsingAddressing extensibility element not supported yet.");
+ return false;
+ }
+
+ private void processNotUnderstoodExtesibilityElement(UnknownExtensibilityElement extElement, Extendable dest)
+ {
+ Element element = (Element)extElement.getElement().cloneNode(true);
+ WSDLExtensibilityElement notUnderstoodElement = new WSDLExtensibilityElement("notUnderstoodExtensibilityElement", element);
+ notUnderstoodElement.setRequired("true".equalsIgnoreCase(element.getAttributeNS(Constants.NS_WSDL11, "required")));
+ dest.addNotUnderstoodExtElement(notUnderstoodElement);
+ }
private void processTypes(Definition srcWsdl, URL wsdlLoc) throws IOException, WSDLException
{
Added: stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLExtensElemTestCase.java
===================================================================
--- stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLExtensElemTestCase.java (rev 0)
+++ stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLExtensElemTestCase.java 2009-01-15 15:11:11 UTC (rev 9049)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.common.wsdl11;
+
+import java.io.File;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.Constants;
+import org.jboss.ws.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
+import org.jboss.ws.metadata.wsdl.WSDLService;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.wsf.test.JBossWSTest;
+import org.w3c.dom.Element;
+
+/**
+ * Test the unmarshalling of wsdl-1.1 into the unified wsdl structure
+ * using known and unknown wsdl extensibility elements.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 15-Jan-2009
+ */
+public class WSDLExtensElemTestCase extends JBossWSTest
+{
+ public void testPolicyEndpointExtensibilityElements() throws Exception
+ {
+ File wsdlFile = getResourceFile("common/wsdl11/PolicyAttachment.wsdl");
+ assertTrue(wsdlFile.exists());
+
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdlDefinitions = factory.parse(wsdlFile.toURL());
+ WSDLService wsdlService = wsdlDefinitions.getServices()[0];
+ WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoints()[0];
+
+ List<WSDLExtensibilityElement> extPortList = wsdlEndpoint.getExtensibilityElements(
+ Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ assertNotNull(extPortList);
+ assertEquals(extPortList.size(),1);
+ assertPolicyRef(extPortList.get(0),"uselessPortPolicy");
+ List<WSDLExtensibilityElement> portNotUnderstoodList = wsdlEndpoint.getNotUnderstoodExtElement();
+ assertNotNull(portNotUnderstoodList);
+ assertEquals(0, portNotUnderstoodList.size());
+
+ WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(wsdlEndpoint.getBinding());
+ List<WSDLExtensibilityElement> extBinding = wsdlBinding.getExtensibilityElements(
+ Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ assertNotNull(extBinding);
+ assertEquals(extBinding.size(),2);
+ assertPolicyRef(extBinding.get(0),"RmPolicy");
+ assertPolicyRef(extBinding.get(1),"X509EndpointPolicy");
+ List<WSDLExtensibilityElement> bindingNotUnderstoodList = wsdlBinding.getNotUnderstoodExtElement();
+ assertNotNull(bindingNotUnderstoodList);
+ assertEquals(0, bindingNotUnderstoodList.size());
+ }
+
+ public void testPolicyAndUnkwnownEndpointExtensibilityElements() throws Exception
+ {
+ File wsdlFile = getResourceFile("common/wsdl11/PolicyAttachmentAndUnknownExtElem.wsdl");
+ assertTrue(wsdlFile.exists());
+
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdlDefinitions = factory.parse(wsdlFile.toURL());
+ WSDLService wsdlService = wsdlDefinitions.getServices()[0];
+ WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoints()[0];
+
+ List<WSDLExtensibilityElement> extPortList = wsdlEndpoint.getExtensibilityElements(
+ Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ assertNotNull(extPortList);
+ assertEquals(extPortList.size(),1);
+ assertPolicyRef(extPortList.get(0),"uselessPortPolicy");
+ List<WSDLExtensibilityElement> portNotUnderstoodList = wsdlEndpoint.getNotUnderstoodExtElement();
+ assertNotNull(portNotUnderstoodList);
+ assertEquals(1, portNotUnderstoodList.size());
+ assertUnknownExtElem(portNotUnderstoodList.get(0), "foo1", "http://foo.org/foo1", "bar", true);
+
+ WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(wsdlEndpoint.getBinding());
+ List<WSDLExtensibilityElement> extBinding = wsdlBinding.getExtensibilityElements(
+ Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ assertNotNull(extBinding);
+ assertEquals(extBinding.size(),2);
+ assertPolicyRef(extBinding.get(0),"RmPolicy");
+ assertPolicyRef(extBinding.get(1),"X509EndpointPolicy");
+ List<WSDLExtensibilityElement> bindingNotUnderstoodList = wsdlBinding.getNotUnderstoodExtElement();
+ assertNotNull(bindingNotUnderstoodList);
+ assertEquals(2, bindingNotUnderstoodList.size());
+ assertUnknownExtElem(bindingNotUnderstoodList.get(0), "foo1", "http://foo.org/foo1", "bar", false);
+ assertUnknownExtElem(bindingNotUnderstoodList.get(1), "foo2", "http://foo.org/foo2", "bar", false);
+ }
+
+ private static void assertPolicyRef(WSDLExtensibilityElement extEl, String policyURI)
+ {
+ Element el = extEl.getElement();
+ QName qName = new QName(el.getNamespaceURI(),el.getLocalName(),el.getPrefix());
+ assertEquals(qName,new QName("http://schemas.xmlsoap.org/ws/2004/09/policy","PolicyReference","wsp"));
+ assertEquals(el.getAttributeNode("URI").getValue(),"#"+policyURI);
+ }
+
+ private static void assertUnknownExtElem(WSDLExtensibilityElement extEl, String prefix, String namespaceURI, String localName, boolean required)
+ {
+ Element el = extEl.getElement();
+ QName qName = new QName(el.getNamespaceURI(),el.getLocalName(),el.getPrefix());
+ assertEquals(qName, new QName(namespaceURI, localName, prefix));
+ assertEquals(required, "true".equals(el.getAttributeNS(Constants.NS_WSDL11, "required")));
+ }
+}
Property changes on: stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLExtensElemTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachmentAndUnknownExtElem.wsdl
===================================================================
--- stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachmentAndUnknownExtElem.wsdl (rev 0)
+++ stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachmentAndUnknownExtElem.wsdl 2009-01-15 15:11:11 UTC (rev 9049)
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<definitions name="TestService" targetNamespace="http://org.jboss.ws/jaxrpc"
+ xmlns:tns="http://org.jboss.ws/jaxrpc"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:ns2="http://org.jboss.ws/jaxrpc/types"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:fab="http://www.fabrikam123.example.com/stock"
+ xmlns:rmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+ xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ xmlns:foo1="http://foo.org/foo1"
+ xmlns:foo2="http://foo.org/foo2"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..." >
+ <wsp:Policy wsu:Id="RmPolicy" >
+ <rmp:RMAssertion>
+ <rmp:InactivityTimeout Milliseconds="600000" />
+ <rmp:BaseRetransmissionInterval Milliseconds="3000" />
+ <rmp:ExponentialBackoff />
+ <rmp:AcknowledgementInterval Milliseconds="200" />
+ </rmp:RMAssertion>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="uselessServicePolicy" >
+ <fab:useless>nothing</fab:useless>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="uselessPortPolicy" >
+ <fab:useless>nothing again</fab:useless>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="X509EndpointPolicy" >
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <!-- Details omitted for readability -->
+ <sp:IncludeTimestamp />
+ <sp:OnlySignEntireHeadersAndBody />
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="SecureMessagePolicy" >
+ <sp:SignedParts>
+ <sp:Body />
+ </sp:SignedParts>
+ <sp:EncryptedParts>
+ <sp:Body />
+ </sp:EncryptedParts>
+ </wsp:Policy>
+ <types>
+ <schema targetNamespace="http://org.jboss.ws/jaxrpc/types" xmlns:tns="http://org.jboss.ws/jaxrpc/types" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">
+ <complexType name="echoSimpleUserType">
+ <sequence>
+ <element name="String_1" type="string" nillable="true"/>
+ <element name="SimpleUserType_2" type="tns:SimpleUserType" nillable="true"/>
+ </sequence>
+ </complexType>
+ <complexType name="SimpleUserType">
+ <sequence>
+ <element name="a" type="int"/>
+ <element name="b" type="int"/>
+ </sequence>
+ </complexType>
+ <complexType name="echoSimpleUserTypeResponse">
+ <sequence>
+ <element name="result" type="tns:SimpleUserType" nillable="true"/>
+ </sequence>
+ </complexType>
+ <complexType name="echoString">
+ <sequence>
+ <element name="String_1" type="string" nillable="true"/>
+ <element name="String_2" type="string" nillable="true"/>
+ </sequence>
+ </complexType>
+ <complexType name="echoStringResponse">
+ <sequence>
+ <element name="result" type="string" nillable="true"/>
+ </sequence>
+ </complexType>
+ <element name="echoSimpleUserType" type="tns:echoSimpleUserType"/>
+ <element name="echoSimpleUserTypeResponse" type="tns:echoSimpleUserTypeResponse"/>
+ <element name="echoString" type="tns:echoString"/>
+ <element name="echoStringResponse" type="tns:echoStringResponse"/>
+ </schema>
+ </types>
+ <message name="JaxRpcTestService_echoSimpleUserType">
+ <part name="parameters" element="ns2:echoSimpleUserType"/>
+ </message>
+ <message name="JaxRpcTestService_echoSimpleUserTypeResponse">
+ <part name="result" element="ns2:echoSimpleUserTypeResponse"/>
+ </message>
+ <message name="JaxRpcTestService_echoString">
+ <part name="parameters" element="ns2:echoString"/>
+ </message>
+ <message name="JaxRpcTestService_echoStringResponse">
+ <part name="result" element="ns2:echoStringResponse"/>
+ </message>
+ <portType name="JaxRpcTestService" wsp:PolicyURIs="#RmPolicy">
+ <operation name="echoSimpleUserType">
+ <input message="tns:JaxRpcTestService_echoSimpleUserType"/>
+ <output message="tns:JaxRpcTestService_echoSimpleUserTypeResponse"/>
+ </operation>
+ <operation name="echoString">
+ <input message="tns:JaxRpcTestService_echoString"/>
+ <output message="tns:JaxRpcTestService_echoStringResponse"/>
+ </operation>
+ </portType>
+ <binding name="JaxRpcTestServiceBinding" type="tns:JaxRpcTestService">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsp:PolicyReference URI="#RmPolicy" wsdl:required="true" />
+ <wsp:PolicyReference URI="#X509EndpointPolicy" wsdl:required="true" />
+ <foo1:bar wsdl:required="false"/>
+ <foo2:bar/>
+ <operation name="echoSimpleUserType">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoString">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="TestService">
+ <wsp:PolicyReference URI="#uselessServicePolicy" wsdl:required="true" />
+ <port name="JaxRpcTestServicePort" binding="tns:JaxRpcTestServiceBinding">
+ <wsp:PolicyReference URI="#uselessPortPolicy" wsdl:required="true" />
+ <foo1:bar wsdl:required="true"/>
+ <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
+ </port>
+ </service>
+</definitions>
Property changes on: stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/resources/common/wsdl11/PolicyAttachmentAndUnknownExtElem.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
15 years, 11 months
JBossWS SVN: r9048 - in framework: tags and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-01-15 08:44:26 -0500 (Thu, 15 Jan 2009)
New Revision: 9048
Added:
framework/tags/jbossws-framework-2.0.1.GA_CP03/
Removed:
framework/branches/jbossws-framework-2.0.1.GA_CP03/
Log:
[JBPAPP-1558] Tag jbossws-framework-2.0.1.GA_CP03
Copied: framework/tags/jbossws-framework-2.0.1.GA_CP03 (from rev 9047, framework/branches/jbossws-framework-2.0.1.GA_CP03)
15 years, 11 months
JBossWS SVN: r9047 - framework/branches/jbossws-framework-2.0.1.GA_CP03.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-01-15 08:43:43 -0500 (Thu, 15 Jan 2009)
New Revision: 9047
Modified:
framework/branches/jbossws-framework-2.0.1.GA_CP03/version.properties
Log:
[JBPAPP-1558] Set version to jbossws-framework-2.0.1.GA_CP03
Modified: framework/branches/jbossws-framework-2.0.1.GA_CP03/version.properties
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP03/version.properties 2009-01-15 13:42:10 UTC (rev 9046)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP03/version.properties 2009-01-15 13:43:43 UTC (rev 9047)
@@ -5,8 +5,8 @@
specification.vendor=JBoss (http://www.jboss.org)
specification.version=jbossws-2.0
-version.id=2.0.1.GA_CP-SNAPSHOT
-repository.id=2.0.1.GA_CP-SNAPSHOT
+version.id=2.0.1.GA_CP03
+repository.id=2.0.1.GA_CP03
implementation.title=JBoss Web Services - Framework
implementation.url=http://www.jboss.org/products/jbossws
15 years, 11 months
JBossWS SVN: r9046 - framework/branches.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-01-15 08:42:10 -0500 (Thu, 15 Jan 2009)
New Revision: 9046
Added:
framework/branches/jbossws-framework-2.0.1.GA_CP03/
Log:
[JBPAPP-1558] Branch ready to tag jbossws-framework-2.0.1.GA_CP03
Copied: framework/branches/jbossws-framework-2.0.1.GA_CP03 (from rev 9045, framework/branches/jbossws-framework-2.0.1.GA_CP)
15 years, 11 months