JBossWS SVN: r16207 - in common/trunk/src: test/java/org/jboss/test/ws/common and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-04-24 02:52:26 -0400 (Tue, 24 Apr 2012)
New Revision: 16207
Added:
common/trunk/src/test/java/org/jboss/test/ws/common/management/
common/trunk/src/test/java/org/jboss/test/ws/common/management/DefaultEndpointRegistryTestCase.java
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java
Log:
[JBWS-3491] prevent concurrent modification exceptions in default endpoint registry
Modified: common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java 2012-04-24 06:33:29 UTC (rev 16206)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java 2012-04-24 06:52:26 UTC (rev 16207)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, 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.
*
@@ -21,10 +21,10 @@
*/
package org.jboss.ws.common.management;
-import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import javax.management.ObjectName;
@@ -38,6 +38,8 @@
* A general endpoint registry.
*
* @author Thomas.Diesler(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
+ *
* @since 20-Apr-2007
*/
public class DefaultEndpointRegistry implements EndpointRegistry
@@ -46,7 +48,7 @@
// provide logging
private static final Logger log = Logger.getLogger(DefaultEndpointRegistry.class);
- private Map<ObjectName, Endpoint> endpoints = new HashMap<ObjectName, Endpoint>();
+ private Map<ObjectName, Endpoint> endpoints = new ConcurrentHashMap<ObjectName, Endpoint>();
public Endpoint getEndpoint(ObjectName epName)
{
Added: common/trunk/src/test/java/org/jboss/test/ws/common/management/DefaultEndpointRegistryTestCase.java
===================================================================
--- common/trunk/src/test/java/org/jboss/test/ws/common/management/DefaultEndpointRegistryTestCase.java (rev 0)
+++ common/trunk/src/test/java/org/jboss/test/ws/common/management/DefaultEndpointRegistryTestCase.java 2012-04-24 06:52:26 UTC (rev 16207)
@@ -0,0 +1,408 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.common.management;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+import javax.management.ObjectName;
+
+import org.jboss.ws.api.monitoring.Record;
+import org.jboss.ws.api.monitoring.RecordProcessor;
+import org.jboss.ws.common.management.DefaultEndpointRegistry;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.EndpointState;
+import org.jboss.wsf.spi.deployment.EndpointType;
+import org.jboss.wsf.spi.deployment.InstanceProvider;
+import org.jboss.wsf.spi.deployment.LifecycleHandler;
+import org.jboss.wsf.spi.deployment.Service;
+import org.jboss.wsf.spi.invocation.InvocationHandler;
+import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.management.EndpointMetrics;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.security.SecurityDomainContext;
+
+import junit.framework.TestCase;
+
+/**
+ * Test the DefaultEndpointRegistry
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 23-Apr-2012
+ */
+public class DefaultEndpointRegistryTestCase extends TestCase
+{
+ public void testSingleThreadAccess() throws Exception {
+ final int MAX = 10;
+ DefaultEndpointRegistry reg = new DefaultEndpointRegistry();
+ for (int i = 0; i < MAX; i++) {
+ Endpoint ep = getTestEndpoint("Foo" + i, "prop", "v" + i);
+ reg.register(ep);
+ }
+
+ Iterator<ObjectName> it = reg.getEndpoints().iterator();
+ checkContents(it, MAX);
+
+ reg.register(getTestEndpoint("Foo" + MAX, "prop", "v" + MAX));
+
+ assertFalse(it.hasNext());
+ checkContents(reg.getEndpoints().iterator(), MAX + 1);
+ }
+
+ public void testConcurrentAccess() throws Exception {
+ DefaultEndpointRegistry reg = new DefaultEndpointRegistry();
+ reg.register(getTestEndpoint("Test", "prop", "my-value"));
+ ExecutorService es = Executors.newFixedThreadPool(2);
+ List<Callable<Boolean>> callables = new LinkedList<Callable<Boolean>>();
+ final int size = 10;
+ for (int i = 1; i <= 10; i++) {
+ callables.add(new Register(reg, "Foo", i * size, size));
+ }
+ callables.add(new Reader(reg, "my-value"));
+ for (int i = 11; i <= 20; i++) {
+ callables.add(new Register(reg, "Foo", i * size, size));
+ }
+ callables.add(new Reader(reg, "my-value"));
+
+ List<Future<Boolean>> results = es.invokeAll(callables);
+ for (Future<Boolean> f : results) {
+ assertTrue(f.get(10, TimeUnit.SECONDS));
+ }
+ es.shutdown();
+ }
+
+ private class Register implements Callable<Boolean> {
+ private final EndpointRegistry reg;
+ private final String name;
+ private final int base;
+ private final int n;
+
+ public Register(EndpointRegistry reg, String name, int base, int n) {
+ this.reg = reg;
+ this.name = name;
+ this.base = base;
+ this.n = n;
+ }
+
+ @Override
+ public Boolean call() throws Exception
+ {
+ for (int i = base; i < (base + n); i++) {
+ try {
+ Endpoint ep = getTestEndpoint(name + i, "prop", "v" + i);
+ reg.register(ep);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ return true;
+ }
+ }
+
+ private class Reader implements Callable<Boolean> {
+ private final EndpointRegistry reg;
+ private final String value;
+
+ public Reader(EndpointRegistry reg, String value) {
+ this.reg = reg;
+ this.value = value;
+ }
+
+ @Override
+ public Boolean call() throws Exception
+ {
+ boolean result = false;
+ //below is what org.jboss.wsf.stack.cxf.transport.ServletHelper does for instance
+ for (ObjectName on : reg.getEndpoints()) {
+ if (on.getKeyProperty("prop").equalsIgnoreCase(value)) {
+ result = true; //do not early exit
+ }
+ }
+ return result;
+ }
+
+ }
+
+ private static void checkContents(Iterator<ObjectName> it, int n) {
+ List<String> values = new LinkedList<String>();
+ for (int i = 0; i < n; i++) {
+ values.add("v" + i);
+ }
+ while (it.hasNext()) {
+ String p = it.next().getKeyProperty("prop");
+ if (values.contains(p)) {
+ values.remove(p);
+ }
+ }
+ assertTrue("Could not find " + values, values.isEmpty());
+ }
+
+ private static Endpoint getTestEndpoint(String name, String prop, String value) throws Exception {
+ final ObjectName objName = new ObjectName(name, prop, value);
+ return new Endpoint()
+ {
+
+ @Override
+ public void setProperty(String key, Object value)
+ {
+
+ }
+
+ @Override
+ public void setProperties(Map<String, Object> props)
+ {
+
+ }
+
+ @Override
+ public void removeProperty(String key)
+ {
+
+ }
+
+ @Override
+ public <T> T removeAttachment(Class<T> key)
+ {
+ return null;
+ }
+
+ @Override
+ public Object getProperty(String key)
+ {
+ return null;
+ }
+
+ @Override
+ public Set<String> getProperties()
+ {
+ return null;
+ }
+
+ @Override
+ public <T> Collection<T> getAttachments()
+ {
+ return null;
+ }
+
+ @Override
+ public <T> T getAttachment(Class<T> key)
+ {
+ return null;
+ }
+
+ @Override
+ public <T> T addAttachment(Class<T> key, Object value)
+ {
+ return null;
+ }
+
+ @Override
+ public void setType(EndpointType type)
+ {
+
+ }
+
+ @Override
+ public void setTargetBeanName(String epImpl)
+ {
+
+ }
+
+ @Override
+ public void setState(EndpointState state)
+ {
+
+ }
+
+ @Override
+ public void setShortName(String shortName)
+ {
+
+ }
+
+ @Override
+ public void setService(Service service)
+ {
+
+ }
+
+ @Override
+ public void setSecurityDomainContext(SecurityDomainContext context)
+ {
+
+ }
+
+ @Override
+ public void setRequestHandler(RequestHandler handler)
+ {
+
+ }
+
+ @Override
+ public void setRecordProcessors(List<RecordProcessor> recordProcessors)
+ {
+
+ }
+
+ @Override
+ public void setName(ObjectName epName)
+ {
+
+ }
+
+ @Override
+ public void setLifecycleHandler(LifecycleHandler handler)
+ {
+
+ }
+
+ @Override
+ public void setInvocationHandler(InvocationHandler invoker)
+ {
+
+ }
+
+ @Override
+ public void setInstanceProvider(InstanceProvider provider)
+ {
+
+ }
+
+ @Override
+ public void setEndpointMetrics(EndpointMetrics metrics)
+ {
+
+ }
+
+ @Override
+ public void setAddress(String address)
+ {
+
+ }
+
+ @Override
+ public void processRecord(Record record)
+ {
+
+ }
+
+ @Override
+ public EndpointType getType()
+ {
+ return null;
+ }
+
+ @Override
+ public String getTargetBeanName()
+ {
+ return null;
+ }
+
+ @Override
+ public Class getTargetBeanClass()
+ {
+ return null;
+ }
+
+ @Override
+ public EndpointState getState()
+ {
+ return null;
+ }
+
+ @Override
+ public String getShortName()
+ {
+ return null;
+ }
+
+ @Override
+ public Service getService()
+ {
+ return null;
+ }
+
+ @Override
+ public SecurityDomainContext getSecurityDomainContext()
+ {
+ return null;
+ }
+
+ @Override
+ public RequestHandler getRequestHandler()
+ {
+ return null;
+ }
+
+ @Override
+ public List<RecordProcessor> getRecordProcessors()
+ {
+ return null;
+ }
+
+ @Override
+ public ObjectName getName()
+ {
+ return objName;
+ }
+
+ @Override
+ public LifecycleHandler getLifecycleHandler()
+ {
+ return null;
+ }
+
+ @Override
+ public InvocationHandler getInvocationHandler()
+ {
+ return null;
+ }
+
+ @Override
+ public InstanceProvider getInstanceProvider()
+ {
+ return null;
+ }
+
+ @Override
+ public EndpointMetrics getEndpointMetrics()
+ {
+ return null;
+ }
+
+ @Override
+ public String getAddress()
+ {
+ return null;
+ }
+ };
+ }
+}
12 years, 8 months
JBossWS SVN: r16206 - in stack/native/branches/jbossws-native-3.1.2/modules: core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2012-04-24 02:33:29 -0400 (Tue, 24 Apr 2012)
New Revision: 16206
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/NativeEndpointReferenceTestCase.java
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java
Log:
[JBPAPP-8810]:Back port the fix for JBWS-2937
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2012-04-20 15:05:19 UTC (rev 16205)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2012-04-24 06:33:29 UTC (rev 16206)
@@ -24,6 +24,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
+import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.transform.Source;
@@ -118,25 +119,34 @@
return bindingId;
}
- @Override
- public W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName, List<Element> metadata, String wsdlDocumentLocation,
- List<Element> referenceParameters)
+ public W3CEndpointReference createW3CEndpointReference(final String address, final QName interfaceName,
+ final QName serviceName, final QName portName, final List<Element> metadata, final String wsdlDocumentLocation,
+ final List<Element> referenceParameters, final List<Element> elements, final Map<QName, String> attributes)
{
if ((serviceName == null) && (address == null) && (portName == null))
throw new IllegalStateException();
if ((portName != null) && (serviceName == null))
throw new IllegalStateException();
-
- NativeEndpointReference epr = new NativeEndpointReference();
+
+ final NativeEndpointReference epr = new NativeEndpointReference();
epr.setAddress(address);
epr.setServiceName(serviceName);
epr.setEndpointName(portName);
+ epr.setInterfaceName(interfaceName);
epr.setMetadata(metadata);
epr.setWsdlLocation(wsdlDocumentLocation);
epr.setReferenceParameters(referenceParameters);
+
return EndpointReferenceUtil.transform(W3CEndpointReference.class, epr);
}
+ public W3CEndpointReference createW3CEndpointReference(final String address, final QName serviceName,
+ final QName portName, final List<Element> metadata, final String wsdlDocumentLocation,
+ final List<Element> referenceParameters)
+ {
+ return createW3CEndpointReference(address, null, serviceName, portName, metadata, wsdlDocumentLocation, referenceParameters, null, null);
+ }
+
@Override
public <T> T getPort(EndpointReference epr, Class<T> sei, WebServiceFeature... features)
{
@@ -157,8 +167,9 @@
throw new NullPointerException("Provided eprInfoset cannot be null");
try
{
- //we currently support W3CEndpointReference only
- return new W3CEndpointReference(eprInfoset);
+ final NativeEndpointReference nativeEPR = new NativeEndpointReference(eprInfoset);
+ final Source source = EndpointReferenceUtil.getSourceFromEndpointReference(nativeEPR);
+ return new W3CEndpointReference(source);
}
catch (Exception e)
{
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java 2012-04-20 15:05:19 UTC (rev 16205)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java 2012-04-24 06:33:29 UTC (rev 16206)
@@ -68,7 +68,7 @@
throw new WebServiceException("EndpointReference of type " + clazz + " not supported.");
}
- private static Source getSourceFromEndpointReference(EndpointReference epr)
+ public static Source getSourceFromEndpointReference(EndpointReference epr)
{
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
StreamResult result = new StreamResult(outputStream);
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java 2012-04-20 15:05:19 UTC (rev 16205)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java 2012-04-24 06:33:29 UTC (rev 16206)
@@ -23,8 +23,11 @@
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
@@ -41,7 +44,7 @@
import javax.xml.transform.Source;
import javax.xml.ws.EndpointReference;
import javax.xml.ws.WebServiceException;
-
+import org.jboss.wsf.common.DOMUtils;
import org.w3c.dom.Element;
/**
@@ -53,35 +56,40 @@
* @see EndpointReferenceUtil class.
*
* @author alessio.soldano(a)jboss.com
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @since 28-Feb-2009
- *
*/
-
-// XmlRootElement allows this class to be marshalled on its own
-@XmlRootElement(name = "EndpointReference", namespace = NativeEndpointReference.NS)
-@XmlType(name = "EndpointReferenceType", namespace = NativeEndpointReference.NS)
+@XmlRootElement(name = "EndpointReference", namespace = NativeEndpointReference.WSA_NS)
+@XmlType(name = "EndpointReferenceType", namespace = NativeEndpointReference.WSA_NS)
public final class NativeEndpointReference extends EndpointReference
{
- protected static final String NS = "http://www.w3.org/2005/08/addressing";
+ protected static final String WSA_NS = "http://www.w3.org/2005/08/addressing";
+ private static final String WSAM_NS = "http://www.w3.org/2007/05/addressing/metadata";
+ private static final String WSDLI_NS = "http://www.w3.org/ns/wsdl-instance";
+ private static final QName SERVICE_QNAME = new QName(WSAM_NS, "ServiceName", "wsam");
+ private static final QName INTERFACE_QNAME = new QName(WSAM_NS, "InterfaceName", "wsam");
+ private static final QName WSDL_LOCATION_QNAME = new QName(WSDLI_NS, "wsdlLocation", "wsdli");
+ private static final String ENDPOINT_ATTRIBUTE = "EndpointName";
+ private static final JAXBContext jc = getJaxbContext();
- private final static JAXBContext jc = getJaxbContext();
-
// private but necessary properties for databinding
- @XmlElement(name = "Address", namespace = NS)
+ @XmlElement(name = "Address", namespace = WSA_NS)
private Address address;
- @XmlElement(name = "ReferenceParameters", namespace = NS)
+ @XmlElement(name = "ReferenceParameters", namespace = WSA_NS)
private Elements referenceParameters;
- @XmlElement(name = "Metadata", namespace = NS)
+ @XmlElement(name = "Metadata", namespace = WSA_NS)
private Elements metadata;
@XmlAnyAttribute
- Map<QName, String> attributes;
+ private Map<QName, String> attributes;
@XmlAnyElement
- List<Element> elements;
+ private List<Element> elements;
// not marshalled
private QName serviceName;
+ private Element serviceNameElement;
private QName endpointName;
- private URL wsdlLocation;
+ private QName interfaceName;
+ private String wsdlLocation;
public NativeEndpointReference()
{
@@ -106,16 +114,67 @@
{
NativeEndpointReference epr = jc.createUnmarshaller().unmarshal(source, NativeEndpointReference.class).getValue();
this.address = epr.address;
- this.metadata = epr.metadata;
- this.referenceParameters = epr.referenceParameters;
+ if ((epr.referenceParameters != null) && (!epr.referenceParameters.isEmpty()))
+ {
+ this.referenceParameters = epr.referenceParameters;
+ }
+ if ((epr.metadata != null) && (!epr.metadata.isEmpty()))
+ {
+ this.metadata = epr.metadata;
+ }
+ this.attributes = epr.attributes;
+ this.elements = epr.elements;
+ if (epr.metadata != null)
+ {
+ Map<QName, String> metadataAttributes = epr.metadata.getAttributes();
+ if (metadataAttributes != null)
+ {
+ final String wsdlLocation = metadataAttributes.get(WSDL_LOCATION_QNAME);
+ if (wsdlLocation != null)
+ {
+ int spaceIndex = wsdlLocation.indexOf(" ");
+ if (spaceIndex == -1)
+ throw new IllegalArgumentException("wsdlLocation have to specify both wsdl namespace and target wsdl location");
+
+ this.setWsdlLocation(wsdlLocation.substring(spaceIndex).trim());
+ }
+ }
+ List<Element> metadataElements = epr.metadata.getElements();
+ if (metadataElements != null)
+ {
+ for (Element e : epr.metadata.getElements())
+ {
+ if (WSAM_NS.equals(e.getNamespaceURI()))
+ {
+ if (e.getLocalName().equals(SERVICE_QNAME.getLocalPart()))
+ {
+ this.serviceName = this.getQName(e, e.getTextContent());
+ String endpointName = e.getAttribute(ENDPOINT_ATTRIBUTE);
+ if (endpointName != null)
+ {
+ this.endpointName = new QName(
+ this.serviceName.getNamespaceURI(),
+ endpointName,
+ this.serviceName.getPrefix()
+ );
+ }
+ }
+ if (e.getLocalName().equals(INTERFACE_QNAME.getLocalPart()))
+ {
+ this.interfaceName = this.getQName(e, e.getTextContent());
+ }
+ }
+ }
+ }
+ }
}
catch (JAXBException e)
{
- throw new WebServiceException("Error unmarshalling NativeEndpointReference ", e);
+ throw new WebServiceException("Error unmarshalling NativeEndpointReference", e);
}
catch (ClassCastException e)
{
- throw new WebServiceException("Source did not contain NativeEndpointReference", e);
+ throw new WebServiceException("Source did not contain NativeEndpointReference", e);
}
}
@@ -127,6 +186,9 @@
public void setAddress(String address)
{
+ if (address == null)
+ return;
+
this.address = new Address(address);
}
@@ -136,9 +198,20 @@
return serviceName;
}
- public void setServiceName(QName serviceName)
+ public void setServiceName(final QName serviceName)
{
+ if (serviceName == null)
+ return;
+
this.serviceName = serviceName;
+ this.serviceNameElement = DOMUtils.createElement(SERVICE_QNAME);
+ final String attrName = this.getNamespaceAttributeName(serviceName.getPrefix());
+ this.serviceNameElement.setAttribute(attrName, serviceName.getNamespaceURI());
+ this.serviceNameElement.setTextContent(this.toString(serviceName));
+ if (this.metadata == null)
+ this.metadata = new Elements();
+
+ this.metadata.addElement(this.serviceNameElement);
}
@XmlTransient
@@ -149,47 +222,99 @@
public void setEndpointName(QName endpointName)
{
+ if (endpointName == null)
+ return;
+
this.endpointName = endpointName;
}
@XmlTransient
+ public QName getInterfaceName()
+ {
+ return interfaceName;
+ }
+
+ public void setInterfaceName(final QName interfaceName)
+ {
+ if (interfaceName == null)
+ return;
+
+ this.interfaceName = interfaceName;
+ Element interfaceNameElement = DOMUtils.createElement(INTERFACE_QNAME);
+ final String attrName = this.getNamespaceAttributeName(interfaceName.getPrefix());
+ interfaceNameElement.setAttribute(attrName, interfaceName.getNamespaceURI());
+ interfaceNameElement.setTextContent(this.toString(interfaceName));
+ if (this.metadata == null)
+ this.metadata = new Elements();
+
+ this.metadata.addElement(interfaceNameElement);
+ }
+
+ @XmlTransient
public List<Element> getMetadata()
{
- return metadata != null ? metadata.getElements() : null;
+ if (this.metadata == null)
+ return null;
+
+ return this.metadata.getElements();
}
public void setMetadata(List<Element> metadata)
{
- this.metadata = new Elements(metadata);
+ if ((metadata == null) || (metadata.size() == 0))
+ return;
+
+ if (this.metadata == null)
+ this.metadata = new Elements();
+
+ this.metadata.setElements(metadata);
}
@XmlTransient
public URL getWsdlLocation()
{
- return wsdlLocation;
- }
-
- public void setWsdlLocation(String wsdlLocation)
- {
- try
+ if (this.wsdlLocation != null)
{
- this.wsdlLocation = wsdlLocation != null ? new URL(wsdlLocation) : null;
+ return this.toURL(this.wsdlLocation);
}
- catch (MalformedURLException e)
+ else
{
- throw new IllegalArgumentException("Invalid URL: " + wsdlLocation);
+ String address = this.getAddress();
+ if (address != null)
+ {
+ return this.toURL(address + "?wsdl");
+ }
}
+
+ return null;
}
+
+ public void setWsdlLocation(String wsdlLocation)
+ {
+ if (wsdlLocation == null)
+ return;
+
+ this.wsdlLocation = wsdlLocation;
+ }
@XmlTransient
public List<Element> getReferenceParameters()
{
- return referenceParameters != null ? referenceParameters.getElements() : null;
+ if (this.referenceParameters == null)
+ return null;
+
+ return this.referenceParameters.getElements();
}
public void setReferenceParameters(List<Element> metadata)
{
- this.referenceParameters = new Elements(metadata);
+ if ((metadata == null) || (metadata.size() == 0))
+ return;
+
+ if (this.referenceParameters == null)
+ this.referenceParameters = new Elements();
+
+ this.referenceParameters.setElements(metadata);
}
/**
@@ -218,6 +343,31 @@
*/
public void writeTo(Result result)
{
+ if (this.endpointName != null && this.serviceNameElement != null)
+ {
+ this.serviceNameElement.setAttribute(ENDPOINT_ATTRIBUTE, this.endpointName.getLocalPart());
+
+ if (this.wsdlLocation != null)
+ {
+ if (this.metadata == null)
+ this.metadata = new Elements();
+
+ String wsdlNamespace = null;
+ if (this.endpointName != null)
+ {
+ wsdlNamespace = this.endpointName.getNamespaceURI();
+ }
+ else if (this.serviceName != null)
+ {
+ wsdlNamespace = this.serviceName.getNamespaceURI();
+ }
+
+ if (wsdlNamespace == null && this.wsdlLocation != null)
+ throw new IllegalStateException("Either serviceName or endpointName have to be specified when providing wsdlLocation");
+
+ this.metadata.addAttribute(WSDL_LOCATION_QNAME, wsdlNamespace + " " + this.wsdlLocation);
+ }
+ }
try
{
Marshaller marshaller = jc.createMarshaller();
@@ -226,10 +376,22 @@
}
catch (JAXBException e)
{
- throw new WebServiceException("Error marshalling NativeEndpointReference. ", e);
+ throw new WebServiceException("Error marshalling NativeEndpointReference", e);
}
}
+ private URL toURL(final String s)
+ {
+ try
+ {
+ return new URL(s);
+ }
+ catch (MalformedURLException e)
+ {
+ throw new IllegalArgumentException(e.getMessage(), e);
+ }
+ }
+
private static JAXBContext getJaxbContext()
{
try
@@ -238,10 +400,50 @@
}
catch (JAXBException ex)
{
- throw new WebServiceException("Cannot obtain JAXB context", ex);
+ throw new WebServiceException("=Cannot obtain JAXB context", ex);
}
}
+ private String toString(final QName qname)
+ {
+ StringBuilder sb = new StringBuilder();
+ if (qname.getPrefix() != null && qname.getPrefix().length() > 0)
+ {
+ sb.append(qname.getPrefix());
+ sb.append(':');
+ }
+ sb.append(qname.getLocalPart());
+ return sb.toString();
+ }
+
+ private QName getQName(Element e, String nodeValue)
+ {
+ if (nodeValue == null)
+ throw new RuntimeException("Missing text content for element : " + e.getNodeName());
+
+ final int separatorIndex = nodeValue.indexOf(':');
+ if (separatorIndex == -1)
+ {
+ final String namespace = e.getAttribute("xmlns");
+ return new QName(namespace, nodeValue);
+ }
+ else
+ {
+ final String prefix = nodeValue.substring(0, separatorIndex);
+ final String localPart = nodeValue.substring(separatorIndex + 1);
+ final String namespace = e.lookupNamespaceURI(prefix);
+ return new QName(namespace, localPart, prefix);
+ }
+ }
+
+ private String getNamespaceAttributeName(final String prefix)
+ {
+ if (prefix == null || "".equals(prefix))
+ return "xmlns";
+
+ return "xmlns:" + prefix;
+ }
+
private static class Address
{
@XmlValue
@@ -305,8 +507,24 @@
public void setElements(List<Element> elements)
{
- this.elements = elements;
+ if (this.elements == null)
+ {
+ this.elements = elements;
+ }
+ else
+ {
+ this.elements.addAll(elements);
+ }
}
+
+ public void addElement(Element e)
+ {
+ if (this.elements == null)
+ {
+ this.elements = new LinkedList<Element>();
+ }
+ this.elements.add(e);
+ }
@XmlTransient
public Map<QName, String> getAttributes()
@@ -316,7 +534,33 @@
public void setAttributes(Map<QName, String> attributes)
{
- this.attributes = attributes;
+ if (this.attributes == null)
+ {
+ this.attributes = attributes;
+ }
+ else
+ {
+ this.attributes.putAll(attributes);
+ }
}
+
+ public void addAttribute(QName attrName, String attrValue)
+ {
+ if (this.attributes == null)
+ {
+ this.attributes = new HashMap<QName, String>();
+ }
+ this.attributes.put(attrName, attrValue);
+ }
+
+ @XmlTransient
+ public boolean isEmpty()
+ {
+ final boolean noAttributes = this.attributes == null || this.attributes.size() == 0;
+ final boolean noElements = this.elements == null || this.elements.size() == 0;
+
+ return noAttributes && noElements;
+ }
}
-}
+
+}
\ No newline at end of file
Added: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/NativeEndpointReferenceTestCase.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/NativeEndpointReferenceTestCase.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/NativeEndpointReferenceTestCase.java 2012-04-24 06:33:29 UTC (rev 16206)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.epr;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+
+import org.jboss.ws.core.jaxws.wsaddressing.NativeEndpointReference;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.test.JBossWSTest;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Tests NativeEndpointReference de/serializations.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class NativeEndpointReferenceTestCase extends JBossWSTest
+{
+ private static final String URL = "http://localhost:8080/hello";
+ private static final String WSDL_URL = URL + "?wsdl";
+ private static final String MY_NS = "http://helloservice.org/wsdl";
+ private static final String WSA_NS = "http://www.w3.org/2005/08/addressing";
+ private static final String WSAM_NS = "http://www.w3.org/2007/05/addressing/metadata";
+ private static final String WSAM_PREFIX = "wsam";
+ private static final String MY_PREFIX = "myns";
+ private static final QName PARAM1_QNAME = new QName("http://helloservice.org/param1", "param1", "ns1");
+ private static final QName PARAM2_QNAME = new QName("http://helloservice.org/param2", "param2", "ns2");
+ private static final QName WSAM_SERVICE_QNAME = new QName(WSAM_NS, "ServiceName");
+ private static final QName WSAM_INTERFACE_QNAME = new QName(WSAM_NS, "InterfaceName");
+ private static final QName METADATA_QNAME = new QName(WSA_NS, "Metadata");
+ private static final String XML =
+ "<EndpointReference xmlns='http://www.w3.org/2005/08/addressing'> " +
+ " <Address>http://localhost:8080/hello</Address>" +
+ " <ReferenceParameters>" +
+ " <ns1:param1 wsa:IsReferenceParameter='true' xmlns:ns1='http://helloservice.org/param1' xmlns:wsa='http://www.w3.org/2005/08/addressing'>Hello</ns1:param1>" +
+ " <ns2:param2 wsa:IsReferenceParameter='true' xmlns:ns2='http://helloservice.org/param2' xmlns:wsa='http://www.w3.org/2005/08/addressing'>World</ns2:param2>" +
+ " </ReferenceParameters>" +
+ " <Metadata wsdli:wsdlLocation='http://helloservice.org/wsdl http://localhost:8080/hello?wsdl' xmlns:wsdli='http://www.w3.org/ns/wsdl-instance'>" +
+ " <wsam:ServiceName EndpointName='HelloPort' xmlns:myns='http://helloservice.org/wsdl' xmlns:wsam='http://www.w3.org/2007/05/addressing/metadata'>myns:HelloService</wsam:ServiceName>" +
+ " <wsam:InterfaceName xmlns:myns='http://helloservice.org/wsdl' xmlns:wsam='http://www.w3.org/2007/05/addressing/metadata'>myns:Hello</wsam:InterfaceName>" +
+ " </Metadata>" +
+ "</EndpointReference>";
+
+ public void testNativeEndpointReferenceFromSource() throws Exception
+ {
+ final Source xml = new DOMSource(DOMUtils.parse(XML));
+ NativeEndpointReference epr = new NativeEndpointReference(xml);
+ DOMResult dr = new DOMResult();
+ epr.writeTo(dr);
+ Node endpointReferenceElement = dr.getNode();
+ assertMetaData(endpointReferenceElement);
+ assertRefParam(endpointReferenceElement, PARAM1_QNAME, "Hello");
+ assertRefParam(endpointReferenceElement, PARAM2_QNAME, "World");
+ assertEquals(new QName(MY_NS, "HelloService", MY_PREFIX), epr.getServiceName());
+ assertEquals(new QName(MY_NS, "Hello", MY_PREFIX), epr.getInterfaceName());
+ assertEquals(new QName(MY_NS, "HelloPort", MY_PREFIX), epr.getEndpointName());
+ }
+
+ private static void assertRefParam(final Node root, final QName nodeName, final String refParamValue)
+ {
+ Element e = (Element)DOMUtils.getFirstChildElement(root, nodeName, true);
+ assertNotNull("Reference parameter " + nodeName + " not found", e);
+ String actual = DOMUtils.getTextContent(e);
+ if ((actual == null) || (!actual.equals(refParamValue)))
+ {
+ fail("Reference parameter " + nodeName + " expected value is " + refParamValue);
+ }
+ }
+
+ private static void assertMetaData(final Node root)
+ {
+ Element metadataElement = (Element)DOMUtils.getFirstChildElement(root, METADATA_QNAME, true);
+ String wsdlLocationValue = metadataElement.getAttributeNodeNS("http://www.w3.org/ns/wsdl-instance", "wsdlLocation").getValue();
+ assertEquals("wsdlLocation mismatch", wsdlLocationValue, MY_NS + " " + WSDL_URL);
+ Element serviceNameElement = (Element)DOMUtils.getFirstChildElement(metadataElement, WSAM_SERVICE_QNAME);
+ assertNamespaces(serviceNameElement);
+ assertEquals("wrong text content in ServiceName element", "myns:HelloService", DOMUtils.getTextContent(serviceNameElement));
+ String endpointNameValue = DOMUtils.getAttributeValue(serviceNameElement, "EndpointName");
+ assertNotNull("cannot find endpointName attribute value", endpointNameValue);
+ assertEquals("wrong endpointName attribute value", endpointNameValue, "HelloPort");
+ Element interfaceNameElement = (Element)DOMUtils.getFirstChildElement(metadataElement, WSAM_INTERFACE_QNAME);
+ assertNamespaces(interfaceNameElement);
+ assertEquals("wrong text content in InterfaceName element", "myns:Hello", DOMUtils.getTextContent(interfaceNameElement));
+ }
+
+ private static void assertNamespaces(final Element e)
+ {
+ String myNamespace = e.lookupNamespaceURI(MY_PREFIX);
+ assertNotNull("namespace is null for prefix " + MY_PREFIX + ", are you using our patched xalan?", myNamespace);
+ assertEquals("namespace mismatch", myNamespace, MY_NS);
+ String wsamNamespace = e.lookupNamespaceURI(WSAM_PREFIX);
+ assertNotNull("namespace is null for prefix " + WSAM_PREFIX + ", are you using our patched xalan?", wsamNamespace);
+ assertEquals("namespace mismatch", wsamNamespace, WSAM_NS);
+ }
+}
12 years, 8 months
JBossWS SVN: r16204 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-04-20 11:03:28 -0400 (Fri, 20 Apr 2012)
New Revision: 16204
Modified:
stack/cxf/trunk/pom.xml
Log:
Removing duplicated plugin definition (probably a leftover from when the dist module has been added to the project)
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2012-04-20 14:16:36 UTC (rev 16203)
+++ stack/cxf/trunk/pom.xml 2012-04-20 15:03:28 UTC (rev 16204)
@@ -1356,29 +1356,6 @@
</executions>
</plugin>
<plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <finalName>assembly</finalName>
- <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
- <appendAssemblyId>false</appendAssemblyId>
- <!--
- Cannot bind to lifecycle with multiple modules
- http://jira.codehaus.org/browse/MASSEMBLY-319
- <executions>
- <execution>
- <id>build-deploy-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>directory-inline</goal>
- </goals>
- </execution>
- </executions-->
- <descriptors>
- <descriptor>src/main/scripts/assembly-deploy-artifacts.xml</descriptor>
- </descriptors>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
12 years, 8 months
JBossWS SVN: r16203 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-04-20 10:16:36 -0400 (Fri, 20 Apr 2012)
New Revision: 16203
Removed:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyWSDLTestCase.java
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCase.java
Log:
[JBWS-3482] Merging HTTPProxy testcases together to avoid clashes with concurrent changes to System properties
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCase.java 2012-04-20 13:42:37 UTC (rev 16202)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCase.java 2012-04-20 14:16:36 UTC (rev 16203)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, 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.
*
@@ -21,9 +21,14 @@
*/
package org.jboss.test.ws.jaxws.cxf.httpproxy;
+import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.io.PrintStream;
+import java.net.Authenticator;
import java.net.MalformedURLException;
+import java.net.PasswordAuthentication;
import java.net.URL;
import java.util.HashMap;
@@ -57,6 +62,7 @@
private static int proxyPort = 19387;
private static final String PROXY_USER = "foo";
private static final String PROXY_PWD = "bar";
+ private static final String ENDPOINT_PATH = "/jaxws-cxf-httpproxy/HelloWorldService/HelloWorldImpl";
private HttpProxyServer proxyServer;
public static Test suite()
@@ -206,4 +212,72 @@
System.clearProperty("http.proxyPort");
}
+ public void testWSDLHttpProxy() throws Exception
+ {
+ setProxySystemProperties();
+ try
+ {
+ Authenticator.setDefault(new ProxyAuthenticator(PROXY_USER, PROXY_PWD));
+ String endpointAddress = "http://unreachable-testWSDLHttpProxy" + ENDPOINT_PATH;
+ StringBuffer sb = readContent(new URL(endpointAddress + "?wsdl"));
+ assertTrue(sb.toString().contains("wsdl:definitions name=\"HelloWorldService\""));
+ }
+ finally
+ {
+ Authenticator.setDefault(null);
+ }
+ }
+
+ public void testWSDLNoHttpProxy() throws Exception
+ {
+ clearProxySystemProperties();
+ String endpointAddress = "http://unreachable-testWSDLNoHttpProxy" + ENDPOINT_PATH;
+ try
+ {
+ readContent(new URL(endpointAddress + "?wsdl"));
+ fail("Request expected to fail without http proxy");
+ }
+ catch (Exception e)
+ {
+ assertTrue(e.getMessage().contains("unreachable-testWSDLNoHttpProxy"));
+ }
+ }
+
+ private static StringBuffer readContent(URL url) throws Exception
+ {
+ StringBuffer sb = new StringBuffer();
+ InputStream is = null;
+ try
+ {
+ is = url.openConnection().getInputStream();
+ BufferedReader in = new BufferedReader(new InputStreamReader(is));
+ String line;
+ while ((line = in.readLine()) != null)
+ {
+ sb.append(line);
+ sb.append("\n");
+ }
+ }
+ finally
+ {
+ if (is != null) is.close();
+ }
+ return sb;
+ }
+
+ private static class ProxyAuthenticator extends Authenticator
+ {
+ private String user, password;
+
+ public ProxyAuthenticator(String user, String password)
+ {
+ this.user = user;
+ this.password = password;
+ }
+
+ protected PasswordAuthentication getPasswordAuthentication()
+ {
+ return new PasswordAuthentication(user, password.toCharArray());
+ }
+ }
}
Deleted: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyWSDLTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyWSDLTestCase.java 2012-04-20 13:42:37 UTC (rev 16202)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyWSDLTestCase.java 2012-04-20 14:16:36 UTC (rev 16203)
@@ -1,162 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * 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.
- *
- * 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.cxf.httpproxy;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.Authenticator;
-import java.net.PasswordAuthentication;
-import java.net.URL;
-import java.util.HashMap;
-
-import junit.framework.Test;
-
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-import org.littleshoot.proxy.DefaultHttpProxyServer;
-import org.littleshoot.proxy.HttpFilter;
-import org.littleshoot.proxy.HttpProxyServer;
-import org.littleshoot.proxy.ProxyAuthorizationHandler;
-
-public class HTTPProxyWSDLTestCase extends JBossWSTest
-{
- private static final int PROXY_PORT = 19385;
- private static final String ENDPOINT_PATH = "/jaxws-cxf-httpproxy/HelloWorldService/HelloWorldImpl";
- private static final String PROXY_USER = "foo";
- private static final String PROXY_PWD = "bar";
- private HttpProxyServer proxyServer;
-
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(HTTPProxyWSDLTestCase.class, "jaxws-cxf-httpproxy.war");
- }
-
- public void testWSDLHttpProxy() throws Exception
- {
- setProxySystemProperties();
- try
- {
- Authenticator.setDefault(new ProxyAuthenticator(PROXY_USER, PROXY_PWD));
- String endpointAddress = "http://unreachable-testWSDLHttpProxy" + ENDPOINT_PATH;
- StringBuffer sb = readContent(new URL(endpointAddress + "?wsdl"));
- assertTrue(sb.toString().contains("wsdl:definitions name=\"HelloWorldService\""));
- }
- finally
- {
- Authenticator.setDefault(null);
- }
- }
-
- public void testWSDLNoHttpProxy() throws Exception
- {
- clearProxySystemProperties();
- String endpointAddress = "http://unreachable-testWSDLNoHttpProxy" + ENDPOINT_PATH;
- try
- {
- readContent(new URL(endpointAddress + "?wsdl"));
- fail("Request expected to fail without http proxy");
- }
- catch (Exception e)
- {
- assertTrue(e.getMessage().contains("unreachable-testWSDLNoHttpProxy"));
- }
- }
-
- @Override
- protected void setUp() throws Exception
- {
- proxyServer = new DefaultHttpProxyServer(PROXY_PORT, new HashMap<String, HttpFilter>(),
- getServerHost() + ":8080", null, null);
- ProxyAuthorizationHandler authorizationHandler = new ProxyAuthorizationHandler()
- {
-
- @Override
- public boolean authenticate(String user, String pwd)
- {
- return (PROXY_USER.equals(user) && PROXY_PWD.equals(pwd));
- }
- };
- proxyServer.addProxyAuthenticationHandler(authorizationHandler);
- proxyServer.start();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- if (proxyServer != null)
- {
- proxyServer.stop();
- }
- clearProxySystemProperties();
- }
-
- private static void setProxySystemProperties()
- {
- System.getProperties().setProperty("http.proxyHost", getServerHost());
- System.getProperties().setProperty("http.proxyPort", String.valueOf(PROXY_PORT));
- }
-
- private static void clearProxySystemProperties()
- {
- System.clearProperty("http.proxyHost");
- System.clearProperty("http.proxyPort");
- }
-
- private static StringBuffer readContent(URL url) throws Exception
- {
- StringBuffer sb = new StringBuffer();
- InputStream is = null;
- try
- {
- is = url.openConnection().getInputStream();
- BufferedReader in = new BufferedReader(new InputStreamReader(is));
- String line;
- while ((line = in.readLine()) != null)
- {
- sb.append(line);
- sb.append("\n");
- }
- }
- finally
- {
- if (is != null) is.close();
- }
- return sb;
- }
-
- private static class ProxyAuthenticator extends Authenticator
- {
- private String user, password;
-
- public ProxyAuthenticator(String user, String password)
- {
- this.user = user;
- this.password = password;
- }
-
- protected PasswordAuthentication getPasswordAuthentication()
- {
- return new PasswordAuthentication(user, password.toCharArray());
- }
- }
-}
12 years, 8 months
JBossWS SVN: r16202 - stack/native/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-04-20 09:42:37 -0400 (Fri, 20 Apr 2012)
New Revision: 16202
Modified:
stack/native/trunk/pom.xml
Log:
[JBWS-3480] Removing duplicated version configuration
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2012-04-20 13:02:16 UTC (rev 16201)
+++ stack/native/trunk/pom.xml 2012-04-20 13:42:37 UTC (rev 16202)
@@ -312,7 +312,6 @@
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
- <version>2.4</version>
<configuration>
<escapeWindowsPaths>false</escapeWindowsPaths>
</configuration>
12 years, 8 months
JBossWS SVN: r16199 - stack/cxf/trunk/modules/dist.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-04-20 08:47:51 -0400 (Fri, 20 Apr 2012)
New Revision: 16199
Modified:
stack/cxf/trunk/modules/dist/pom.xml
Log:
[JBWS-3480] Fixing regression in binary distribution due to dist module using an old version of antrun plugin
Modified: stack/cxf/trunk/modules/dist/pom.xml
===================================================================
--- stack/cxf/trunk/modules/dist/pom.xml 2012-04-20 12:19:53 UTC (rev 16198)
+++ stack/cxf/trunk/modules/dist/pom.xml 2012-04-20 12:47:51 UTC (rev 16199)
@@ -257,7 +257,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
- <version>1.4</version>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
12 years, 8 months
JBossWS SVN: r16198 - in stack/native/branches/jbossws-native-4.0.x: modules and 21 other directories.
by jbossws-commits@lists.jboss.org
Author: ropalka
Date: 2012-04-20 08:19:53 -0400 (Fri, 20 Apr 2012)
New Revision: 16198
Removed:
stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java
stack/native/branches/jbossws-native-4.0.x/modules/endorsed/
stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/native/jbossws-native-factories/
stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/saaj-impl/
stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/
stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/resources/common/soap/
Modified:
stack/native/branches/jbossws-native-4.0.x/
stack/native/branches/jbossws-native-4.0.x/modules/core/pom.xml
stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPUtils.java
stack/native/branches/jbossws-native-4.0.x/modules/dist/pom.xml
stack/native/branches/jbossws-native-4.0.x/modules/dist/src/main/distro/build.xml
stack/native/branches/jbossws-native-4.0.x/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/modules/jboss710/org/jboss/as/webservices/server/integration/main/module.xml
stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/native/jbossws-native-core/main/module.xml
stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/jbws1692/JBWS1692TestCase.java
stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/encoded/href/HRefHandler.java
stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws425/JBWS425TestCase.java
stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws707/JBWS707TestCase.java
stack/native/branches/jbossws-native-4.0.x/modules/testsuite/pom.xml
stack/native/branches/jbossws-native-4.0.x/pom.xml
Log:
[JBPAPP-8737] Merged revisions 16182 via svnmerge from
https://svn.jboss.org/repos/jbossws/stack/native/trunk
.......
r16182 | ropalka | 2012-04-19 06:47:36 +0200 (Thu, 19 Apr 2012) | 1 line
[JBWS-3486] removing endorsed module
.......
Property changes on: stack/native/branches/jbossws-native-4.0.x
___________________________________________________________________
Modified: svnmerge-integrated
- https://svn.jboss.org/repos/jbossws/stack/native/trunk:1-15651,15653-1567...
+ https://svn.jboss.org/repos/jbossws/stack/native/trunk:1-15651,15653-1567...
Modified: svn:mergeinfo
- /stack/native/branches/asoldano:14057,14069
/stack/native/branches/ropalka:13836-13879
/stack/native/trunk:15653,15670-15677,15686,15696,15707,15714,15726-15731,15739-15740,15749-15759,15761,15775-15777,15779,15787-15791,15793,15795,15797-15804,15810,15812-15818,15821,15823-15827,15829,15831,15836-15840,15858,15861,15871,15873,15880-15883,15887,15890-15891,15904-15931,15944,15974,15988,15991,15995,15997,15999,16003,16013,16015,16021,16050-16052,16063-16065,16073-16078,16081-16085,16091-16095,16103-16105,16157-16160,16165,16169-16171
+ /stack/native/branches/asoldano:14057,14069
/stack/native/branches/ropalka:13836-13879
/stack/native/trunk:15653,15670-15677,15686,15696,15707,15714,15726-15731,15739-15740,15749-15759,15761,15775-15777,15779,15787-15791,15793,15795,15797-15804,15810,15812-15818,15821,15823-15827,15829,15831,15836-15840,15858,15861,15871,15873,15880-15883,15887,15890-15891,15904-15931,15944,15974,15988,15991,15995,15997,15999,16003,16013,16015,16021,16050-16052,16063-16065,16073-16078,16081-16085,16091-16095,16103-16105,16157-16160,16165,16169-16171,16182
Modified: stack/native/branches/jbossws-native-4.0.x/modules/core/pom.xml
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/core/pom.xml 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/core/pom.xml 2012-04-20 12:19:53 UTC (rev 16198)
@@ -36,11 +36,6 @@
<artifactId>jboss-saaj-api_1.3_spec</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.ws.native</groupId>
- <artifactId>jbossws-native-factories</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
<groupId>org.jboss.spec.javax.ejb</groupId>
<artifactId>jboss-ejb-api_3.1_spec</artifactId>
</dependency>
Modified: stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2012-04-20 12:19:53 UTC (rev 16198)
@@ -54,7 +54,6 @@
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.core.soap.SOAPBodyElementDoc;
import org.jboss.ws.core.soap.SOAPBodyElementRpc;
-import org.jboss.ws.core.soap.SOAPBodyImpl;
import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.soap.SOAPElementImpl;
import org.jboss.ws.core.soap.SOAPFaultImpl;
@@ -439,8 +438,8 @@
throw new WSException(BundleUtils.getMessage(bundle, "MESSAGECONTEXT_NOT_AVAILABLE"));
SOAPHeader soapHeader = soapEnvelope.getHeader();
- SOAPBodyImpl soapBody = (SOAPBodyImpl)soapEnvelope.getBody();
- SOAPBodyElement soapBodyElement = soapBody.getBodyElement();
+ SOAPBody soapBody = (SOAPBody)soapEnvelope.getBody();
+ SOAPBodyElement soapBodyElement = SOAPUtils.getFirstSOAPBodyElement(soapBody);
// Translate the SOAPFault to an exception and throw it
if (soapBodyElement instanceof SOAPFaultImpl)
Deleted: stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java 2012-04-20 12:19:53 UTC (rev 16198)
@@ -1,30 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.soap;
-
-/**
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @since Sep 26, 2006
- */
-public interface SAAJVisitable {
- public void accept(SAAJVisitor visitor);
-}
Modified: stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2012-04-20 12:19:53 UTC (rev 16198)
@@ -60,7 +60,7 @@
*
* @author Thomas.Diesler(a)jboss.org
*/
-public class SOAPElementImpl extends NodeImpl implements SOAPElement, SAAJVisitable
+public class SOAPElementImpl extends NodeImpl implements SOAPElement
{
private static final ResourceBundle bundle = BundleUtils.getBundle(SOAPElementImpl.class);
// The org.w3c.dom.Element
@@ -868,11 +868,6 @@
this.element.setIdAttributeNS(namespaceURI, localName, isId);
}
- public void accept(SAAJVisitor visitor)
- {
- visitor.visitSOAPElement(this);
- }
-
@Override
public void setPrefix(String prefix) throws DOMException
{
Modified: stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPUtils.java
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPUtils.java 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPUtils.java 2012-04-20 12:19:53 UTC (rev 16198)
@@ -21,8 +21,13 @@
*/
package org.jboss.ws.core.soap.utils;
+import java.util.Iterator;
+
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
@@ -31,6 +36,7 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.SOAPConnectionFactoryImpl;
import org.jboss.ws.core.soap.SOAPFactoryImpl;
/**
@@ -69,6 +75,24 @@
return newSOAPFactory(SOAPConstants.SOAP_1_2_PROTOCOL);
}
+ public static SOAPConnectionFactory newSOAPConnectionFactory() throws SOAPException {
+ return new SOAPConnectionFactoryImpl();
+ // TODO: use standard SOAP API to create objects
+ //return SOAPConnectionFactory.newInstance();
+ }
+
+ public static SOAPBodyElement getFirstSOAPBodyElement(final SOAPBody soapBody) {
+ SOAPBodyElement bodyElement = null;
+ final Iterator<?> it = soapBody.getChildElements();
+ while (bodyElement == null && it.hasNext())
+ {
+ Object next = it.next();
+ if (next instanceof SOAPBodyElement)
+ bodyElement = (SOAPBodyElement)next;
+ }
+ return bodyElement;
+ }
+
private static SOAPFactory newSOAPFactory(final String protocol) {
try {
return new SOAPFactoryImpl(protocol);
Modified: stack/native/branches/jbossws-native-4.0.x/modules/dist/pom.xml
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/dist/pom.xml 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/dist/pom.xml 2012-04-20 12:19:53 UTC (rev 16198)
@@ -19,12 +19,6 @@
<dependencies>
<dependency>
<groupId>org.jboss.ws.native</groupId>
- <artifactId>jbossws-native-factories</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-services</artifactId>
<version>${project.version}</version>
</dependency>
Modified: stack/native/branches/jbossws-native-4.0.x/modules/dist/src/main/distro/build.xml
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/dist/src/main/distro/build.xml 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/dist/src/main/distro/build.xml 2012-04-20 12:19:53 UTC (rev 16198)
@@ -73,7 +73,6 @@
<!-- Move the native API to the front of the classpath -->
<pathelement location="${thirdparty.dir}/jaxrpc-api.jar"/>
<pathelement location="${thirdparty.dir}/saaj-api.jar"/>
- <pathelement location="${thirdparty.dir}/jbossws-native-factories.jar"/>
<fileset dir="${thirdparty.dir}">
<exclude name="**/jbossws-jboss*.jar"/>
</fileset>
Modified: stack/native/branches/jbossws-native-4.0.x/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2012-04-20 12:19:53 UTC (rev 16198)
@@ -31,7 +31,6 @@
<outputDirectory>deploy-artifacts/lib</outputDirectory>
<unpack>false</unpack>
<includes>
- <include>org.jboss.ws.native:jbossws-native-factories:jar</include>
<include>org.jboss.ws.native:jbossws-native-services:jar</include>
<include>org.jboss.ws.native:jbossws-native-core</include>
<include>org.jboss.ws:jbossws-api:jar</include>
@@ -59,7 +58,7 @@
<dependencySet>
<outputDirectory>deploy-artifacts/lib</outputDirectory>
- <unpack>false</unpack>
+ <unpack>false</unpack>
<includes>
<include>org.jboss.ws.native:jbossws-native-resources:jar:*:jboss*</include>
</includes>
Modified: stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/modules/jboss710/org/jboss/as/webservices/server/integration/main/module.xml
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/modules/jboss710/org/jboss/as/webservices/server/integration/main/module.xml 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/modules/jboss710/org/jboss/as/webservices/server/integration/main/module.xml 2012-04-20 12:19:53 UTC (rev 16198)
@@ -29,13 +29,10 @@
<dependencies>
<module name="javax.api" export="true"/>
- <module name="javax.jws.api" export="true"/>
<module name="javax.wsdl4j.api" export="true"/>
- <module name="javax.xml.ws.api" export="true"/>
<module name="org.jboss.ws.api" export="true"/>
<module name="org.jboss.ws.spi" export="true"/>
<module name="org.jboss.ws.common" services="import" export="true"/>
- <module name="org.jboss.ws.native.jbossws-native-factories" services="export" export="true"/>
<module name="org.jboss.ws.native.jbossws-native-core" services="export" export="true">
<imports>
<include path="META-INF"/>
@@ -49,8 +46,8 @@
</exports>
</module>
<module name="org.jboss.ws.native.jbossws-native-services" services="export" export="true"/>
- <module name="org.apache.xalan" services="export" export="true"/>
<module name="org.apache.xerces" services="export" export="true"/>
<module name="org.jboss.as.webservices" services="export" export="true"/>
</dependencies>
+
</module>
Modified: stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/native/jbossws-native-core/main/module.xml
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/native/jbossws-native-core/main/module.xml 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/native/jbossws-native-core/main/module.xml 2012-04-20 12:19:53 UTC (rev 16198)
@@ -42,7 +42,6 @@
<module name="org.jboss.ws.api" />
<module name="org.jboss.ws.spi" />
<module name="org.jboss.ws.common" />
- <module name="org.jboss.ws.native.jbossws-native-factories" services="import"/>
<module name="org.jboss.ws.native.jbossws-native-services" services="import"/>
<module name="org.jboss.common-core" />
<module name="org.jboss.logging" />
Modified: stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml 2012-04-20 12:19:53 UTC (rev 16198)
@@ -40,11 +40,6 @@
<include name="**/jbossws-native-core.jar"/>
</fileset>
</copy>
- <copy todir="@{targetdir}/org/jboss/ws/native/jbossws-native-factories/main" flatten="false" overwrite="true">
- <fileset dir="@{thirdpartydir}/lib">
- <include name="**/jbossws-native-factories.jar"/>
- </fileset>
- </copy>
<copy todir="@{targetdir}/org/jboss/ws/native/jbossws-native-services/main" flatten="false" overwrite="true">
<fileset dir="@{thirdpartydir}/lib">
<include name="**/jbossws-native-services.jar"/>
Modified: stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2012-04-20 12:19:53 UTC (rev 16198)
@@ -40,9 +40,8 @@
import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.client.CallImpl;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.ws.core.soap.utils.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.SOAPUtils;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.common.DOMUtils;
@@ -226,8 +225,8 @@
ByteArrayInputStream inputStream = new ByteArrayInputStream(reqEnvelope.getBytes());
- MessageFactory factory = new MessageFactoryImpl();
- SOAPMessageImpl reqMessage = (SOAPMessageImpl)factory.createMessage(null, inputStream);
+ MessageFactory factory = SOAPUtils.newSOAP12MessageFactory();
+ SOAPMessage reqMessage = (SOAPMessage)factory.createMessage(null, inputStream);
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.setSOAPMessage(reqMessage);
@@ -253,8 +252,8 @@
ByteArrayInputStream inputStream = new ByteArrayInputStream(reqEnvelopeWithBoundHeader.getBytes());
- MessageFactory factory = new MessageFactoryImpl();
- SOAPMessageImpl reqMessage = (SOAPMessageImpl)factory.createMessage(null, inputStream);
+ MessageFactory factory = SOAPUtils.newSOAP12MessageFactory();
+ SOAPMessage reqMessage = factory.createMessage(null, inputStream);
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.setSOAPMessage(reqMessage);
@@ -276,8 +275,8 @@
{
ByteArrayInputStream inputStream = new ByteArrayInputStream(reqEnvelopeWithUnboundHeader.getBytes());
- MessageFactory factory = new MessageFactoryImpl();
- SOAPMessageImpl reqMessage = (SOAPMessageImpl)factory.createMessage(null, inputStream);
+ MessageFactory factory = SOAPUtils.newSOAP12MessageFactory();
+ SOAPMessage reqMessage = (SOAPMessage)factory.createMessage(null, inputStream);
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.setSOAPMessage(reqMessage);
@@ -320,8 +319,8 @@
ByteArrayInputStream inputStream = new ByteArrayInputStream(resEnvelope.getBytes());
- MessageFactory factory = new MessageFactoryImpl();
- SOAPMessageImpl resMessage = (SOAPMessageImpl)factory.createMessage(null, inputStream);
+ MessageFactory factory = SOAPUtils.newSOAP12MessageFactory();
+ SOAPMessage resMessage = factory.createMessage(null, inputStream);
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.setSOAPMessage(resMessage);
@@ -340,8 +339,8 @@
ByteArrayInputStream inputStream = new ByteArrayInputStream(resEnvelopeWithBoundHeader.getBytes());
- MessageFactory factory = new MessageFactoryImpl();
- SOAPMessageImpl resMessage = (SOAPMessageImpl)factory.createMessage(null, inputStream);
+ MessageFactory factory = SOAPUtils.newSOAP12MessageFactory();
+ SOAPMessage resMessage = factory.createMessage(null, inputStream);
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.setSOAPMessage(resMessage);
@@ -371,8 +370,8 @@
ByteArrayInputStream inputStream = new ByteArrayInputStream(resEnvelopeWithFault.getBytes());
- MessageFactory factory = new MessageFactoryImpl();
- SOAPMessageImpl resMessage = (SOAPMessageImpl)factory.createMessage(null, inputStream);
+ MessageFactory factory = SOAPUtils.newSOAP12MessageFactory();
+ SOAPMessage resMessage = factory.createMessage(null, inputStream);
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.setSOAPMessage(resMessage);
Modified: stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/jbws1692/JBWS1692TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/jbws1692/JBWS1692TestCase.java 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/jbws1692/JBWS1692TestCase.java 2012-04-20 12:19:53 UTC (rev 16198)
@@ -29,6 +29,7 @@
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPMessage;
+import org.jboss.ws.core.soap.utils.SOAPUtils;
import org.jboss.wsf.test.JBossWSTest;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -46,7 +47,7 @@
{
public void testImportNode() throws Exception
{
- MessageFactory factory = MessageFactory.newInstance();
+ MessageFactory factory = SOAPUtils.newSOAP11MessageFactory();
File soapreqfile = getResourceFile("common/jbws1692/soap-request-template.xml");
SOAPMessage msg = factory.createMessage(null, new FileInputStream(soapreqfile));
Modified: stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/encoded/href/HRefHandler.java
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/encoded/href/HRefHandler.java 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/encoded/href/HRefHandler.java 2012-04-20 12:19:53 UTC (rev 16198)
@@ -33,6 +33,7 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
+import org.jboss.ws.core.soap.utils.SOAPUtils;
public class HRefHandler extends GenericHandler
{
@@ -77,7 +78,7 @@
"</env:Body>" +
"</env:Envelope>";
- MessageFactory factory = MessageFactory.newInstance();
+ MessageFactory factory = SOAPUtils.newSOAP11MessageFactory();
SOAPMessage reqMessage = factory.createMessage(null, new ByteArrayInputStream(envStr.getBytes()));
((SOAPMessageContext)msgContext).setMessage(reqMessage);
}
@@ -109,7 +110,7 @@
"</env:Body>" +
"</env:Envelope>";
- MessageFactory factory = MessageFactory.newInstance();
+ MessageFactory factory = SOAPUtils.newSOAP11MessageFactory();
SOAPMessage resMessage = factory.createMessage(null, new ByteArrayInputStream(envStr.getBytes()));
((SOAPMessageContext)msgContext).setMessage(resMessage);
}
Modified: stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2012-04-20 12:19:53 UTC (rev 16198)
@@ -39,6 +39,7 @@
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
import org.jboss.ws.common.DOMWriter;
+import org.jboss.ws.core.soap.utils.SOAPUtils;
/**
* Deploying a war that also contains normal servlets the web.xml is modified as if they are all endpoints
@@ -117,7 +118,7 @@
{
URL servletURL = new URL("http://" + getServerHost() + ":8080" + "/jaxrpc-jbws1093/ServletTest?type=soapMessage");
- SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
+ SOAPConnection con = SOAPUtils.newSOAPConnectionFactory().createConnection();
SOAPMessage resMessage = con.get(servletURL);
SOAPEnvelope env = resMessage.getSOAPPart().getEnvelope();
Modified: stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws425/JBWS425TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws425/JBWS425TestCase.java 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws425/JBWS425TestCase.java 2012-04-20 12:19:53 UTC (rev 16198)
@@ -38,6 +38,7 @@
import junit.framework.Test;
+import org.jboss.ws.core.soap.utils.SOAPUtils;
import org.jboss.wsf.test.CleanupOperation;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -120,7 +121,7 @@
" </soapenv:Body>" +
"</soapenv:Envelope>";
- MessageFactory msgFactory = MessageFactory.newInstance();
+ MessageFactory msgFactory = SOAPUtils.newSOAP11MessageFactory();
SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
MimeHeaders mimeHeaders = new MimeHeaders();
Modified: stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws707/JBWS707TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws707/JBWS707TestCase.java 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws707/JBWS707TestCase.java 2012-04-20 12:19:53 UTC (rev 16198)
@@ -28,13 +28,14 @@
import javax.xml.rpc.Service;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import junit.framework.Test;
-import org.jboss.ws.core.soap.SOAPBodyImpl;
+import org.jboss.ws.core.soap.utils.SOAPUtils;
import org.jboss.wsf.test.CleanupOperation;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -201,8 +202,8 @@
mimeHeaders.addHeader("Content-Type", "text/xml; charset=UTF-8");
SOAPMessage soapMessage = mf.createMessage(mimeHeaders, new ByteArrayInputStream(xmlStr.getBytes()));
- SOAPBodyImpl soapBody = (SOAPBodyImpl)soapMessage.getSOAPBody();
- SOAPElement soapElement = soapBody.getBodyElement();
+ SOAPBody soapBody = (SOAPBody)soapMessage.getSOAPBody();
+ SOAPElement soapElement = SOAPUtils.getFirstSOAPBodyElement(soapBody);
StringBuffer builder = new StringBuffer();
NodeList nlist = soapElement.getChildNodes();
Modified: stack/native/branches/jbossws-native-4.0.x/modules/testsuite/pom.xml
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/testsuite/pom.xml 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/modules/testsuite/pom.xml 2012-04-20 12:19:53 UTC (rev 16198)
@@ -98,35 +98,6 @@
</testResource>
</testResources>
<plugins>
- <plugin> <!-- This copies jbossws-native-factories jar to endorsed dir before the integration-tests are run -->
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-factories-jar</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/endorsed</outputDirectory>
- <resources>
- <resource>
- <directory>${basedir}/../endorsed/target/</directory>
- <includes>
- <include>jbossws-native-factories-${project.version}.jar</include>
- </includes>
- </resource>
- <resource>
- <directory>${basedir}/../../endorsed/target/</directory>
- <includes>
- <include>jbossws-native-factories-${project.version}.jar</include>
- </includes>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
@@ -284,7 +255,6 @@
<properties>
<jboss.version>${jboss712.version}</jboss.version>
<jbossws.integration.target>jboss712</jbossws.integration.target>
- <endorsed.dirs>${project.build.directory}/endorsed</endorsed.dirs>
</properties>
<dependencies>
<dependency>
@@ -352,15 +322,9 @@
<build>
<plugins>
<plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <compilerArgument>-Djava.endorsed.dirs=${endorsed.dirs}</compilerArgument>
- </configuration>
- </plugin>
- <plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>${surefire.jvm.args} ${surefire.default-mgmt-serurity.args} -Djava.endorsed.dirs=${endorsed.dirs}</argLine>
+ <argLine>${surefire.jvm.args} ${surefire.default-mgmt-serurity.args}</argLine>
<excludes>
<!-- no excludes ATM -->
</excludes>
Modified: stack/native/branches/jbossws-native-4.0.x/pom.xml
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/pom.xml 2012-04-20 11:09:02 UTC (rev 16197)
+++ stack/native/branches/jbossws-native-4.0.x/pom.xml 2012-04-20 12:19:53 UTC (rev 16198)
@@ -49,7 +49,6 @@
<!-- Modules -->
<modules>
- <module>modules/endorsed</module>
<module>modules/core</module>
<module>modules/resources</module>
<module>modules/services</module>
12 years, 8 months