JBossWS SVN: r15172 - in stack/cxf/trunk/modules/testsuite: cxf-tests/scripts and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-10-28 07:10:44 -0400 (Fri, 28 Oct 2011)
New Revision: 15172
Removed:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/jboss.xml
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/EJBServiceImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationEJBTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/wsdl/SecurityService.wsdl
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
Use @SecurityDomain instead of security domain declaration in jboss.xml to make the test pass against AS 7.1 too (EJB3 DD support still to be implemented)
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2011-10-27 09:18:37 UTC (rev 15171)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2011-10-28 11:10:44 UTC (rev 15172)
@@ -386,7 +386,6 @@
</fileset>
<metainf dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF">
<include name="wsdl/*"/>
- <include name="jboss.xml"/>
<include name="jaxws-endpoint-config.xml"/>
</metainf>
<manifest>
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/EJBServiceImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/EJBServiceImpl.java 2011-10-27 09:18:37 UTC (rev 15171)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/EJBServiceImpl.java 2011-10-28 11:10:44 UTC (rev 15172)
@@ -28,6 +28,7 @@
import org.apache.cxf.interceptor.InInterceptors;
import org.jboss.logging.Logger;
+import org.jboss.ejb3.annotation.SecurityDomain;
import org.jboss.ws.api.annotation.EndpointConfig;
@@ -40,6 +41,7 @@
targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.ServiceIface"
)
+@SecurityDomain("JBossWS")
@EndpointConfig(configFile = "META-INF/jaxws-endpoint-config.xml", configName = "Custom WS-Security Endpoint")
//be sure to have dependency on org.apache.cxf module when on AS7, otherwise Apache CXF annotations are ignored
@InInterceptors(interceptors = {"org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingPolicyInterceptor"})
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationEJBTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationEJBTestCase.java 2011-10-27 09:18:37 UTC (rev 15171)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationEJBTestCase.java 2011-10-28 11:10:44 UTC (rev 15172)
@@ -91,7 +91,8 @@
catch (Exception e)
{
assertNotNull(e.getMessage());
- assertTrue(e.getMessage().toLowerCase().contains("unauthorized"));
+ String msg = e.getMessage().toLowerCase();
+ assertTrue(msg.contains("unauthorized") || msg.contains("not allowed"));
}
}
Deleted: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/jboss.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/jboss.xml 2011-10-27 09:18:37 UTC (rev 15171)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/jboss.xml 2011-10-28 11:10:44 UTC (rev 15172)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_2.dtd">
-
-<jboss>
- <security-domain>java:/jaas/JBossWS</security-domain>
-</jboss>
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/wsdl/SecurityService.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/wsdl/SecurityService.wsdl 2011-10-27 09:18:37 UTC (rev 15171)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/wsdl/SecurityService.wsdl 2011-10-28 11:10:44 UTC (rev 15172)
@@ -58,7 +58,7 @@
</binding>
<service name="SecurityService">
<port name="SecurityServicePort" binding="tns:SecurityServicePortBinding">
- <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-username-jaas"/>
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-username-jaas-ejb"/>
</port>
</service>
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2011-10-27 09:18:37 UTC (rev 15171)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2011-10-28 11:10:44 UTC (rev 15172)
@@ -1330,9 +1330,6 @@
<exclude>org/jboss/test/ws/jaxws/jbws1581/**</exclude>
<exclude>org/jboss/test/ws/jaxws/cxf/bus/*EJB3*</exclude>
- <!-- TODO: investigate -->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationEJBTestCase*</exclude>
-
<!-- # [JBWS-3249] Restore UsernameAuthorizationCustomFileTestCase on AS7 -->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationCustomFileTestCase*</exclude>
13 years, 4 months
JBossWS SVN: r15171 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf/configuration and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-10-27 05:18:37 -0400 (Thu, 27 Oct 2011)
New Revision: 15171
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
Log:
[JBWS-3280] Porting to JBossWSSpringBusFactory the Apache CXF SpringBusFactory logic for avoiding creating a Spring Bus when no spring descriptor is found (basically for client side usage)
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2011-10-27 07:29:53 UTC (rev 15170)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2011-10-27 09:18:37 UTC (rev 15171)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, 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.
*
@@ -34,6 +34,7 @@
import org.apache.cxf.configuration.Configurer;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
+import org.springframework.core.io.Resource;
/**
* A JBossWS version of @see{org.apache.cxf.bus.spring.SpringBusFactory} that
@@ -46,6 +47,8 @@
public class JBossWSSpringBusFactory extends SpringBusFactory
{
private static final Logger LOG = LogUtils.getL7dLogger(JBossWSSpringBusFactory.class);
+
+ private boolean customContextProvided = false;
public JBossWSSpringBusFactory()
{
@@ -55,18 +58,27 @@
public JBossWSSpringBusFactory(ApplicationContext context)
{
super(context);
+ this.customContextProvided = (context != null);
}
/**
- * We override the Apache CXF method to skip the checks on cxf.xml conf file as that would prevent
- * creating a Spring version of the bus when the jbossws-cxf.xml is available; generally speaking
- * the JBossWS-CXF integration requires a Spring bus to be created by Spring bus factories.
+ * This overrides the Apache CXF method to delegate to
+ * @see{org.jboss.wsf.stack.cxf.client.configuration.JBossWSNonSpringBusFactory}
+ * when there's no need for a Spring bus.
*/
@Override
public Bus createBus(String cfgFiles[], boolean includeDefaults)
{
try
{
+ String userCfgFile = System.getProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME);
+ String sysCfgFileUrl = System.getProperty(Configurer.USER_CFG_FILE_PROPERTY_URL);
+ Resource r = BusApplicationContext.findResource(Configurer.DEFAULT_USER_CFG_FILE);
+ if (!customContextProvided && userCfgFile == null && cfgFiles == null && sysCfgFileUrl == null
+ && (r == null || !r.exists()) && includeDefaults)
+ {
+ return new JBossWSNonSpringBusFactory().createBus();
+ }
return finishCreatingBus(createApplicationContext(cfgFiles, includeDefaults));
}
catch (BeansException ex)
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2011-10-27 07:29:53 UTC (rev 15170)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2011-10-27 09:18:37 UTC (rev 15171)
@@ -86,7 +86,10 @@
*/
protected void createBus(URL location)
{
- bus = new JBossWSSpringBusFactory().createBus();
+ //use createBus(URL[] urls) method instead of createBus() to bypass
+ //the cxf/jbossws-cxf check on actual need for spring bus (we know
+ //it's required here as we have the jbossws-cxf.xml descriptor)
+ bus = new JBossWSSpringBusFactory().createBus((URL[])null);
ctx = bus.getExtension(BusApplicationContext.class);
//Load additional configurations from cxf-servlet.xml
if (location != null)
13 years, 4 months
JBossWS SVN: r15170 - in thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441: tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-10-27 03:29:53 -0400 (Thu, 27 Oct 2011)
New Revision: 15170
Added:
thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf2193/
thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf2193/hello_world_extension_wrapped.wsdl
Modified:
thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
Log:
[JBPAPP-7441]:Allow for WRAPPED style code generation for elements with xsd:extension
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java 2011-10-27 06:17:57 UTC (rev 15169)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java 2011-10-27 07:29:53 UTC (rev 15170)
@@ -83,6 +83,7 @@
import org.apache.ws.commons.schema.XmlSchemaObject;
import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
import org.apache.ws.commons.schema.XmlSchemaSequence;
+import org.apache.ws.commons.schema.XmlSchemaType;
import static org.apache.cxf.helpers.CastUtils.cast;
@@ -740,56 +741,76 @@
MessageInfo wrapper, boolean allowRefs) {
if (type.getParticle() instanceof XmlSchemaSequence) {
XmlSchemaSequence seq = (XmlSchemaSequence)type.getParticle();
- XmlSchemaObjectCollection items = seq.getItems();
- boolean ret = true;
- for (int x = 0; x < items.getCount(); x++) {
- XmlSchemaObject o = items.getItem(x);
- if (!(o instanceof XmlSchemaElement)) {
+ return buildMessageParts(seq, namespaceURI, wrapper, allowRefs);
+ } else if (type.getParticle() == null) {
+ if (type.getContentModel() == null) {
+ return true;
+ }
+ if (type.getContentModel().getContent() instanceof XmlSchemaComplexContentExtension) {
+ XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension)type
+ .getContentModel().getContent();
+ QName baseTypeName = extension.getBaseTypeName();
+ ServiceInfo serviceInfo = wrapper.getOperation().getInterface().getService();
+ XmlSchemaType schemaType = serviceInfo.getXmlSchemaCollection().getTypeByQName(baseTypeName);
+ if (!(schemaType instanceof XmlSchemaComplexType)
+ || !isWrappableSequence((XmlSchemaComplexType)schemaType, namespaceURI, wrapper,
+ allowRefs)) {
return false;
}
- XmlSchemaElement el = (XmlSchemaElement)o;
- if (el.getSchemaTypeName() != null) {
- MessagePartInfo mpi = wrapper.addMessagePart(new QName(namespaceURI, el.getName()));
- mpi.setTypeQName(el.getSchemaTypeName());
- mpi.setConcreteName(el.getQName());
- mpi.setElement(true);
- mpi.setElementQName(el.getQName());
- mpi.setXmlSchema(el);
- } else if (el.getRefName() != null) {
- MessagePartInfo mpi = wrapper.addMessagePart(el.getRefName());
- mpi.setTypeQName(el.getRefName());
- mpi.setElementQName(el.getRefName());
- mpi.setElement(true);
- mpi.setXmlSchema(el);
- mpi.setProperty("isRefElement", true);
- // element reference is not permitted for wrapper element
- if (!allowRefs) {
- ret = false;
- }
- } else {
- // anonymous type
- MessagePartInfo mpi = wrapper.addMessagePart(new QName(namespaceURI, el.getName()));
- mpi.setConcreteName(el.getQName());
- mpi.setElementQName(mpi.getName());
- mpi.setElement(true);
- mpi.setXmlSchema(el);
+ if (extension.getParticle() instanceof XmlSchemaSequence) {
+ XmlSchemaSequence seq = (XmlSchemaSequence)extension.getParticle();
+ return buildMessageParts(seq, namespaceURI, wrapper, allowRefs);
}
- }
- return ret;
- } else if (type.getParticle() == null) {
- if (type.getContentModel() == null) {
- return true;
}
- if (type.getContentModel().getContent() instanceof XmlSchemaComplexContentExtension) {
- return false;
- }
return true;
}
return false;
}
+ private static boolean buildMessageParts(XmlSchemaSequence seq, String namespaceURI, MessageInfo wrapper,
+ boolean allowRefs) {
+ XmlSchemaObjectCollection items = seq.getItems();
+ boolean ret = true;
+
+ for (int i = 0; i < items.getCount(); i++) {
+ XmlSchemaObject seqItem = items.getItem(i);
+ if (!(seqItem instanceof XmlSchemaElement)) {
+ return false;
+ }
+ XmlSchemaElement el = (XmlSchemaElement)seqItem;
+
+ if (el.getSchemaTypeName() != null) {
+ MessagePartInfo mpi = wrapper.addMessagePart(new QName(namespaceURI, el.getName()));
+ mpi.setTypeQName(el.getSchemaTypeName());
+ mpi.setElement(true);
+ mpi.setElementQName(el.getQName());
+ mpi.setConcreteName(el.getQName());
+ mpi.setXmlSchema(el);
+ } else if (el.getRefName() != null) {
+ MessagePartInfo mpi = wrapper.addMessagePart(el.getRefName());
+ mpi.setTypeQName(el.getRefName());
+ mpi.setElementQName(el.getRefName());
+ mpi.setElement(true);
+ mpi.setXmlSchema(el);
+ mpi.setProperty("isRefElement", true);
+ // element reference is not permitted for wrapper element
+ if (!allowRefs) {
+ ret = false;
+ }
+ } else {
+ // anonymous type
+ MessagePartInfo mpi = wrapper.addMessagePart(new QName(namespaceURI, el.getName()));
+ mpi.setElementQName(mpi.getName());
+ mpi.setConcreteName(el.getQName());
+ mpi.setElement(true);
+ mpi.setXmlSchema(el);
+ }
+ }
+ return ret;
+ }
+
private void buildMessage(AbstractMessageContainer minfo, Message msg) {
SchemaCollection schemas = minfo.getOperation().getInterface().getService()
.getXmlSchemaCollection();
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java 2011-10-27 06:17:57 UTC (rev 15169)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java 2011-10-27 07:29:53 UTC (rev 15170)
@@ -49,11 +49,14 @@
import org.apache.cxf.tools.util.URIParserUtil;
import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaComplexContentExtension;
import org.apache.ws.commons.schema.XmlSchemaComplexType;
+import org.apache.ws.commons.schema.XmlSchemaContent;
import org.apache.ws.commons.schema.XmlSchemaElement;
import org.apache.ws.commons.schema.XmlSchemaForm;
import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
import org.apache.ws.commons.schema.XmlSchemaSequence;
+import org.apache.ws.commons.schema.XmlSchemaType;
public final class ProcessorUtil {
private static final String KEYWORDS_PREFIX = "_";
@@ -373,25 +376,53 @@
public static List<WrapperElement> getWrappedElement(ToolContext context, QName partElement) {
List<WrapperElement> qnames = new ArrayList<WrapperElement>();
-
+
ServiceInfo serviceInfo = (ServiceInfo)context.get(ServiceInfo.class);
SchemaCollection schema = serviceInfo.getXmlSchemaCollection();
-
+
XmlSchemaElement elementByName = schema.getElementByQName(partElement);
-
+
XmlSchemaComplexType type = (XmlSchemaComplexType)elementByName.getSchemaType();
XmlSchemaSequence seq = (XmlSchemaSequence)type.getParticle();
-
+
+ qnames.addAll(createWrappedElements(seq));
+
+ // If it's extension
+ if (seq == null && type.getContentModel() != null) {
+
+ XmlSchemaContent xmlSchemaConent = type.getContentModel().getContent();
+ if (xmlSchemaConent instanceof XmlSchemaComplexContentExtension) {
+ XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension)type
+ .getContentModel().getContent();
+ QName baseTypeName = extension.getBaseTypeName();
+ XmlSchemaType schemaType = schema.getTypeByQName(baseTypeName);
+ if (schemaType instanceof XmlSchemaComplexType) {
+ XmlSchemaComplexType complexType = (XmlSchemaComplexType)schemaType;
+ if (complexType.getParticle() instanceof XmlSchemaSequence) {
+ seq = (XmlSchemaSequence)complexType.getParticle();
+ qnames.addAll(createWrappedElements(seq));
+ }
+ }
+
+ if (extension.getParticle() instanceof XmlSchemaSequence) {
+ XmlSchemaSequence xmlSchemaSeq = (XmlSchemaSequence)extension.getParticle();
+ qnames.addAll(createWrappedElements(xmlSchemaSeq));
+ }
+ }
+
+ }
+ return qnames;
+ }
+
+ private static List<WrapperElement> createWrappedElements(XmlSchemaSequence seq) {
+
+ List<WrapperElement> qnames = new ArrayList<WrapperElement>();
if (seq != null) {
-
XmlSchemaObjectCollection items = seq.getItems();
-
Iterator ite = items.getIterator();
-
while (ite.hasNext()) {
XmlSchemaElement subElement = (XmlSchemaElement)ite.next();
-
if (subElement.getQName() != null) {
qnames.add(new WrapperElement(subElement.getQName(), subElement.getSchemaTypeName()));
} else {
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java 2011-10-27 06:17:57 UTC (rev 15169)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java 2011-10-27 07:29:53 UTC (rev 15170)
@@ -1350,5 +1350,26 @@
fault = classLoader.loadClass("org.apache.cxf.w2j.hello_world_soap_http.BadRecordLitFault");
assertEquals(fault.getName().hashCode(), ObjectStreamClass.lookup(fault).getSerialVersionUID());
}
+
+
+ @Test
+ public void testExtensionWrapper() throws Exception {
+ env.put(ToolConstants.CFG_WSDLURL,
+ getLocation("/wsdl2java_wsdl/cxf2193/hello_world_extension_wrapped.wsdl"));
+ processor.setContext(env);
+ processor.execute();
+ File infFile = new File(output, "org/apache/cxf/w2j/extension_wrapped/Greeter.java");
+ assertTrue(infFile.exists());
+
+ Class<?> interfaceClass = classLoader.loadClass("org.apache.cxf.w2j.extension_wrapped.Greeter");
+
+ Method method = interfaceClass.getMethod("greetMe", new Class[] {
+ Holder.class, Holder.class, Holder.class, Holder.class, Holder.class
+ });
+ assertTrue("greetMe operation is NOT generated correctly as excepted", method != null);
+ RequestWrapper reqWrapper = method.getAnnotation(RequestWrapper.class);
+ assertNotNull("@RequestWrapper is expected", reqWrapper);
+ }
+
}
Added: thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf2193/hello_world_extension_wrapped.wsdl
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf2193/hello_world_extension_wrapped.wsdl (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf2193/hello_world_extension_wrapped.wsdl 2011-10-27 07:29:53 UTC (rev 15170)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://cxf.apache.org/w2j/extension_wrapped"
+ xmlns:x1="http://cxf.apache.org/w2j/extension_wrapped/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://cxf.apache.org/w2j/extension_wrapped" name="HelloWorld">
+ <wsdl:types>
+ <schema targetNamespace="http://cxf.apache.org/w2j/extension_wrapped/types"
+ xmlns="http://www.w3.org/2001/XMLSchema" xmlns:x1="http://cxf.apache.org/w2j/extension_wrapped/types"
+ elementFormDefault="qualified">
+ <element name="greetMe">
+ <complexType>
+ <sequence>
+ <element name="content" type="xsd:base64Binary" minOccurs="0" />
+ <element name="id" type="xsd:string" minOccurs="0" />
+ <element name="name" type="xsd:string" minOccurs="0" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="greetMeResponse" type="x1:ComplexContext" />
+
+ <complexType name="ComplexContext">
+ <complexContent>
+ <extension base="x1:ComplexContextType">
+ <sequence>
+ <element name="extraElement" type="xsd:string" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="ComplexContextType">
+ <sequence>
+ <element name="content" type="xsd:base64Binary" minOccurs="0" />
+ <element name="id" type="xsd:string" minOccurs="0" />
+ <element name="name" type="xsd:string" minOccurs="0" />
+ <element name="testlist" type="xsd:string" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ </complexType>
+
+
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="greetMeRequest">
+ <wsdl:part name="in" element="x1:greetMe" />
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part name="out" element="x1:greetMeResponse" />
+ </wsdl:message>
+
+ <wsdl:portType name="Greeter">
+ >
+ <wsdl:operation name="greetMe">
+ <wsdl:input name="greetMeRequest" message="tns:greetMeRequest" />
+ <wsdl:output name="greetMeResponse" message="tns:greetMeResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="greetMe">
+ <soap:operation style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SOAPService">
+ <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9000/SoapContext/SoapPort" />
+ <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://cxf.apache.org/w2j/extension_wrapped"
+ xmlns:x1="http://cxf.apache.org/w2j/extension_wrapped/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://cxf.apache.org/w2j/extension_wrapped" name="HelloWorld">
+ <wsdl:types>
+ <schema targetNamespace="http://cxf.apache.org/w2j/extension_wrapped/types"
+ xmlns="http://www.w3.org/2001/XMLSchema" xmlns:x1="http://cxf.apache.org/w2j/extension_wrapped/types"
+ elementFormDefault="qualified">
+ <element name="greetMe">
+ <complexType>
+ <sequence>
+ <element name="content" type="xsd:base64Binary" minOccurs="0" />
+ <element name="id" type="xsd:string" minOccurs="0" />
+ <element name="name" type="xsd:string" minOccurs="0" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="greetMeResponse" type="x1:ComplexContext" />
+
+ <complexType name="ComplexContext">
+ <complexContent>
+ <extension base="x1:ComplexContextType">
+ <sequence>
+ <element name="extraElement" type="xsd:string" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="ComplexContextType">
+ <sequence>
+ <element name="content" type="xsd:base64Binary" minOccurs="0" />
+ <element name="id" type="xsd:string" minOccurs="0" />
+ <element name="name" type="xsd:string" minOccurs="0" />
+ <element name="testlist" type="xsd:string" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ </complexType>
+
+
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="greetMeRequest">
+ <wsdl:part name="in" element="x1:greetMe" />
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part name="out" element="x1:greetMeResponse" />
+ </wsdl:message>
+
+ <wsdl:portType name="Greeter">
+ >
+ <wsdl:operation name="greetMe">
+ <wsdl:input name="greetMeRequest" message="tns:greetMeRequest" />
+ <wsdl:output name="greetMeResponse" message="tns:greetMeResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="greetMe">
+ <soap:operation style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SOAPService">
+ <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9000/SoapContext/SoapPort" />
+ <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+
13 years, 4 months
JBossWS SVN: r15169 - thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-10-27 02:17:57 -0400 (Thu, 27 Oct 2011)
New Revision: 15169
Modified:
thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
Log:
Port the CXF-3296 fix to resolve the build failure
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java 2011-10-26 16:54:40 UTC (rev 15168)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java 2011-10-27 06:17:57 UTC (rev 15169)
@@ -90,11 +90,13 @@
try {
wsdlURL = URIParserUtil.getAbsoluteURI((String)env.get(ToolConstants.CFG_WSDLURL));
- wsdlNode = getTargetNode(this.wsdlURL);
-
- if (wsdlNode == null && env.get(ToolConstants.CFG_CATALOG) != null) {
+ if (env.get(ToolConstants.CFG_CATALOG) != null) {
wsdlNode = resolveNodeByCatalog(wsdlURL);
}
+
+ if (wsdlNode == null) {
+ wsdlNode = getTargetNode(this.wsdlURL);
+ }
if (wsdlNode == null) {
throw new ToolException(new Message("MISSING_WSDL", LOG, wsdlURL));
@@ -132,6 +134,9 @@
}
public Element getTargetNode(String uri) {
+ if (uri == null) {
+ return null;
+ }
if (uri.equals(wsdlURL) && wsdlNode != null) {
return wsdlNode;
}
13 years, 4 months
JBossWS SVN: r15168 - stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-10-26 12:54:40 -0400 (Wed, 26 Oct 2011)
New Revision: 15168
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
Log:
[JBWS-3280] Move logs to debug level
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2011-10-26 16:52:49 UTC (rev 15167)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2011-10-26 16:54:40 UTC (rev 15168)
@@ -72,7 +72,7 @@
{
DDBeans dd = generateMetadataFromDeployment(dep);
cxfURL = dd.createFileURL();
- log.info("JBossWS-CXF configuration generated: " + cxfURL);
+ log.debug("JBossWS-CXF configuration generated: " + cxfURL);
}
}
if (cxfURL == null)
@@ -81,7 +81,7 @@
}
else
{
- log.info("Actual configuration from file: " + cxfURL);
+ log.debug("Actual configuration from file: " + cxfURL);
putCXFConfigToDeployment(dep, cxfURL);
}
}
@@ -130,7 +130,7 @@
// get resource URL
ArchiveDeployment archDep = (ArchiveDeployment)dep;
cxfURL = archDep.getResourceResolver().resolve(metadir + "/" + Constants.JBOSSWS_CXF_SPRING_DD);
- log.info("JBossWS-CXF configuration found: " + cxfURL);
+ log.debug("JBossWS-CXF configuration found: " + cxfURL);
}
catch (IOException ignore)
{
13 years, 4 months
JBossWS SVN: r15167 - in stack/cxf/trunk/modules: client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-10-26 12:52:49 -0400 (Wed, 26 Oct 2011)
New Revision: 15167
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/SecurityActions.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/SecurityActions.java
Log:
[JBWS-3280] Deploy using Spring bus only when Spring is available AND there's a jbossws-cxf.xml descriptor in the deployment
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java 2011-10-26 13:59:40 UTC (rev 15166)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java 2011-10-26 16:52:49 UTC (rev 15167)
@@ -31,4 +31,5 @@
public class Constants
{
public static final String DEPLOYMENT_BUS = "deployment-bus";
+ public static final String JBOSSWS_CXF_SPRING_DD = "jbossws-cxf.xml";
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/SecurityActions.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/SecurityActions.java 2011-10-26 13:59:40 UTC (rev 15166)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/SecurityActions.java 2011-10-26 16:52:49 UTC (rev 15167)
@@ -78,5 +78,24 @@
});
}
}
+
+ /**
+ * Return the current value of the specified system property
+ *
+ * @param name
+ * @param defaultValue
+ * @return
+ */
+ static String getSystemProperty(final String name, final String defaultValue)
+ {
+ PrivilegedAction<String> action = new PrivilegedAction<String>()
+ {
+ public String run()
+ {
+ return System.getProperty(name, defaultValue);
+ }
+ };
+ return AccessController.doPrivileged(action);
+ }
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2011-10-26 13:59:40 UTC (rev 15166)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2011-10-26 16:52:49 UTC (rev 15167)
@@ -94,7 +94,8 @@
for (DDEndpoint dde : metadata.getEndpoints())
{
EndpointImpl endpoint = new EndpointImpl(bus, newInstance(dde.getImplementor()));
- endpoint.setInvoker((Invoker) newInstance(dde.getInvoker()));
+ if (dde.getInvoker() != null)
+ endpoint.setInvoker((Invoker) newInstance(dde.getInvoker()));
endpoint.setAddress(dde.getAddress());
endpoint.setEndpointName(dde.getPortName());
endpoint.setServiceName(dde.getServiceName());
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2011-10-26 13:59:40 UTC (rev 15166)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2011-10-26 16:52:49 UTC (rev 15167)
@@ -76,7 +76,7 @@
//parent to make sure user provided libs in the deployment do no mess up the WS endpoint's deploy if they duplicates
//libraries already available on the application server modules.
SecurityActions.setContextClassLoader(new DelegateClassLoader(dep.getRuntimeClassLoader(), origClassLoader));
- if (jbosswsCxfXml != null) // Spring available
+ if (jbosswsCxfXml != null) // Spring available and jbossws-cxf.xml provided
{
URL cxfServletURL = null;
try
@@ -100,7 +100,7 @@
}
}
else
- //Spring not available
+ //Spring not available or jbossws-cxf.xml not provided
{
DDBeans metadata = dep.getAttachment(DDBeans.class);
holder = new NonSpringBusHolder(metadata);
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2011-10-26 13:59:40 UTC (rev 15166)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2011-10-26 16:52:49 UTC (rev 15167)
@@ -38,6 +38,7 @@
import org.jboss.ws.common.integration.WSConstants;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.stack.cxf.client.Constants;
import org.jboss.wsf.stack.cxf.client.util.SpringUtils;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
import org.jboss.wsf.stack.cxf.metadata.MetadataBuilder;
@@ -51,6 +52,8 @@
*/
public class DescriptorDeploymentAspect extends AbstractDeploymentAspect
{
+ private static final boolean PREFER_SPRING_DESCRIPTOR_GENERATION = Boolean.getBoolean("org.jboss.ws.cxf.prefer_spring_descriptor_generation");
+
private static final ResourceBundle bundle = BundleUtils.getBundle(DescriptorDeploymentAspect.class);
// provide logging
private static final Logger log = Logger.getLogger(DescriptorDeploymentAspect.class);
@@ -58,21 +61,29 @@
@Override
public void start(Deployment dep)
{
+ URL cxfURL = null;
if (SpringUtils.isSpringAvailable())
{
- URL cxfURL = getCXFConfigFromDeployment(dep);
- if (cxfURL == null)
+ //only try reading jbossws-cxf.xml if Spring available...
+ cxfURL = getCXFConfigFromDeployment(dep);
+ //... but do not generate it if it's not provided
+ //or unless it's explicitly required to be generated
+ if (cxfURL == null && PREFER_SPRING_DESCRIPTOR_GENERATION)
{
- cxfURL = generateCXFConfigFromDeployment(dep);
+ DDBeans dd = generateMetadataFromDeployment(dep);
+ cxfURL = dd.createFileURL();
+ log.info("JBossWS-CXF configuration generated: " + cxfURL);
}
- putCXFConfigToDeployment(dep, cxfURL);
-
}
- else
+ if (cxfURL == null)
{
- log.debug("Spring not available, skipping check for user provided jbossws-cxf.xml / cxf.xml configuration files.");
generateMetadataFromDeployment(dep);
}
+ else
+ {
+ log.info("Actual configuration from file: " + cxfURL);
+ putCXFConfigToDeployment(dep, cxfURL);
+ }
}
@Override
@@ -118,7 +129,7 @@
{
// get resource URL
ArchiveDeployment archDep = (ArchiveDeployment)dep;
- cxfURL = archDep.getResourceResolver().resolve(metadir + "/jbossws-cxf.xml");
+ cxfURL = archDep.getResourceResolver().resolve(metadir + "/" + Constants.JBOSSWS_CXF_SPRING_DD);
log.info("JBossWS-CXF configuration found: " + cxfURL);
}
catch (IOException ignore)
@@ -130,22 +141,8 @@
}
/**
- * Generated CXF descriptor from deployment
- * @param dep deployment
- * @return CXF descriptor URL
- */
- private URL generateCXFConfigFromDeployment(Deployment dep)
- {
- // Generate the jbossws-cxf.xml descriptor
- DDBeans dd = generateMetadataFromDeployment(dep);
- URL cxfURL = dd.createFileURL();
- log.info("JBossWS-CXF configuration generated: " + cxfURL);
-
- return cxfURL;
- }
-
- /**
* Generates the jbossws-cxf metadata from the deployment
+ * and attaches it the deployment
* @param dep
* @return
*/
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/SecurityActions.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/SecurityActions.java 2011-10-26 13:59:40 UTC (rev 15166)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/SecurityActions.java 2011-10-26 16:52:49 UTC (rev 15167)
@@ -79,4 +79,22 @@
}
}
+ /**
+ * Return the current value of the specified system property
+ *
+ * @param name
+ * @param defaultValue
+ * @return
+ */
+ static String getSystemProperty(final String name, final String defaultValue)
+ {
+ PrivilegedAction<String> action = new PrivilegedAction<String>()
+ {
+ public String run()
+ {
+ return System.getProperty(name, defaultValue);
+ }
+ };
+ return AccessController.doPrivileged(action);
+ }
}
13 years, 4 months
JBossWS SVN: r15166 - thirdparty/cxf/branches.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-10-26 09:59:40 -0400 (Wed, 26 Oct 2011)
New Revision: 15166
Added:
thirdparty/cxf/branches/cxf-2.2.12-patch-01_JBPAPP-7441/
Log:
Create branch for JBPAPP-7441
13 years, 4 months
JBossWS SVN: r15165 - stack/native/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-10-26 09:36:31 -0400 (Wed, 26 Oct 2011)
New Revision: 15165
Modified:
stack/native/trunk/modules/testsuite/pom.xml
Log:
updating excludes
Modified: stack/native/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/native/trunk/modules/testsuite/pom.xml 2011-10-26 13:35:40 UTC (rev 15164)
+++ stack/native/trunk/modules/testsuite/pom.xml 2011-10-26 13:36:31 UTC (rev 15165)
@@ -1023,9 +1023,6 @@
<!-- AS7 integration exclusions -->
<!-- ////////////////////////// -->
- <!-- waiting for AS7 upstream -->
- <exclude>org/jboss/test/ws/jaxws/jbws3276/**</exclude>
-
<!-- # [JBWS-3308] Extends AS7 RemoteDeployer for supporting deployment of different security domains -->
<exclude>org/jboss/test/ws/jaxws/jbws2116/**</exclude>
<exclude>org/jboss/test/ws/jaxws/jbws3182/**</exclude>
13 years, 4 months
JBossWS SVN: r15164 - in thirdparty/cxf/branches/cxf-2.2.12: tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-10-26 09:35:40 -0400 (Wed, 26 Oct 2011)
New Revision: 15164
Added:
thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf2193/
thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf2193/hello_world_extension_wrapped.wsdl
Modified:
thirdparty/cxf/branches/cxf-2.2.12/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
Log:
[JBPAPP-7441]:Allow for WRAPPED style code generation for wrapper elements with xsd:extension
Modified: thirdparty/cxf/branches/cxf-2.2.12/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java 2011-10-26 13:35:38 UTC (rev 15163)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java 2011-10-26 13:35:40 UTC (rev 15164)
@@ -83,6 +83,7 @@
import org.apache.ws.commons.schema.XmlSchemaObject;
import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
import org.apache.ws.commons.schema.XmlSchemaSequence;
+import org.apache.ws.commons.schema.XmlSchemaType;
import static org.apache.cxf.helpers.CastUtils.cast;
@@ -740,56 +741,76 @@
MessageInfo wrapper, boolean allowRefs) {
if (type.getParticle() instanceof XmlSchemaSequence) {
XmlSchemaSequence seq = (XmlSchemaSequence)type.getParticle();
- XmlSchemaObjectCollection items = seq.getItems();
- boolean ret = true;
- for (int x = 0; x < items.getCount(); x++) {
- XmlSchemaObject o = items.getItem(x);
- if (!(o instanceof XmlSchemaElement)) {
+ return buildMessageParts(seq, namespaceURI, wrapper, allowRefs);
+ } else if (type.getParticle() == null) {
+ if (type.getContentModel() == null) {
+ return true;
+ }
+ if (type.getContentModel().getContent() instanceof XmlSchemaComplexContentExtension) {
+ XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension)type
+ .getContentModel().getContent();
+ QName baseTypeName = extension.getBaseTypeName();
+ ServiceInfo serviceInfo = wrapper.getOperation().getInterface().getService();
+ XmlSchemaType schemaType = serviceInfo.getXmlSchemaCollection().getTypeByQName(baseTypeName);
+ if (!(schemaType instanceof XmlSchemaComplexType)
+ || !isWrappableSequence((XmlSchemaComplexType)schemaType, namespaceURI, wrapper,
+ allowRefs)) {
return false;
}
- XmlSchemaElement el = (XmlSchemaElement)o;
- if (el.getSchemaTypeName() != null) {
- MessagePartInfo mpi = wrapper.addMessagePart(new QName(namespaceURI, el.getName()));
- mpi.setTypeQName(el.getSchemaTypeName());
- mpi.setConcreteName(el.getQName());
- mpi.setElement(true);
- mpi.setElementQName(el.getQName());
- mpi.setXmlSchema(el);
- } else if (el.getRefName() != null) {
- MessagePartInfo mpi = wrapper.addMessagePart(el.getRefName());
- mpi.setTypeQName(el.getRefName());
- mpi.setElementQName(el.getRefName());
- mpi.setElement(true);
- mpi.setXmlSchema(el);
- mpi.setProperty("isRefElement", true);
- // element reference is not permitted for wrapper element
- if (!allowRefs) {
- ret = false;
- }
- } else {
- // anonymous type
- MessagePartInfo mpi = wrapper.addMessagePart(new QName(namespaceURI, el.getName()));
- mpi.setConcreteName(el.getQName());
- mpi.setElementQName(mpi.getName());
- mpi.setElement(true);
- mpi.setXmlSchema(el);
+ if (extension.getParticle() instanceof XmlSchemaSequence) {
+ XmlSchemaSequence seq = (XmlSchemaSequence)extension.getParticle();
+ return buildMessageParts(seq, namespaceURI, wrapper, allowRefs);
}
- }
- return ret;
- } else if (type.getParticle() == null) {
- if (type.getContentModel() == null) {
- return true;
}
- if (type.getContentModel().getContent() instanceof XmlSchemaComplexContentExtension) {
- return false;
- }
return true;
}
return false;
}
+ private static boolean buildMessageParts(XmlSchemaSequence seq, String namespaceURI, MessageInfo wrapper,
+ boolean allowRefs) {
+ XmlSchemaObjectCollection items = seq.getItems();
+ boolean ret = true;
+
+ for (int i = 0; i < items.getCount(); i++) {
+ XmlSchemaObject seqItem = items.getItem(i);
+ if (!(seqItem instanceof XmlSchemaElement)) {
+ return false;
+ }
+ XmlSchemaElement el = (XmlSchemaElement)seqItem;
+
+ if (el.getSchemaTypeName() != null) {
+ MessagePartInfo mpi = wrapper.addMessagePart(new QName(namespaceURI, el.getName()));
+ mpi.setTypeQName(el.getSchemaTypeName());
+ mpi.setElement(true);
+ mpi.setElementQName(el.getQName());
+ mpi.setConcreteName(el.getQName());
+ mpi.setXmlSchema(el);
+ } else if (el.getRefName() != null) {
+ MessagePartInfo mpi = wrapper.addMessagePart(el.getRefName());
+ mpi.setTypeQName(el.getRefName());
+ mpi.setElementQName(el.getRefName());
+ mpi.setElement(true);
+ mpi.setXmlSchema(el);
+ mpi.setProperty("isRefElement", true);
+ // element reference is not permitted for wrapper element
+ if (!allowRefs) {
+ ret = false;
+ }
+ } else {
+ // anonymous type
+ MessagePartInfo mpi = wrapper.addMessagePart(new QName(namespaceURI, el.getName()));
+ mpi.setElementQName(mpi.getName());
+ mpi.setConcreteName(el.getQName());
+ mpi.setElement(true);
+ mpi.setXmlSchema(el);
+ }
+ }
+ return ret;
+ }
+
private void buildMessage(AbstractMessageContainer minfo, Message msg) {
SchemaCollection schemas = minfo.getOperation().getInterface().getService()
.getXmlSchemaCollection();
Modified: thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java 2011-10-26 13:35:38 UTC (rev 15163)
+++ thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java 2011-10-26 13:35:40 UTC (rev 15164)
@@ -49,11 +49,14 @@
import org.apache.cxf.tools.util.URIParserUtil;
import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaComplexContentExtension;
import org.apache.ws.commons.schema.XmlSchemaComplexType;
+import org.apache.ws.commons.schema.XmlSchemaContent;
import org.apache.ws.commons.schema.XmlSchemaElement;
import org.apache.ws.commons.schema.XmlSchemaForm;
import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
import org.apache.ws.commons.schema.XmlSchemaSequence;
+import org.apache.ws.commons.schema.XmlSchemaType;
public final class ProcessorUtil {
private static final String KEYWORDS_PREFIX = "_";
@@ -373,25 +376,53 @@
public static List<WrapperElement> getWrappedElement(ToolContext context, QName partElement) {
List<WrapperElement> qnames = new ArrayList<WrapperElement>();
-
+
ServiceInfo serviceInfo = (ServiceInfo)context.get(ServiceInfo.class);
SchemaCollection schema = serviceInfo.getXmlSchemaCollection();
-
+
XmlSchemaElement elementByName = schema.getElementByQName(partElement);
-
+
XmlSchemaComplexType type = (XmlSchemaComplexType)elementByName.getSchemaType();
XmlSchemaSequence seq = (XmlSchemaSequence)type.getParticle();
-
+
+ qnames.addAll(createWrappedElements(seq));
+
+ // If it's extension
+ if (seq == null && type.getContentModel() != null) {
+
+ XmlSchemaContent xmlSchemaConent = type.getContentModel().getContent();
+ if (xmlSchemaConent instanceof XmlSchemaComplexContentExtension) {
+ XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension)type
+ .getContentModel().getContent();
+ QName baseTypeName = extension.getBaseTypeName();
+ XmlSchemaType schemaType = schema.getTypeByQName(baseTypeName);
+ if (schemaType instanceof XmlSchemaComplexType) {
+ XmlSchemaComplexType complexType = (XmlSchemaComplexType)schemaType;
+ if (complexType.getParticle() instanceof XmlSchemaSequence) {
+ seq = (XmlSchemaSequence)complexType.getParticle();
+ qnames.addAll(createWrappedElements(seq));
+ }
+ }
+
+ if (extension.getParticle() instanceof XmlSchemaSequence) {
+ XmlSchemaSequence xmlSchemaSeq = (XmlSchemaSequence)extension.getParticle();
+ qnames.addAll(createWrappedElements(xmlSchemaSeq));
+ }
+ }
+
+ }
+ return qnames;
+ }
+
+ private static List<WrapperElement> createWrappedElements(XmlSchemaSequence seq) {
+
+ List<WrapperElement> qnames = new ArrayList<WrapperElement>();
if (seq != null) {
-
XmlSchemaObjectCollection items = seq.getItems();
-
Iterator ite = items.getIterator();
-
while (ite.hasNext()) {
XmlSchemaElement subElement = (XmlSchemaElement)ite.next();
-
if (subElement.getQName() != null) {
qnames.add(new WrapperElement(subElement.getQName(), subElement.getSchemaTypeName()));
} else {
Modified: thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java 2011-10-26 13:35:38 UTC (rev 15163)
+++ thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java 2011-10-26 13:35:40 UTC (rev 15164)
@@ -1350,5 +1350,26 @@
fault = classLoader.loadClass("org.apache.cxf.w2j.hello_world_soap_http.BadRecordLitFault");
assertEquals(fault.getName().hashCode(), ObjectStreamClass.lookup(fault).getSerialVersionUID());
}
+
+
+ @Test
+ public void testExtensionWrapper() throws Exception {
+ env.put(ToolConstants.CFG_WSDLURL,
+ getLocation("/wsdl2java_wsdl/cxf2193/hello_world_extension_wrapped.wsdl"));
+ processor.setContext(env);
+ processor.execute();
+ File infFile = new File(output, "org/apache/cxf/w2j/extension_wrapped/Greeter.java");
+ assertTrue(infFile.exists());
+
+ Class<?> interfaceClass = classLoader.loadClass("org.apache.cxf.w2j.extension_wrapped.Greeter");
+
+ Method method = interfaceClass.getMethod("greetMe", new Class[] {
+ Holder.class, Holder.class, Holder.class, Holder.class, Holder.class
+ });
+ assertTrue("greetMe operation is NOT generated correctly as excepted", method != null);
+ RequestWrapper reqWrapper = method.getAnnotation(RequestWrapper.class);
+ assertNotNull("@RequestWrapper is expected", reqWrapper);
+ }
+
}
Added: thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf2193/hello_world_extension_wrapped.wsdl
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf2193/hello_world_extension_wrapped.wsdl (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf2193/hello_world_extension_wrapped.wsdl 2011-10-26 13:35:40 UTC (rev 15164)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://cxf.apache.org/w2j/extension_wrapped"
+ xmlns:x1="http://cxf.apache.org/w2j/extension_wrapped/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://cxf.apache.org/w2j/extension_wrapped" name="HelloWorld">
+ <wsdl:types>
+ <schema targetNamespace="http://cxf.apache.org/w2j/extension_wrapped/types"
+ xmlns="http://www.w3.org/2001/XMLSchema" xmlns:x1="http://cxf.apache.org/w2j/extension_wrapped/types"
+ elementFormDefault="qualified">
+ <element name="greetMe">
+ <complexType>
+ <sequence>
+ <element name="content" type="xsd:base64Binary" minOccurs="0" />
+ <element name="id" type="xsd:string" minOccurs="0" />
+ <element name="name" type="xsd:string" minOccurs="0" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="greetMeResponse" type="x1:ComplexContext" />
+
+ <complexType name="ComplexContext">
+ <complexContent>
+ <extension base="x1:ComplexContextType">
+ <sequence>
+ <element name="extraElement" type="xsd:string" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="ComplexContextType">
+ <sequence>
+ <element name="content" type="xsd:base64Binary" minOccurs="0" />
+ <element name="id" type="xsd:string" minOccurs="0" />
+ <element name="name" type="xsd:string" minOccurs="0" />
+ <element name="testlist" type="xsd:string" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ </complexType>
+
+
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="greetMeRequest">
+ <wsdl:part name="in" element="x1:greetMe" />
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part name="out" element="x1:greetMeResponse" />
+ </wsdl:message>
+
+ <wsdl:portType name="Greeter">
+ >
+ <wsdl:operation name="greetMe">
+ <wsdl:input name="greetMeRequest" message="tns:greetMeRequest" />
+ <wsdl:output name="greetMeResponse" message="tns:greetMeResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="greetMe">
+ <soap:operation style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SOAPService">
+ <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9000/SoapContext/SoapPort" />
+ <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+
13 years, 4 months
JBossWS SVN: r15163 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-10-26 09:35:38 -0400 (Wed, 26 Oct 2011)
New Revision: 15163
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
updating excludes
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2011-10-26 11:01:52 UTC (rev 15162)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2011-10-26 13:35:38 UTC (rev 15163)
@@ -1313,9 +1313,6 @@
<!-- AS7 integration exclusions -->
<!-- ////////////////////////// -->
- <!-- waiting for AS7 upstream -->
- <exclude>org/jboss/test/ws/jaxws/jbws3276/**</exclude>
-
<!-- TODO: EJB3 DD driven deployments -->
<exclude>org/jboss/test/ws/jaxws/jbws1813/**</exclude>
<exclude>org/jboss/test/ws/jaxws/jbws1841/**</exclude>
13 years, 4 months