JBossWS SVN: r4728 - stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2007-10-10 11:27:16 -0400 (Wed, 10 Oct 2007)
New Revision: 4728
Modified:
stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
Log:
[JBWS-1843] issue fix
Modified: stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2007-10-10 14:50:55 UTC (rev 4727)
+++ stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2007-10-10 15:27:16 UTC (rev 4728)
@@ -32,6 +32,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import javax.wsdl.Definition;
@@ -120,11 +121,12 @@
Definition wsdl11Definition = wsdlDefinitions.getWsdlOneOneDefinition();
if (wsdl11Definition != null)
{
- publishWsdlImports(wsdlFile.toURL(), wsdl11Definition);
+ List<String> published = new LinkedList<String>();
+ publishWsdlImports(wsdlFile.toURL(), wsdl11Definition, published);
// Publish XMLSchema imports
Document document = wsdlDefinitions.getWsdlDocument();
- publishSchemaImports(wsdlFile.toURL(), document.getDocumentElement());
+ publishSchemaImports(wsdlFile.toURL(), document.getDocumentElement(), published);
}
else
{
@@ -144,7 +146,7 @@
/** Publish the wsdl imports for a given wsdl definition
*/
- private void publishWsdlImports(URL parentURL, Definition parentDefinition) throws Exception
+ private void publishWsdlImports(URL parentURL, Definition parentDefinition, List<String> published) throws Exception
{
String baseURI = parentURL.toExternalForm();
@@ -159,6 +161,16 @@
// its an external import, don't publish locally
if (locationURI.startsWith("http://") == false)
{
+ // infinity loops prevention
+ if (published.contains(locationURI))
+ {
+ return;
+ }
+ else
+ {
+ published.add(locationURI);
+ }
+
URL targetURL = new URL(baseURI.substring(0, baseURI.lastIndexOf("/") + 1) + locationURI);
File targetFile = new File(targetURL.getPath());
targetFile.getParentFile().mkdirs();
@@ -172,12 +184,12 @@
if (log.isDebugEnabled())
log.debug("WSDL import published to: " + targetURL);
- // recursivly publish imports
- publishWsdlImports(targetURL, subdef);
+ // recursively publish imports
+ publishWsdlImports(targetURL, subdef, published);
// Publish XMLSchema imports
Element subdoc = DOMUtils.parse(targetURL.openStream());
- publishSchemaImports(targetURL, subdoc);
+ publishSchemaImports(targetURL, subdoc, published);
}
}
}
@@ -185,7 +197,7 @@
/** Publish the schema imports for a given wsdl definition
*/
- private void publishSchemaImports(URL parentURL, Element element) throws Exception
+ private void publishSchemaImports(URL parentURL, Element element, List<String> published) throws Exception
{
String baseURI = parentURL.toExternalForm();
@@ -200,6 +212,16 @@
{
if (schemaLocation.startsWith("http://") == false)
{
+ // infinity loops prevention
+ if (published.contains(schemaLocation))
+ {
+ return;
+ }
+ else
+ {
+ published.add(schemaLocation);
+ }
+
URL xsdURL = new URL(baseURI.substring(0, baseURI.lastIndexOf("/") + 1) + schemaLocation);
File targetFile = new File(xsdURL.getPath());
targetFile.getParentFile().mkdirs();
@@ -229,13 +251,13 @@
// recursivly publish imports
Element subdoc = DOMUtils.parse(xsdURL.openStream());
- publishSchemaImports(xsdURL, subdoc);
+ publishSchemaImports(xsdURL, subdoc, published);
}
}
}
else
{
- publishSchemaImports(parentURL, childElement);
+ publishSchemaImports(parentURL, childElement, published);
}
}
}
17 years, 2 months
JBossWS SVN: r4727 - stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-10-10 10:50:55 -0400 (Wed, 10 Oct 2007)
New Revision: 4727
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java
Log:
Fix jaxbintro reggression introduced by WSDL generation
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java 2007-10-10 14:30:12 UTC (rev 4726)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java 2007-10-10 14:50:55 UTC (rev 4727)
@@ -27,6 +27,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.EndpointAssociation;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
@@ -36,7 +38,8 @@
* The default factory checks if a {@link JAXBBindingCustomization} exists
* and uses it to customize the JAXBContext that will be created.
* <p>
- * It uses the {@link org.jboss.wsf.spi.invocation.EndpointAssociation} to access customizations.
+ * It uses the {@link org.jboss.wsf.spi.invocation.EndpointAssociation} to access customizations
+ * if they are not passed explicitly.
*
* @see org.jboss.wsf.spi.deployment.Endpoint
* @see org.jboss.wsf.spi.binding.BindingCustomization
@@ -56,12 +59,20 @@
{
return createContext(new Class[] {clazz});
}
-
+
public JAXBContext createContext(Class[] clazzes) throws WSException
{
try
{
- return JAXBContext.newInstance(clazzes);
+ BindingCustomization customization = getCustomization();
+
+ JAXBContext jaxbCtx;
+ if(null == customization)
+ jaxbCtx = JAXBContext.newInstance(clazzes);
+ else
+ jaxbCtx = createContext(clazzes, customization);
+
+ return jaxbCtx;
}
catch (JAXBException e) {
throw new WSException("Failed to create JAXBContext", e);
@@ -71,7 +82,7 @@
public JAXBContext createContext(Class[] clazzes, BindingCustomization bindingCustomization) throws WSException
{
try
- {
+ {
return JAXBContext.newInstance(clazzes, bindingCustomization);
}
catch (JAXBException e) {
@@ -84,7 +95,7 @@
String defaultNamespaceRemap, boolean c14nSupport, BindingCustomization bindingCustomization)
{
try
- {
+ {
RuntimeAnnotationReader runtimeAnnotations = bindingCustomization!=null ?
(RuntimeAnnotationReader)bindingCustomization.get(JAXBRIContext.ANNOTATION_READER) : null;
@@ -100,4 +111,10 @@
throw new WSException("Failed to create JAXBContext", e);
}
}
+
+ private BindingCustomization getCustomization()
+ {
+ Endpoint threadLocal = EndpointAssociation.getEndpoint();
+ return threadLocal!=null ? threadLocal.getAttachment(BindingCustomization.class):null;
+ }
}
17 years, 2 months
JBossWS SVN: r4726 - in stack/native/trunk: ant-import-tests and 8 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-10-10 10:30:12 -0400 (Wed, 10 Oct 2007)
New Revision: 4726
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1807/
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1807/JBWS1807TestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1807/ProviderImpl.java
stack/native/trunk/src/test/resources/jaxws/jbws1807/
stack/native/trunk/src/test/resources/jaxws/jbws1807/WEB-INF/
stack/native/trunk/src/test/resources/jaxws/jbws1807/WEB-INF/web.xml
stack/native/trunk/src/test/resources/jaxws/jbws1807/WEB-INF/wsdl/
stack/native/trunk/src/test/resources/jaxws/jbws1807/WEB-INF/wsdl/provider.wsdl
Modified:
stack/native/trunk/.classpath
stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
stack/native/trunk/version.properties
Log:
[JBWS-1807] HTTP bindings for Provider
Modified: stack/native/trunk/.classpath
===================================================================
--- stack/native/trunk/.classpath 2007-10-10 14:23:04 UTC (rev 4725)
+++ stack/native/trunk/.classpath 2007-10-10 14:30:12 UTC (rev 4726)
@@ -38,5 +38,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/spi"/>
<classpathentry combineaccessrules="false" kind="src" path="/common"/>
<classpathentry kind="lib" path="thirdparty/junit.jar"/>
+ <classpathentry kind="lib" path="thirdparty/jboss-jaxb-intros.jar"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Modified: stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2007-10-10 14:23:04 UTC (rev 4725)
+++ stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2007-10-10 14:30:12 UTC (rev 4726)
@@ -388,6 +388,16 @@
</fileset>
</jar>
+ <!-- jaxws-jbws1807 -->
+ <war warfile="${tests.output.dir}/libs/jaxws-jbws1807.war" webxml="${tests.output.dir}/resources/jaxws/jbws1807/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/jbws1807/ProviderImpl.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/jbws1807/WEB-INF">
+ <include name="wsdl/**"/>
+ </webinf>
+ </war>
+
<!-- jaxws-jbws1813 -->
<jar destfile="${tests.output.dir}/libs/jaxws-jbws1813.jar">
<fileset dir="${tests.output.dir}/classes">
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-10-10 14:23:04 UTC (rev 4725)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-10-10 14:30:12 UTC (rev 4726)
@@ -36,6 +36,7 @@
import javax.wsdl.Definition;
import javax.wsdl.Import;
import javax.wsdl.Port;
+import javax.wsdl.extensions.http.HTTPAddress;
import javax.wsdl.extensions.soap.SOAPAddress;
import javax.wsdl.extensions.soap12.SOAP12Address;
import javax.xml.namespace.QName;
@@ -316,7 +317,7 @@
// modify the wsdl-1.1 definition
if (wsdlDefinitions.getWsdlOneOneDefinition() != null)
- replaceWSDL11SOAPAddress(wsdlDefinitions, portName, serviceEndpointURL);
+ replaceWSDL11PortAddress(wsdlDefinitions, portName, serviceEndpointURL);
}
else
{
@@ -338,13 +339,13 @@
throw new WSException("Cannot find port in wsdl: " + portName);
}
- private static void replaceWSDL11SOAPAddress(WSDLDefinitions wsdlDefinitions, QName portQName, String serviceEndpointURL)
+ private static void replaceWSDL11PortAddress(WSDLDefinitions wsdlDefinitions, QName portQName, String serviceEndpointURL)
{
Definition wsdlOneOneDefinition = wsdlDefinitions.getWsdlOneOneDefinition();
String tnsURI = wsdlOneOneDefinition.getTargetNamespace();
// search for matching portElement and replace the address URI
- Port wsdlOneOnePort = modifySOAPAddress(tnsURI, portQName, serviceEndpointURL, wsdlOneOneDefinition.getServices());
+ Port wsdlOneOnePort = modifyPortAddress(tnsURI, portQName, serviceEndpointURL, wsdlOneOneDefinition.getServices());
// recursivly process imports if none can be found
if (wsdlOneOnePort == null && !wsdlOneOneDefinition.getImports().isEmpty())
@@ -358,7 +359,7 @@
while (importsByNS.hasNext())
{
Import anImport = (Import)importsByNS.next();
- wsdlOneOnePort = modifySOAPAddress(anImport.getNamespaceURI(), portQName, serviceEndpointURL, anImport.getDefinition().getServices());
+ wsdlOneOnePort = modifyPortAddress(anImport.getNamespaceURI(), portQName, serviceEndpointURL, anImport.getDefinition().getServices());
}
}
}
@@ -368,7 +369,7 @@
throw new IllegalArgumentException("Cannot find port with name '" + portQName + "' in wsdl document");
}
- private static Port modifySOAPAddress(String tnsURI, QName portQName, String serviceEndpointURL, Map services)
+ private static Port modifyPortAddress(String tnsURI, QName portQName, String serviceEndpointURL, Map services)
{
Port wsdlOneOnePort = null;
Iterator itServices = services.values().iterator();
@@ -391,11 +392,16 @@
SOAPAddress address = (SOAPAddress)extElement;
address.setLocationURI(serviceEndpointURL);
}
- if (extElement instanceof SOAP12Address)
+ else if (extElement instanceof SOAP12Address)
{
SOAP12Address address = (SOAP12Address)extElement;
address.setLocationURI(serviceEndpointURL);
}
+ else if (extElement instanceof HTTPAddress)
+ {
+ HTTPAddress address = (HTTPAddress)extElement;
+ address.setLocationURI(serviceEndpointURL);
+ }
}
}
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2007-10-10 14:23:04 UTC (rev 4725)
+++ stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2007-10-10 14:30:12 UTC (rev 4726)
@@ -57,6 +57,7 @@
import javax.wsdl.extensions.ElementExtensible;
import javax.wsdl.extensions.ExtensibilityElement;
import javax.wsdl.extensions.UnknownExtensibilityElement;
+import javax.wsdl.extensions.http.HTTPBinding;
import javax.wsdl.extensions.mime.MIMEContent;
import javax.wsdl.extensions.mime.MIMEMultipartRelated;
import javax.wsdl.extensions.mime.MIMEPart;
@@ -991,6 +992,8 @@
QName srcBindingQName = srcBinding.getQName();
log.trace("processBinding: " + srcBindingQName);
+ boolean bindingProcessed = false;
+
if (destWsdl.getBinding(srcBindingQName) == null)
{
PortType srcPortType = getDefinedPortType(srcBinding);
@@ -1009,6 +1012,10 @@
{
bindingType = Constants.NS_SOAP12;
}
+ else if (extElement instanceof HTTPBinding)
+ {
+ bindingType = Constants.NS_HTTP;
+ }
else if ("binding".equals(elementType.getLocalPart()))
{
log.warn("Unsupported binding: " + elementType);
@@ -1020,40 +1027,41 @@
throw new WSDLException(WSDLException.INVALID_WSDL, "Cannot obtain binding type for: " + srcBindingQName);
// Ignore unknown bindings
- if (Constants.NS_SOAP11.equals(bindingType) == false && Constants.NS_SOAP12.equals(bindingType) == false)
- return false;
+ if (Constants.NS_SOAP11.equals(bindingType) || Constants.NS_SOAP12.equals(bindingType) || Constants.NS_HTTP.equals(bindingType))
+ {
+ WSDLBinding destBinding = new WSDLBinding(destWsdl, srcBindingQName);
+ destBinding.setInterfaceName(srcPortType.getQName());
+ destBinding.setType(bindingType);
+ processUnknownExtensibilityElements(srcBinding, destBinding);
+ destWsdl.addBinding(destBinding);
- WSDLBinding destBinding = new WSDLBinding(destWsdl, srcBindingQName);
- destBinding.setInterfaceName(srcPortType.getQName());
- destBinding.setType(bindingType);
- processUnknownExtensibilityElements(srcBinding, destBinding);
- destWsdl.addBinding(destBinding);
+ // mark SWA Parts upfront
+ preProcessSWAParts(srcBinding, srcWsdl);
- // mark SWA Parts upfront
- preProcessSWAParts(srcBinding, srcWsdl);
+ processPortType(srcWsdl, srcPortType);
- processPortType(srcWsdl, srcPortType);
-
- String bindingStyle = Style.getDefaultStyle().toString();
- for (ExtensibilityElement extElement : extList)
- {
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPBinding)
+ String bindingStyle = Style.getDefaultStyle().toString();
+ for (ExtensibilityElement extElement : extList)
{
- SOAPBinding soapBinding = (SOAPBinding)extElement;
- bindingStyle = soapBinding.getStyle();
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPBinding)
+ {
+ SOAPBinding soapBinding = (SOAPBinding)extElement;
+ bindingStyle = soapBinding.getStyle();
+ }
+ else if (extElement instanceof SOAP12Binding)
+ {
+ SOAP12Binding soapBinding = (SOAP12Binding)extElement;
+ bindingStyle = soapBinding.getStyle();
+ }
}
- else if (extElement instanceof SOAP12Binding)
- {
- SOAP12Binding soapBinding = (SOAP12Binding)extElement;
- bindingStyle = soapBinding.getStyle();
- }
+
+ processBindingOperations(srcWsdl, destBinding, srcBinding, bindingStyle);
+ bindingProcessed = true;
}
-
- processBindingOperations(srcWsdl, destBinding, srcBinding, bindingStyle);
}
- return true;
+ return bindingProcessed;
}
/** The port might reference a binding which is defined in another wsdl
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1807/JBWS1807TestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1807/JBWS1807TestCase.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1807/JBWS1807TestCase.java 2007-10-10 14:30:12 UTC (rev 4726)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws1807;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.http.HTTPBinding;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.w3c.dom.Element;
+
+/**
+ * HTTP bindings for Provider
+ *
+ * http://jira.jboss.org/jira/browse/JBWS-1807
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 09-Oct-2007
+ */
+public class JBWS1807TestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws1807";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS1807TestCase.class, "jaxws-jbws1807.war");
+ }
+
+ public void testWSDLAccess() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ Element wsdl = DOMUtils.parse(wsdlURL.openStream());
+ assertNotNull(wsdl);
+ }
+
+ public void testProviderDispatch() throws Exception
+ {
+ String targetNS = "http://ws.com/";
+ QName serviceName = new QName(targetNS, "Provider");
+ QName portName = new QName(targetNS, "ProviderPort");
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+
+ Service service = Service.create(serviceName);
+ service.addPort(portName, HTTPBinding.HTTP_BINDING, wsdlURL.toExternalForm());
+
+ Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
+ Source resPayload = dispatch.invoke(new DOMSource(DOMUtils.parse("<input>hello</input>")));
+
+ Element docElement = DOMUtils.sourceToElement(resPayload);
+ assertEquals(DOMUtils.parse("<reply><input>hello</input></reply>"), docElement);
+ }
+}
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1807/ProviderImpl.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1807/ProviderImpl.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1807/ProviderImpl.java 2007-10-10 14:30:12 UTC (rev 4726)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws1807;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.http.HTTPBinding;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
+
+@WebServiceProvider(wsdlLocation = "WEB-INF/wsdl/provider.wsdl", portName = "ProviderPort", serviceName = "Provider", targetNamespace = "http://ws.com/")
+@ServiceMode(value = Service.Mode.PAYLOAD)
+@BindingType(value = HTTPBinding.HTTP_BINDING)
+public class ProviderImpl implements Provider<Source>
+{
+ // provide logging
+ private final static Logger log = Logger.getLogger(ProviderImpl.class);
+
+ public Source invoke(Source source)
+ {
+ try
+ {
+ String input = DOMWriter.printNode(DOMUtils.sourceToElement(source), false);
+ log.info("invoke: " + input);
+
+ String reply = "<reply>" + input + "</reply>";
+ return new StreamSource(new ByteArrayInputStream(reply.getBytes()));
+ }
+ catch (IOException ex)
+ {
+ throw new RuntimeException(ex);
+ }
+ }
+}
\ No newline at end of file
Added: stack/native/trunk/src/test/resources/jaxws/jbws1807/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/jbws1807/WEB-INF/web.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/jbws1807/WEB-INF/web.xml 2007-10-10 14:30:12 UTC (rev 4726)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>ProviderService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws1807.ProviderImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ProviderService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Added: stack/native/trunk/src/test/resources/jaxws/jbws1807/WEB-INF/wsdl/provider.wsdl
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/jbws1807/WEB-INF/wsdl/provider.wsdl (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/jbws1807/WEB-INF/wsdl/provider.wsdl 2007-10-10 14:30:12 UTC (rev 4726)
@@ -0,0 +1,59 @@
+<?xml version='1.0'?>
+<definitions name='ProviderService' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+ xmlns:tns='http://ws.com/' targetNamespace='http://ws.com/'
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+
+ <message name='m1'>
+ <part name='part1' type='xsd:binary'/>
+ </message>
+
+ <message name='m2'>
+ <part name='response' type='xsd:binary'/>
+ </message>
+
+ <portType name="pt1">
+ <operation name="o1">
+ <input message="tns:m1"/>
+ <output message="tns:m2"/>
+ </operation>
+ </portType>
+ <portType name='pt2'>
+ <operation name='o1'>
+ <input message='tns:echo'/>
+ <output message='tns:echoResponse'/>
+ </operation>
+ </portType>
+
+ <binding name="b1" type="tns:pt2">
+ <http:binding verb="GET"/>
+ <operation name="o1">
+ <http:operation location="o1"/>
+ <input>
+ <http:urlEncoded/>
+ </input>
+ <output>
+ <mime:content type="text/xml"/>
+ </output>
+ </operation>
+ </binding>
+ <binding name='b2' type='tns:pt2'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='o1'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="ProviderService">
+ <port name="ProviderPort" binding="tns:b1">
+ <http:address location="REPLACE_WITH_ACTUAL_URL"/>
+ </port>
+ </service>
+
+</definitions>
\ No newline at end of file
Modified: stack/native/trunk/version.properties
===================================================================
--- stack/native/trunk/version.properties 2007-10-10 14:23:04 UTC (rev 4725)
+++ stack/native/trunk/version.properties 2007-10-10 14:30:12 UTC (rev 4726)
@@ -26,10 +26,9 @@
# Dependend integration projects
jbossws-spi=1.0.0.GA
jbossws-common=1.0.0.GA
-jbossws-framework=2.0.1.GA
+jbossws-framework=snapshot
jbossws-jboss40=2.0.1.GA
jbossws-jboss42=2.0.1.GA
-jbossws-jboss50=2.0.1.GA
# JBossAS-5.0
jboss-jbossxb-jboss50=2.0.0.CR4
17 years, 2 months
JBossWS SVN: r4725 - in stack/native/branches/jbossws-native-2.0.1.SP2: ant-import and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-10-10 10:23:04 -0400 (Wed, 10 Oct 2007)
New Revision: 4725
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2/ant-import/build-bin-dist.xml
stack/native/branches/jbossws-native-2.0.1.SP2/ant-import/build-thirdparty.xml
stack/native/branches/jbossws-native-2.0.1.SP2/ant-import/macros-deploy-native.xml
stack/native/branches/jbossws-native-2.0.1.SP2/build.xml
stack/native/branches/jbossws-native-2.0.1.SP2/version.properties
Log:
Remove dependency on jbossws-jboss42
Modified: stack/native/branches/jbossws-native-2.0.1.SP2/ant-import/build-bin-dist.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2/ant-import/build-bin-dist.xml 2007-10-10 14:19:14 UTC (rev 4724)
+++ stack/native/branches/jbossws-native-2.0.1.SP2/ant-import/build-bin-dist.xml 2007-10-10 14:23:04 UTC (rev 4725)
@@ -92,9 +92,6 @@
<include name="jbossws-framework.jar"/>
<include name="jbossws-framework-scripts.zip"/>
<include name="jbossws-spi.jar"/>
- <include name="jbossws-jboss50.jar"/>
- <include name="jbossws-jboss50-deployer.zip"/>
- <include name="jbossws-jboss42.jar"/>
<include name="jbossws-jboss40.jar"/>
</fileset>
<fileset dir="${core.dir}/output/lib">
Modified: stack/native/branches/jbossws-native-2.0.1.SP2/ant-import/build-thirdparty.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2/ant-import/build-thirdparty.xml 2007-10-10 14:19:14 UTC (rev 4724)
+++ stack/native/branches/jbossws-native-2.0.1.SP2/ant-import/build-thirdparty.xml 2007-10-10 14:23:04 UTC (rev 4725)
@@ -56,9 +56,6 @@
<get src="${jboss.repository}/jboss/jbossws-jboss40/${jbossws-jboss40}/lib/jbossws-jboss40.jar" dest="${thirdparty.dir}/jbossws-jboss40.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossws-jboss40/${jbossws-jboss40}/lib/jbossws-jboss40-resources.zip" dest="${thirdparty.dir}/jbossws-jboss40-resources.zip" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossws-jboss40/${jbossws-jboss40}/lib/jbossws-jboss40-src.zip" dest="${thirdparty.dir}/jbossws-jboss40-src.zip" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/jboss/jbossws-jboss42/${jbossws-jboss42}/lib/jbossws-jboss42.jar" dest="${thirdparty.dir}/jbossws-jboss42.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/jboss/jbossws-jboss42/${jbossws-jboss42}/lib/jbossws-jboss42-resources.zip" dest="${thirdparty.dir}/jbossws-jboss42-resources.zip" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/jboss/jbossws-jboss42/${jbossws-jboss42}/lib/jbossws-jboss42-src.zip" dest="${thirdparty.dir}/jbossws-jboss42-src.zip" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossws-jboss50/${jbossws-jboss50}/lib/jbossws-jboss50.jar" dest="${thirdparty.dir}/jbossws-jboss50.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossws-jboss50/${jbossws-jboss50}/lib/jbossws-jboss50-deployer.zip" dest="${thirdparty.dir}/jbossws-jboss50-deployer.zip" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossws-jboss50/${jbossws-jboss50}/lib/jbossws-jboss50-src.zip" dest="${thirdparty.dir}/jbossws-jboss50-src.zip" usetimestamp="true" verbose="true"/>
Modified: stack/native/branches/jbossws-native-2.0.1.SP2/ant-import/macros-deploy-native.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2/ant-import/macros-deploy-native.xml 2007-10-10 14:19:14 UTC (rev 4724)
+++ stack/native/branches/jbossws-native-2.0.1.SP2/ant-import/macros-deploy-native.xml 2007-10-10 14:23:04 UTC (rev 4725)
@@ -140,7 +140,6 @@
<include name="jbossws-client.jar"/>
</fileset>
<fileset dir="@{thirdpartylibs}">
- <include name="jbossws-jboss42.jar"/>
<include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
@@ -160,11 +159,6 @@
<include name="jboss-xml-binding.jar"/>
</fileset>
</copy>
- <copy todir="${jboss42.home}/server/${jboss.server.instance}/lib" overwrite="true">
- <fileset dir="@{thirdpartylibs}">
- <include name="jbossws-jboss42.jar"/>
- </fileset>
- </copy>
<mkdir dir="${jboss42.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<unjar dest="${jboss42.home}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-native42.sar"/>
@@ -197,7 +191,6 @@
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
<include name="jbossws-client.jar"/>
- <include name="jbossws-jboss42.jar"/>
<include name="policy.jar"/>
<include name="stax-ex.jar"/>
<include name="streambuffer.jar"/>
@@ -215,9 +208,9 @@
<include name="jbossws-integration.jar"/>
</fileset>
<fileset dir="${jboss42.home}/server/${jboss.server.instance}/lib">
- <include name="jbossws-jboss42.jar"/>
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
+ <include name="jboss-jaxws-ext.jar"/>
<include name="jboss-saaj.jar"/>
<!-- Remove only, do not deploy -->
<include name="jbossws-integration.jar"/>
Modified: stack/native/branches/jbossws-native-2.0.1.SP2/build.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2/build.xml 2007-10-10 14:19:14 UTC (rev 4724)
+++ stack/native/branches/jbossws-native-2.0.1.SP2/build.xml 2007-10-10 14:23:04 UTC (rev 4725)
@@ -274,7 +274,6 @@
<include name="jbossws-core.jar"/>
</fileset>
<fileset dir="${core.dir}/thirdparty">
- <include name="jbossws-jboss42.jar"/>
<include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="policy.jar"/>
Modified: stack/native/branches/jbossws-native-2.0.1.SP2/version.properties
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2/version.properties 2007-10-10 14:19:14 UTC (rev 4724)
+++ stack/native/branches/jbossws-native-2.0.1.SP2/version.properties 2007-10-10 14:23:04 UTC (rev 4725)
@@ -5,8 +5,8 @@
specification.vendor=JBoss (http://www.jboss.org)
specification.version=jbossws-2.0
-version.id=2.0.1.SP1
-repository.id=2.0.1.SP1
+version.id=2.0.1.SP2
+repository.id=2.0.1.SP2
implementation.title=JBoss Web Services - Native
implementation.url=http://www.jboss.org/products/jbossws
@@ -28,7 +28,6 @@
jbossws-common=1.0.0.GA
jbossws-framework=2.0.1.GA
jbossws-jboss40=2.0.1.GA
-jbossws-jboss42=2.0.1.GA
jbossws-jboss50=2.0.1.GA
# JBossAS-5.0
17 years, 2 months
JBossWS SVN: r4724 - in stack/native/trunk: src/main/java/org/jboss/ws/core/binding and 9 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-10-10 10:19:14 -0400 (Wed, 10 Oct 2007)
New Revision: 4724
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/DocRequest.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/DocResponse.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/Endpoint.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/EndpointImpl.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/JBWS1809TestCase.java
stack/native/trunk/src/test/resources/jaxws/jbws1809/
stack/native/trunk/src/test/resources/jaxws/jbws1809/META-INF/
stack/native/trunk/src/test/resources/jaxws/jbws1809/META-INF/jaxb-intros.xml
Modified:
stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
stack/native/trunk/ant-import-tests/build-testsuite.xml
stack/native/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeDeserializer.java
stack/native/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBContextFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
stack/native/trunk/src/main/resources/jbossws-native-config.xml
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jaxbintros/JAXBIntroTestCase.java
Log:
JBWS-1809: JAXBIntros are not taken into consideration when generating the WSDL
Modified: stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2007-10-10 14:11:21 UTC (rev 4723)
+++ stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2007-10-10 14:19:14 UTC (rev 4724)
@@ -413,6 +413,16 @@
</fileset>
</jar>
+ <!-- jaxws-jbws1809 -->
+ <jar destfile="${tests.output.dir}/libs/jaxws-jbws1809.jar">
+ <fileset dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/jbws1809/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws1809/*TestCase.class"/>
+ </fileset>
+ <metainf dir="${tests.output.dir}/resources/jaxws/jbws1809/META-INF"/>
+ </jar>
+
+
<!-- jaxws namespace -->
<war warfile="${tests.output.dir}/libs/jaxws-namespace.war" webxml="${tests.output.dir}/resources/jaxws/namespace/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Modified: stack/native/trunk/ant-import-tests/build-testsuite.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-testsuite.xml 2007-10-10 14:11:21 UTC (rev 4723)
+++ stack/native/trunk/ant-import-tests/build-testsuite.xml 2007-10-10 14:19:14 UTC (rev 4724)
@@ -179,7 +179,7 @@
<classpath location="${tests.output.dir}/resources/jaxws/samples/wssecurityAnnotatedpolicy"/>
</taskdef>
- <wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurity" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurity.HelloJavaBean"/>
+ <wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurity" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurity.HelloJavaBean" verbose="true"/>
<wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurityAnnotatedpolicy" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurityAnnotatedpolicy.HelloJavaBean"/>
</target>
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeDeserializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeDeserializer.java 2007-10-10 14:11:21 UTC (rev 4723)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeDeserializer.java 2007-10-10 14:19:14 UTC (rev 4724)
@@ -21,8 +21,11 @@
*/
package org.jboss.ws.core.binding;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.core.soap.MessageContextAssociation;
-
// $Id$
/**
@@ -34,4 +37,14 @@
public abstract class ComplexTypeDeserializer extends DeserializerSupport
{
+ protected BindingCustomization getBindingCustomization()
+ {
+ BindingCustomization bindingCustomization = null;
+ EndpointMetaData epMetaData = MessageContextAssociation.peekMessageContext().getEndpointMetaData();
+ if(epMetaData instanceof ServerEndpointMetaData)
+ {
+ bindingCustomization = ((ServerEndpointMetaData)epMetaData).getEndpoint().getAttachment(BindingCustomization.class);
+ }
+ return bindingCustomization;
+ }
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeSerializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeSerializer.java 2007-10-10 14:11:21 UTC (rev 4723)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeSerializer.java 2007-10-10 14:19:14 UTC (rev 4724)
@@ -21,9 +21,11 @@
*/
package org.jboss.ws.core.binding;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.core.soap.MessageContextAssociation;
-
-
// $Id: ComplexTypeSerializer.java 1757 2006-12-22 15:40:24Z thomas.diesler(a)jboss.com $
/**
@@ -34,5 +36,14 @@
*/
public abstract class ComplexTypeSerializer extends SerializerSupport
{
-
+ protected BindingCustomization getBindingCustomization()
+ {
+ BindingCustomization bindingCustomization = null;
+ EndpointMetaData epMetaData = MessageContextAssociation.peekMessageContext().getEndpointMetaData();
+ if(epMetaData instanceof ServerEndpointMetaData)
+ {
+ bindingCustomization = ((ServerEndpointMetaData)epMetaData).getEndpoint().getAttachment(BindingCustomization.class);
+ }
+ return bindingCustomization;
+ }
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java 2007-10-10 14:11:21 UTC (rev 4723)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java 2007-10-10 14:19:14 UTC (rev 4724)
@@ -21,18 +21,22 @@
*/
package org.jboss.ws.core.jaxws;
+import com.sun.xml.bind.api.JAXBRIContext;
+import com.sun.xml.bind.api.TypeReference;
+import com.sun.xml.bind.v2.model.annotation.RuntimeAnnotationReader;
+import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.wsf.spi.binding.BindingCustomization;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
-import java.util.Iterator;
+import java.util.Collection;
/**
* The default factory checks if a {@link JAXBBindingCustomization} exists
* and uses it to customize the JAXBContext that will be created.
+ * <p>
+ * It uses the {@link org.jboss.wsf.spi.invocation.EndpointAssociation} to access customizations.
*
* @see org.jboss.wsf.spi.deployment.Endpoint
* @see org.jboss.wsf.spi.binding.BindingCustomization
@@ -46,45 +50,54 @@
*/
public class CustomizableJAXBContextFactory extends JAXBContextFactory
{
+ protected Logger log = Logger.getLogger(CustomizableJAXBContextFactory.class);
+
+ public JAXBContext createContext(Class clazz) throws WSException
+ {
+ return createContext(new Class[] {clazz});
+ }
+
public JAXBContext createContext(Class[] clazzes) throws WSException
{
try
{
- BindingCustomization customization = getCustomization();
- if(null == customization)
- return JAXBContext.newInstance(clazzes);
- else
- return JAXBContext.newInstance(clazzes, customization);
+ return JAXBContext.newInstance(clazzes);
}
catch (JAXBException e) {
throw new WSException("Failed to create JAXBContext", e);
}
}
- public JAXBContext createContext(Class clazz) throws WSException
+ public JAXBContext createContext(Class[] clazzes, BindingCustomization bindingCustomization) throws WSException
{
- return createContext(new Class[] {clazz});
+ try
+ {
+ return JAXBContext.newInstance(clazzes, bindingCustomization);
+ }
+ catch (JAXBException e) {
+ throw new WSException("Failed to create JAXBContext", e);
+ }
}
- private BindingCustomization getCustomization()
+ public JAXBRIContext createContext(
+ Class[] classes, Collection<TypeReference> typeReferences,
+ String defaultNamespaceRemap, boolean c14nSupport, BindingCustomization bindingCustomization)
{
- BindingCustomization customization = null;
+ try
+ {
+ RuntimeAnnotationReader runtimeAnnotations = bindingCustomization!=null ?
+ (RuntimeAnnotationReader)bindingCustomization.get(JAXBRIContext.ANNOTATION_READER) : null;
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if(msgContext!=null) // may not be available anytime
- {
- Iterator<BindingCustomization> it = msgContext.getEndpointMetaData().getBindingCustomizations().iterator();
- while(it.hasNext())
- {
- BindingCustomization current = it.next();
- if(current instanceof JAXBBindingCustomization)
- {
- customization = current;
- break;
- }
- }
+ return JAXBRIContext.newInstance(
+ classes, typeReferences,
+ null,
+ defaultNamespaceRemap, c14nSupport ,
+ runtimeAnnotations
+ );
+
}
-
- return customization;
+ catch (JAXBException e) {
+ throw new WSException("Failed to create JAXBContext", e);
+ }
}
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBContextFactory.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBContextFactory.java 2007-10-10 14:11:21 UTC (rev 4723)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBContextFactory.java 2007-10-10 14:19:14 UTC (rev 4724)
@@ -23,9 +23,15 @@
import org.jboss.ws.WSException;
import org.jboss.wsf.spi.util.ServiceLoader;
+import org.jboss.wsf.spi.binding.BindingCustomization;
import javax.xml.bind.JAXBContext;
+import com.sun.xml.bind.api.TypeReference;
+import com.sun.xml.bind.api.JAXBRIContext;
+
+import java.util.Collection;
+
/**
* Creates JAXBContext's.<p>
*
@@ -36,10 +42,16 @@
public final static String DEFAULT_JAXB_CONTEXT_FACTORY = "org.jboss.ws.core.jaxws.CustomizableJAXBContextFactory";
+ public abstract JAXBContext createContext(Class[] clazzes, BindingCustomization bindingCustomization) throws WSException;
+
public abstract JAXBContext createContext(Class[] clazzes) throws WSException;
public abstract JAXBContext createContext(Class clazz) throws WSException;
+ public abstract JAXBRIContext createContext(
+ Class[] classes, Collection<TypeReference> typeReferences,
+ String defaultNamespaceRemap, boolean c14nSupport, BindingCustomization bindingCustomization);
+
/**
* Retrieve JAXBContextFactory instance through the {@link org.jboss.wsf.spi.util.ServiceLoader}.
* Defaults to {@link CustomizableJAXBContextFactory}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2007-10-10 14:11:21 UTC (rev 4723)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2007-10-10 14:19:14 UTC (rev 4724)
@@ -28,7 +28,12 @@
import org.jboss.ws.core.binding.TypeMappingImpl;
import org.jboss.ws.core.binding.ComplexTypeDeserializer;
import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.binding.BindingCustomization;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
@@ -88,11 +93,13 @@
* @return JAXBContext
*/
private JAXBContext getJAXBContext(Class[] types){
+
JAXBContextCache cache = JAXBContextCache.getContextCache();
JAXBContext context = cache.get(types);
if(null==context)
{
- context = JAXBContextFactory.newInstance().createContext(types);
+ BindingCustomization bindingCustomization = getBindingCustomization();
+ context = JAXBContextFactory.newInstance().createContext(types, bindingCustomization);
cache.add(types, context);
}
return context;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2007-10-10 14:11:21 UTC (rev 4723)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2007-10-10 14:19:14 UTC (rev 4724)
@@ -29,6 +29,7 @@
import org.jboss.ws.core.binding.ComplexTypeSerializer;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.binding.BufferedStreamResult;
+import org.jboss.wsf.spi.binding.BindingCustomization;
import org.w3c.dom.NamedNodeMap;
import javax.xml.bind.JAXBContext;
@@ -99,7 +100,8 @@
JAXBContext context = cache.get(types);
if(null==context)
{
- context = JAXBContextFactory.newInstance().createContext(types);
+ BindingCustomization bindingCustomization = getBindingCustomization();
+ context = JAXBContextFactory.newInstance().createContext(types, bindingCustomization);
cache.add(types, context);
}
return context;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-10-10 14:11:21 UTC (rev 4723)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-10-10 14:19:14 UTC (rev 4724)
@@ -23,42 +23,13 @@
// $Id$
-import java.io.File;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.rmi.RemoteException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import javax.jws.HandlerChain;
-import javax.jws.Oneway;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPMessageHandlers;
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.ws.BindingType;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
-import javax.xml.ws.WebFault;
-import javax.xml.ws.addressing.Action;
-import javax.xml.ws.addressing.AddressingProperties;
-
+import com.sun.xml.bind.api.JAXBRIContext;
+import com.sun.xml.bind.api.TypeReference;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
+import org.jboss.ws.core.jaxws.JAXBContextFactory;
import org.jboss.ws.core.jaxws.WrapperGenerator;
import org.jboss.ws.core.soap.Style;
import org.jboss.ws.core.soap.Use;
@@ -75,6 +46,7 @@
import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.TypeMappingMetaData;
import org.jboss.ws.metadata.umdm.TypesMetaData;
import org.jboss.ws.metadata.umdm.WrappedParameter;
@@ -83,18 +55,47 @@
import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLMIMEPart;
+import org.jboss.wsf.common.JavaUtils;
+import org.jboss.wsf.spi.binding.BindingCustomization;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.HandlerChainsObjectFactory;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
-import org.jboss.wsf.common.JavaUtils;
+import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
-import com.sun.xml.bind.api.JAXBRIContext;
-import com.sun.xml.bind.api.TypeReference;
+import javax.jws.HandlerChain;
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.jws.soap.SOAPMessageHandlers;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+import javax.xml.ws.WebFault;
+import javax.xml.ws.addressing.Action;
+import javax.xml.ws.addressing.AddressingProperties;
+import java.io.File;
+import java.io.InputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
/**
* Abstract class that represents a JAX-WS metadata builder.
@@ -940,9 +941,27 @@
String targetNS = epMetaData.getPortTypeName().getNamespaceURI().intern();
if (log.isDebugEnabled())
log.debug("JAXBContext [types=" + javaTypes + ",tns=" + targetNS + "]");
- jaxbCtx = JAXBRIContext.newInstance(javaTypes.toArray(new Class[0]), typeRefs, targetNS, false);
+
+ JAXBContextFactory factory = JAXBContextFactory.newInstance();
+
+
+ // JAXBIntros may mofiy the WSDL being generated
+ // only true for server side invocation, tooling (WSProvide) doesnt support this
+ BindingCustomization bindingCustomization = null;
+ if(epMetaData instanceof ServerEndpointMetaData)
+ {
+ Endpoint endpoint = ((ServerEndpointMetaData)epMetaData).getEndpoint();
+ bindingCustomization = endpoint!=null ? endpoint.getAttachment(BindingCustomization.class) : null;
+ }
+
+ jaxbCtx = factory.createContext(
+ javaTypes.toArray(new Class[0]),
+ typeRefs,
+ targetNS,
+ false, bindingCustomization
+ );
}
- catch (JAXBException ex)
+ catch (WSException ex)
{
throw new IllegalStateException("Cannot build JAXB context", ex);
}
Modified: stack/native/trunk/src/main/resources/jbossws-native-config.xml
===================================================================
--- stack/native/trunk/src/main/resources/jbossws-native-config.xml 2007-10-10 14:11:21 UTC (rev 4723)
+++ stack/native/trunk/src/main/resources/jbossws-native-config.xml 2007-10-10 14:19:14 UTC (rev 4724)
@@ -61,7 +61,7 @@
</bean>
<bean name="WSNativePublishContractDeploymentAspect" class="org.jboss.wsf.stack.jbws.PublishContractDeploymentAspect">
- <property name="requires">UnifiedMetaDataModel</property>
+ <property name="requires">UnifiedMetaDataModel, JAXBIntros</property>
<property name="provides">PublishedContract</property>
</bean>
@@ -70,12 +70,12 @@
</bean>
<bean name="WSNativeUnifiedMetaDataDeploymentAspect" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect">
- <property name="requires">RuntimeLoader, ContainerMetaData, URLPattern, VFSRoot</property>
+ <property name="requires">RuntimeLoader, ContainerMetaData, URLPattern, VFSRoot, JAXBIntros</property>
<property name="provides">UnifiedMetaDataModel</property>
</bean>
- <bean name="WSJAXBIntroDeploymentAspect" class="org.jboss.wsf.stack.jbws.JAXBIntroDeploymentAspect">
- <property name="requires">UnifiedMetaDataModel, RuntimeLoader</property>
+ <bean name="WSJAXBIntroDeploymentAspect" class="org.jboss.wsf.stack.jbws.JAXBIntroDeploymentAspect">
+ <property name="provides">JAXBIntros</property>
</bean>
<!-- Deployment aspect installers -->
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jaxbintros/JAXBIntroTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jaxbintros/JAXBIntroTestCase.java 2007-10-10 14:11:21 UTC (rev 4723)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jaxbintros/JAXBIntroTestCase.java 2007-10-10 14:19:14 UTC (rev 4724)
@@ -55,7 +55,7 @@
{
return new JBossWSTestSetup(JAXBIntroTestCase.class, "jaxws-jaxbintros.war");
}
-
+
public void testWSDLAccess() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jaxbintros/ProviderEndpoint?wsdl");
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/DocRequest.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/DocRequest.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/DocRequest.java 2007-10-10 14:19:14 UTC (rev 4724)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws1809;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class DocRequest
+{
+ String value;
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/DocRequest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/DocResponse.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/DocResponse.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/DocResponse.java 2007-10-10 14:19:14 UTC (rev 4724)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws1809;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class DocResponse
+{
+ String value;
+
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/DocResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/Endpoint.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/Endpoint.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/Endpoint.java 2007-10-10 14:19:14 UTC (rev 4724)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws1809;
+
+import javax.ejb.Remote;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+@Remote
+@WebService(targetNamespace = "http://org.jboss.ws/jaxbintro/wsdl")
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface Endpoint
+{
+ DocResponse processDocument(DocRequest req);
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/Endpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/EndpointImpl.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/EndpointImpl.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/EndpointImpl.java 2007-10-10 14:19:14 UTC (rev 4724)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws1809;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+@Stateless
+@WebService(
+ targetNamespace = "http://org.jboss.ws/jaxbintro/wsdl",
+ endpointInterface = "org.jboss.test.ws.jaxws.jbws1809.Endpoint"
+)
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public class EndpointImpl implements Endpoint
+{
+ public DocResponse processDocument(DocRequest req)
+ {
+ DocResponse res = new DocResponse();
+ res.setValue(req.getValue()+"Response");
+ return res;
+ }
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/EndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/JBWS1809TestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/JBWS1809TestCase.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/JBWS1809TestCase.java 2007-10-10 14:19:14 UTC (rev 4724)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws1809;
+
+import junit.framework.Test;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.metadata.wsdl.DOMTypes;
+import org.jboss.ws.metadata.wsdl.XSModelTypes;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.util.Iterator;
+
+/**
+ * Test the JAXBIntroduction features.
+ *
+ * Check if the WSDL is generated correctly.
+ * The introduction should turn a property into a xsd:attribute declaration.
+ *
+ * @author heiko.braun(a)jboss.com
+ */
+public class JBWS1809TestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS1809TestCase.class, "jaxws-jbws1809.jar");
+ }
+
+ public void testWSDLAccess() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws1809/EndpointImpl?wsdl");
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
+ assertNotNull("Unable to read WSDL definitions", wsdlDefinitions);
+
+ XSModelTypes wsdlTypes = (XSModelTypes)wsdlDefinitions.getWsdlTypes();
+
+ // convert XSModelTypes to dom representation
+ // it's easier to consume...
+
+ Element types = DOMUtils.parse(wsdlTypes.getSchemaModel().serialize());
+ Iterator it = DOMUtils.getChildElements(types, "complexType");
+
+ boolean foundAttributeDeclaration = false;
+ while(it.hasNext())
+ {
+ Element next = (Element)it.next();
+ if(DOMUtils.getAttributeValue(next, "name").equals("docRequest"))
+ {
+ Iterator it2 = DOMUtils.getChildElements(next, "attribute");
+
+ while(it2.hasNext())
+ {
+ Element next2 = (Element)it2.next();
+ if(DOMUtils.getAttributeValue(next2, "name").equals("value"))
+ {
+ foundAttributeDeclaration = true;
+ }
+ }
+ }
+ }
+
+ assertTrue("JAXBIntros should turn the 'docRequest.name' property into a XML attribute", foundAttributeDeclaration);
+
+ }
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1809/JBWS1809TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/jbws1809/META-INF/jaxb-intros.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/jbws1809/META-INF/jaxb-intros.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/jbws1809/META-INF/jaxb-intros.xml 2007-10-10 14:19:14 UTC (rev 4724)
@@ -0,0 +1,26 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jaxb-intros xmlns="http://www.jboss.org/xsd/jaxb/intros" default-namespace="http://org.jboss.ws/jaxbintro/wsdl">
+
+ <!--
+ The XSD for the schema can be found at:
+ http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/extras/jaxbintr...
+ Register it against the http://www.jboss.org/xsd/jaxb/intros namespace in your IDE and away you go :-)
+ -->
+
+ <!--
+ Note: how the "name" attributes on class, field and method configs can be regular expressions.
+ -->
+
+ <!--
+ The type namespaces on the customerOrder are different from the rest of the message...
+ -->
+ <Class name="org.jboss.test.ws.jaxws.jbws1809.DocRequest">
+ <XmlAccessorType value="FIELD"/>
+ <XmlRootElement name="request" namespace="http://org.jboss.ws/jaxbintro/wsdl"/>
+
+ <Field name="value">
+ <XmlAttribute />
+ </Field>
+ </Class>
+
+</jaxb-intros>
Property changes on: stack/native/trunk/src/test/resources/jaxws/jbws1809/META-INF/jaxb-intros.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 2 months
JBossWS SVN: r4723 - stack/native/branches.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-10-10 10:11:21 -0400 (Wed, 10 Oct 2007)
New Revision: 4723
Added:
stack/native/branches/jbossws-native-2.0.1.SP2/
Log:
Create jbossws-native-2.0.1.SP2
Copied: stack/native/branches/jbossws-native-2.0.1.SP2 (from rev 4722, stack/native/tags/jbossws-native-2.0.1.SP1)
17 years, 2 months
JBossWS SVN: r4722 - in framework/trunk: ant-import and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-10-10 08:47:47 -0400 (Wed, 10 Oct 2007)
New Revision: 4722
Modified:
framework/trunk/.classpath
framework/trunk/ant-import/build-thirdparty.xml
framework/trunk/version.properties
Log:
Fix eclipse classpath
Modified: framework/trunk/.classpath
===================================================================
--- framework/trunk/.classpath 2007-10-10 10:22:30 UTC (rev 4721)
+++ framework/trunk/.classpath 2007-10-10 12:47:47 UTC (rev 4722)
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3.8.1"/>
<classpathentry kind="lib" path="thirdparty/jboss-common-core.jar"/>
@@ -15,5 +14,7 @@
<classpathentry kind="lib" path="thirdparty/saaj-api.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/spi"/>
<classpathentry combineaccessrules="false" kind="src" path="/common"/>
+ <classpathentry kind="lib" path="thirdparty/activation.jar"/>
+ <classpathentry kind="lib" path="thirdparty/jaxb-api.jar"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Modified: framework/trunk/ant-import/build-thirdparty.xml
===================================================================
--- framework/trunk/ant-import/build-thirdparty.xml 2007-10-10 10:22:30 UTC (rev 4721)
+++ framework/trunk/ant-import/build-thirdparty.xml 2007-10-10 12:47:47 UTC (rev 4722)
@@ -48,6 +48,8 @@
<get src="${jboss.repository}/jboss/jboss-javaee/${jboss-javaee}/lib/jboss-javaee.jar" dest="${thirdparty.dir}/jboss-javaee.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossxb/${jboss-jbossxb}/lib/jboss-xml-binding.jar" dest="${thirdparty.dir}/jboss-xml-binding.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossxb/${jboss-jbossxb}/lib/jboss-xml-binding-sources.jar" dest="${thirdparty.dir}/jboss-xml-binding-sources.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaf/${sun-jaf}/lib/activation.jar" dest="${thirdparty.dir}/activation.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-api.jar" dest="${thirdparty.dir}/jaxb-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxrpc/${sun-jaxrpc}/lib/jaxrpc-api.jar" dest="${thirdparty.dir}/jaxrpc-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-api.jar" dest="${thirdparty.dir}/jaxws-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jsr181-api.jar" dest="${thirdparty.dir}/jsr181-api.jar" usetimestamp="true" verbose="true"/>
Modified: framework/trunk/version.properties
===================================================================
--- framework/trunk/version.properties 2007-10-10 10:22:30 UTC (rev 4721)
+++ framework/trunk/version.properties 2007-10-10 12:47:47 UTC (rev 4722)
@@ -23,6 +23,8 @@
jboss-javaee=5.0.0-SNAPSHOT
jboss-microcontainer=2.0.0.Beta3
jboss-jbossxb=1.0.0.GA
+sun-jaf=1.1
+sun-jaxb=2.1.4
sun-jaxrpc=1.1
sun-jaxws=2.1.1
17 years, 2 months
JBossWS SVN: r4721 - in framework/trunk: eclipse and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-10-10 06:22:30 -0400 (Wed, 10 Oct 2007)
New Revision: 4721
Modified:
framework/trunk/eclipse/jbossws.userlibraries
framework/trunk/version.properties
Log:
Use version 2.0.2.GA
Modified: framework/trunk/eclipse/jbossws.userlibraries
===================================================================
--- framework/trunk/eclipse/jbossws.userlibraries 2007-10-10 10:18:46 UTC (rev 4720)
+++ framework/trunk/eclipse/jbossws.userlibraries 2007-10-10 10:22:30 UTC (rev 4721)
@@ -31,6 +31,7 @@
<archive path="/home/tdiesler/svn/jbossas/tags/JBoss_4_2_1_GA/build/output/jboss-4.2.1.GA/lib/jboss-xml-binding.jar"/>
<archive path="/home/tdiesler/svn/jbossas/tags/JBoss_4_2_1_GA/build/output/jboss-4.2.1.GA/server/default/lib/servlet-api.jar"/>
<archive path="/home/tdiesler/svn/jbossas/tags/JBoss_4_2_1_GA/build/output/jboss-4.2.1.GA/server/default/lib/jbosssx.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.2.GA/server/default/lib/jbossws-jboss42.jar" source="/home/tdiesler/svn/jbossas/branches/Branch_4_2/webservices/src/main"/>
</library>
<library name="jboss-5.0.x" systemlibrary="false">
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-aop-jdk50.jar"/>
@@ -56,5 +57,6 @@
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-deployers-spi.jar"/>
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-deployers-client-spi.jar"/>
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-deployers-vfs-spi.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/jbossws.deployer/jbossws-jboss50.jar" source="/home/tdiesler/svn/jbossas/trunk/webservices/src/main"/>
</library>
</eclipse-userlibraries>
Modified: framework/trunk/version.properties
===================================================================
--- framework/trunk/version.properties 2007-10-10 10:18:46 UTC (rev 4720)
+++ framework/trunk/version.properties 2007-10-10 10:22:30 UTC (rev 4721)
@@ -5,7 +5,7 @@
specification.vendor=JBoss (http://www.jboss.org)
specification.version=jbossws-2.0
-version.id=2.1.0.DEV
+version.id=2.0.2.GA
repository.id=snapshot
implementation.title=JBoss Web Services - Framework
17 years, 2 months
JBossWS SVN: r4720 - framework/trunk/src/main/java/org/jboss/wsf/framework/deployment.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-10-10 06:18:46 -0400 (Wed, 10 Oct 2007)
New Revision: 4720
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java
Log:
[JBWS-1808] BackwardCompatibleURLPatternDeploymentAspect is mangling valid URLpatterns
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java 2007-10-10 10:14:16 UTC (rev 4719)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java 2007-10-10 10:18:46 UTC (rev 4720)
@@ -56,7 +56,7 @@
urlPattern = "/" + urlPattern;
StringTokenizer st = new StringTokenizer(urlPattern, "/");
- if (st.countTokens() > 1 && urlPattern.startsWith(contextRoot))
+ if (st.countTokens() > 1 && urlPattern.startsWith(contextRoot + "/"))
{
urlPattern = urlPattern.substring(contextRoot.length());
}
17 years, 2 months
JBossWS SVN: r4719 - in stack/native/trunk/src/main/java/org/jboss/ws/extensions/addressing: jaxws and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-10-10 06:14:16 -0400 (Wed, 10 Oct 2007)
New Revision: 4719
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
Log:
[JBWS-1811] Cannot access CLIENT_ADDRESSING_PROPERTIES inside client
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java 2007-10-10 09:33:19 UTC (rev 4718)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java 2007-10-10 10:14:16 UTC (rev 4719)
@@ -35,12 +35,9 @@
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import org.jboss.logging.Logger;
+import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
import org.jboss.ws.extensions.addressing.soap.SOAPAddressingPropertiesImpl;
-import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
-import java.util.Set;
-import java.util.HashSet;
-
/**
* A client side handler that reads/writes the addressing properties
* and puts then into the message context.
@@ -55,35 +52,38 @@
private static AddressingBuilder ADDR_BUILDER;
private static AddressingConstantsImpl ADDR_CONSTANTS;
- private static QName[] HEADERS = new QName[2];
+ private static QName[] HEADERS = new QName[2];
- static
+ static
{
ADDR_CONSTANTS = new AddressingConstantsImpl();
ADDR_BUILDER = AddressingBuilder.getAddressingBuilder();
- HEADERS[0] = ADDR_CONSTANTS.getActionQName();
- HEADERS[1] = ADDR_CONSTANTS.getToQName();
- }
-
- public QName[] getHeaders()
+ HEADERS[0] = ADDR_CONSTANTS.getActionQName();
+ HEADERS[1] = ADDR_CONSTANTS.getToQName();
+ }
+
+ public QName[] getHeaders()
{
return HEADERS;
}
public void init(HandlerInfo handlerInfo)
{
- super.init(handlerInfo);
+ super.init(handlerInfo);
}
public boolean handleRequest(MessageContext msgContext)
{
- if(log.isDebugEnabled()) log.debug("handleRequest");
+ log.debug("handleRequest");
- SOAPAddressingProperties addrProps = (SOAPAddressingProperties)msgContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ SOAPAddressingProperties addrProps = (SOAPAddressingProperties)msgContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES);
+ if (addrProps != null)
+ msgContext.setProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);
+ addrProps = (SOAPAddressingProperties)msgContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
if (addrProps != null)
- {
+ {
SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
addrProps.writeHeaders(soapMessage);
}
@@ -99,7 +99,7 @@
public boolean handleResponse(MessageContext msgContext)
{
- if(log.isDebugEnabled()) log.debug("handleResponse");
+ log.debug("handleResponse");
try
{
@@ -109,6 +109,7 @@
SOAPAddressingBuilder builder = (SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
SOAPAddressingProperties addrProps = (SOAPAddressingProperties)builder.newAddressingProperties();
addrProps.readHeaders(soapMessage);
+ msgContext.setProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addrProps);
msgContext.setProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, addrProps);
}
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2007-10-10 09:33:19 UTC (rev 4718)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2007-10-10 10:14:16 UTC (rev 4719)
@@ -74,9 +74,16 @@
protected boolean handleOutbound(MessageContext msgContext)
{
- if(log.isDebugEnabled()) log.debug("handleOutbound");
+ log.debug("handleOutbound");
- SOAPAddressingProperties addrProps = (SOAPAddressingProperties)msgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ SOAPAddressingProperties addrProps = (SOAPAddressingProperties)msgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES);
+ if (addrProps != null)
+ {
+ msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);
+ msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION);
+ }
+
+ addrProps = (SOAPAddressingProperties)msgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
if (addrProps != null)
{
SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
@@ -95,7 +102,7 @@
protected boolean handleInbound(MessageContext msgContext)
{
- if(log.isDebugEnabled()) log.debug("handleInbound");
+ log.debug("handleInbound");
try
{
@@ -105,8 +112,10 @@
SOAPAddressingBuilder builder = (SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
SOAPAddressingProperties addrProps = (SOAPAddressingProperties)builder.newAddressingProperties();
addrProps.readHeaders(soapMessage);
- msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, addrProps);
- msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, Scope.APPLICATION);
+ msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addrProps);
+ 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);
}
}
catch (SOAPException ex)
@@ -116,5 +125,4 @@
return true;
}
-
-}
+}
\ No newline at end of file
17 years, 2 months