JBossWS SVN: r12980 - in framework/trunk/testsuite/test: java/org/jboss/test/ws/jaxws/samples/provider and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-15 13:56:09 -0400 (Wed, 15 Sep 2010)
New Revision: 12980
Removed:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.java
Modified:
framework/trunk/testsuite/test/ant-import/build-samples-jaxws.xml
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java
framework/trunk/testsuite/test/resources/jaxws/samples/provider/jaxb/WEB-INF/web.xml
framework/trunk/testsuite/test/resources/jaxws/samples/provider/payload/WEB-INF/wsdl/Provider.wsdl
Log:
Fixing invadid provider testscases
Modified: framework/trunk/testsuite/test/ant-import/build-samples-jaxws.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-samples-jaxws.xml 2010-09-15 15:26:19 UTC (rev 12979)
+++ framework/trunk/testsuite/test/ant-import/build-samples-jaxws.xml 2010-09-15 17:56:09 UTC (rev 12980)
@@ -188,7 +188,6 @@
<war warfile="${tests.output.dir}/test-libs/jaxws-samples-provider-jaxb.war" webxml="${tests.output.dir}/test-resources/jaxws/samples/provider/jaxb/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
<include name="org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.class"/>
- <include name="org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.class"/>
<include name="org/jboss/test/ws/jaxws/samples/provider/UserType.class"/>
</classes>
<webinf dir="${tests.output.dir}/test-resources/jaxws/samples/provider/jaxb/WEB-INF">
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.java 2010-09-15 15:26:19 UTC (rev 12979)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.java 2010-09-15 17:56:09 UTC (rev 12980)
@@ -24,11 +24,13 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.util.JAXBSource;
import javax.xml.transform.Source;
+import javax.xml.ws.BindingType;
import javax.xml.ws.Provider;
import javax.xml.ws.Service;
import javax.xml.ws.ServiceMode;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.http.HTTPBinding;
import org.jboss.logging.Logger;
@@ -40,7 +42,8 @@
* @since 29-Jun-2006
*/
@WebServiceProvider(serviceName = "ProviderService", portName = "ProviderPort", targetNamespace = "http://org.jboss.ws/provider", wsdlLocation = "WEB-INF/wsdl/Provider.wsdl")
-@ServiceMode(value = Service.Mode.PAYLOAD)
+@BindingType(value = HTTPBinding.HTTP_BINDING)
+@ServiceMode(value = Service.Mode.MESSAGE)
public class ProviderBeanJAXB implements Provider<Source>
{
// provide logging
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java 2010-09-15 15:26:19 UTC (rev 12979)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java 2010-09-15 17:56:09 UTC (rev 12980)
@@ -21,29 +21,22 @@
*/
package org.jboss.test.ws.jaxws.samples.provider;
-import java.io.ByteArrayInputStream;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPConnection;
-import javax.xml.soap.SOAPConnectionFactory;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPMessage;
-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.soap.SOAPBinding;
+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.jboss.wsf.common.DOMUtils;
import org.w3c.dom.Element;
/**
@@ -79,18 +72,6 @@
assertEquals(user.getQname(), userRes.getQname());
}
- public void testWebServiceDispatch() throws Exception
- {
- Dispatch<Object> dispatch = createDispatch("WebServiceEndpoint");
-
- UserType user = new UserType();
- user.setString("Kermit");
- user.setQname(new QName("TheFrog"));
- UserType userRes = (UserType)dispatch.invoke(user);
- assertEquals(user.getString(), userRes.getString());
- assertEquals(user.getQname(), userRes.getQname());
- }
-
private Dispatch<Object> createDispatch(String target) throws MalformedURLException, JAXBException
{
String targetNS = "http://org.jboss.ws/provider";
@@ -99,39 +80,11 @@
URL endpointAddress = new URL("http://" + getServerHost() + ":8080/jaxws-samples-provider-jaxb/" + target);
Service service = Service.create(serviceName);
- service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, endpointAddress.toExternalForm());
+ service.addPort(portName, HTTPBinding.HTTP_BINDING, endpointAddress.toExternalForm());
JAXBContext jbc = JAXBContext.newInstance(new Class[] { UserType.class });
Dispatch<Object> dispatch = service.createDispatch(portName, jbc, Mode.PAYLOAD);
return dispatch;
}
- public void testProviderMessage() throws Exception
- {
- String reqString =
- "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <env:Header/>" +
- " <env:Body>" +
- " <ns1:user xmlns:ns1='http://org.jboss.ws/provider'>" +
- " <string>Kermit</string>" +
- " <qname>The Frog</qname>" +
- " </ns1:user>" +
- " </env:Body>" +
- "</env:Envelope>";
-
- MessageFactory msgFactory = MessageFactory.newInstance();
- SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
- SOAPMessage reqMsg = msgFactory.createMessage(null, new ByteArrayInputStream(reqString.getBytes()));
-
- URL epURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-provider-jaxb/ProviderEndpoint");
- SOAPMessage resMsg = con.call(reqMsg, epURL);
- SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
-
- Element child = (Element)resEnv.getBody().getChildElements().next();
- JAXBContext jc = JAXBContext.newInstance(new Class[]{UserType.class});
- UserType user = (UserType)jc.createUnmarshaller().unmarshal(new DOMSource(child));
-
- assertEquals("Kermit", user.getString());
- assertEquals(new QName("The Frog"), user.getQname());
- }
}
Deleted: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.java 2010-09-15 15:26:19 UTC (rev 12979)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.java 2010-09-15 17:56:09 UTC (rev 12980)
@@ -1,39 +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.test.ws.jaxws.samples.provider;
-
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-
-@WebService(name = "Provider", serviceName = "ProviderService", portName = "ProviderPort", targetNamespace = "http://org.jboss.ws/provider", wsdlLocation = "WEB-INF/wsdl/Provider.wsdl")
-@SOAPBinding(parameterStyle = ParameterStyle.BARE)
-public class WebServiceEndpoint
-{
- @WebResult(name = "user")
- public UserType echo(@WebParam(name = "user") UserType type)
- {
- return type;
- }
-}
Modified: framework/trunk/testsuite/test/resources/jaxws/samples/provider/jaxb/WEB-INF/web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/samples/provider/jaxb/WEB-INF/web.xml 2010-09-15 15:26:19 UTC (rev 12979)
+++ framework/trunk/testsuite/test/resources/jaxws/samples/provider/jaxb/WEB-INF/web.xml 2010-09-15 17:56:09 UTC (rev 12980)
@@ -9,17 +9,9 @@
<servlet-name>ProviderEndpoint</servlet-name>
<servlet-class>org.jboss.test.ws.jaxws.samples.provider.ProviderBeanJAXB</servlet-class>
</servlet>
- <servlet>
- <servlet-name>WebServiceEndpoint</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxws.samples.provider.WebServiceEndpoint</servlet-class>
- </servlet>
<servlet-mapping>
<servlet-name>ProviderEndpoint</servlet-name>
<url-pattern>/ProviderEndpoint</url-pattern>
</servlet-mapping>
- <servlet-mapping>
- <servlet-name>WebServiceEndpoint</servlet-name>
- <url-pattern>/WebServiceEndpoint</url-pattern>
- </servlet-mapping>
</web-app>
Modified: framework/trunk/testsuite/test/resources/jaxws/samples/provider/payload/WEB-INF/wsdl/Provider.wsdl
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/samples/provider/payload/WEB-INF/wsdl/Provider.wsdl 2010-09-15 15:26:19 UTC (rev 12979)
+++ framework/trunk/testsuite/test/resources/jaxws/samples/provider/payload/WEB-INF/wsdl/Provider.wsdl 2010-09-15 17:56:09 UTC (rev 12980)
@@ -1,6 +1,6 @@
<?xml version='1.0'?>
<definitions name='ProviderService' targetNamespace='http://org.jboss.ws/provider' xmlns='http://schemas.xmlsoap.org/wsdl/'
- xmlns:http='http://schemas.xmlsoap.org/wsdl/http/' xmlns:mime='http://schemas.xmlsoap.org/wsdl/mime/' xmlns:tns='http://org.jboss.ws/provider' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/provider' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<types>
<xs:schema targetNamespace='http://org.jboss.ws/provider' xmlns:tns='http://org.jboss.ws/provider' version='1.0' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:element name='user' type='tns:UserType'/>
@@ -25,20 +25,19 @@
</operation>
</portType>
<binding name='ProviderBinding' type='tns:Provider'>
- <http:binding verb='POST'/>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='echo'>
- <http:operation location='echo'/>
<input>
- <mime:content type="text/xml"/>
+ <soap:body use='literal'/>
</input>
<output>
- <mime:content type="text/xml"/>
+ <soap:body use='literal'/>
</output>
</operation>
</binding>
<service name='ProviderService'>
<port binding='tns:ProviderBinding' name='ProviderPort'>
- <http:address location='REPLACE_WITH_ACTUAL_URL'/>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
</port>
</service>
</definitions>
\ No newline at end of file
14 years, 3 months
JBossWS SVN: r12979 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/logging.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-15 11:26:19 -0400 (Wed, 15 Sep 2010)
New Revision: 12979
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/logging/LoggingFeatureEndpointImpl.java
Log:
Using @Logging annotation instead of @Feature(...logging...)
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/logging/LoggingFeatureEndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/logging/LoggingFeatureEndpointImpl.java 2010-09-15 15:25:38 UTC (rev 12978)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/logging/LoggingFeatureEndpointImpl.java 2010-09-15 15:26:19 UTC (rev 12979)
@@ -27,12 +27,12 @@
import javax.jws.WebService;
import javax.xml.ws.WebServiceContext;
-import org.apache.cxf.feature.Features;
+import org.apache.cxf.annotations.Logging;
import org.jboss.logging.Logger;
@WebService(name = "LoggingFeatureEndpoint", targetNamespace = "http://logging.cxf.jaxws.ws.test.jboss.org/", serviceName = "LoggingFeatureService")
@Stateless
-@Features(features = "org.apache.cxf.feature.LoggingFeature")
+@Logging
public class LoggingFeatureEndpointImpl
{
@Resource
14 years, 3 months
JBossWS SVN: r12978 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-15 11:25:38 -0400 (Wed, 15 Sep 2010)
New Revision: 12978
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPTestCase.java
Log:
Enhancing test
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPTestCase.java 2010-09-15 12:55:55 UTC (rev 12977)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPTestCase.java 2010-09-15 15:25:38 UTC (rev 12978)
@@ -25,6 +25,8 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
+import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
@@ -38,6 +40,10 @@
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.feature.AbstractFeature;
import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.helpers.HttpHeaderHelper;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transport.http.gzip.GZIPFeature;
import org.apache.cxf.transport.http.gzip.GZIPInInterceptor;
@@ -102,7 +108,7 @@
//enable Accept gzip, otherwise the server will not try to reply using gzip
policy.setAcceptEncoding("gzip;q=1.0, identity; q=0.5, *;q=0");
//add interceptor for decoding gzip message
- client.getInInterceptors().add(new GZIPInInterceptor());
+ client.getInInterceptors().add(new GZIPEnforcingInInterceptor());
assertEquals("foo", port.echo("foo"));
}
@@ -135,7 +141,7 @@
outInterceptor.setThreshold(1024*1024); // 1MB -> no gzip on request
bus.getOutInterceptors().add(outInterceptor);
//add interceptor for decoding gzip message
- bus.getInInterceptors().add(new GZIPInInterceptor());
+ bus.getInInterceptors().add(new GZIPEnforcingInInterceptor());
BusFactory.setDefaultBus(bus);
HelloWorld port = getPort();
assertEquals("foo", port.echo("foo"));
@@ -185,5 +191,28 @@
}
return port;
}
-
+
+ /**
+ * A test extension of the GZIPInInterceptor that requires all received messages to be gzip encoded
+ *
+ */
+ private class GZIPEnforcingInInterceptor extends GZIPInInterceptor
+ {
+ @Override
+ public void handleMessage(Message message) throws Fault
+ {
+ Map<String, List<String>> protocolHeaders = CastUtils.cast((Map<?, ?>) message.get(Message.PROTOCOL_HEADERS));
+ if (protocolHeaders != null)
+ {
+ List<String> contentEncoding = HttpHeaderHelper.getHeader(protocolHeaders,
+ HttpHeaderHelper.CONTENT_ENCODING);
+ if (contentEncoding != null && (contentEncoding.contains("gzip") || contentEncoding.contains("x-gzip")))
+ {
+ super.handleMessage(message);
+ return;
+ }
+ }
+ throw new RuntimeException("Content-Encoding gzip not found!");
+ }
+ }
}
14 years, 3 months
JBossWS SVN: r12977 - in stack/cxf/trunk/modules/testsuite/cxf-tests: src/test/java/org/jboss/test/ws/jaxws/cxf and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-15 08:55:55 -0400 (Wed, 15 Sep 2010)
New Revision: 12977
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/HelloWorld.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/HelloWorldImpl.java
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
Log:
Adding testcase for gzip encoding
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2010-09-15 12:50:01 UTC (rev 12976)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2010-09-15 12:55:55 UTC (rev 12977)
@@ -30,6 +30,13 @@
</classes>
</war>
+ <!-- jaxws-cxf-gzip -->
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-cxf-gzip.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/cxf/gzip/HelloWorld*.class"/>
+ </fileset>
+ </jar>
+
<!-- jaxws-cxf-jaxbintros -->
<jar destfile="${tests.output.dir}/test-libs/jaxws-cxf-jaxbintros.jar">
<fileset dir="${tests.output.dir}/test-classes">
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPTestCase.java 2010-09-15 12:55:55 UTC (rev 12977)
@@ -0,0 +1,189 @@
+/*
+ * 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.cxf.gzip;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.CXFBusImpl;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transport.http.gzip.GZIPFeature;
+import org.apache.cxf.transport.http.gzip.GZIPInInterceptor;
+import org.apache.cxf.transport.http.gzip.GZIPOutInterceptor;
+import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 15-Sep-2010
+ *
+ */
+public class GZIPTestCase extends JBossWSTest
+{
+ private String gzipFeatureEndpointURL = "http://" + getServerHost() + ":8080/jaxws-cxf-gzip/HelloWorldService/HelloWorldImpl";
+
+ private HelloWorld port;
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(GZIPTestCase.class, "jaxws-cxf-gzip.jar");
+ }
+
+ public void testGZIPUsingFeatureOnBus() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+ BusFactory.setDefaultBus(bus);
+
+ GZIPFeature gzipFeature = new GZIPFeature();
+ gzipFeature.setThreshold(0);
+ gzipFeature.initialize(bus);
+
+ HelloWorld port = getPort();
+ assertEquals("foo", port.echo("foo"));
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+ public void testGZIPUsingFeatureOnClient() throws Exception
+ {
+ HelloWorld port = getPort();
+ Client client = ClientProxy.getClient(port);
+ GZIPFeature gzipFeature = new GZIPFeature();
+ gzipFeature.setThreshold(0);
+ gzipFeature.initialize(client, BusFactory.getThreadDefaultBus());
+ assertEquals("foo", port.echo("foo"));
+ }
+
+ public void testGZIPServerSideOnlyInterceptorOnClient() throws Exception
+ {
+ HelloWorld port = getPort();
+ Client client = ClientProxy.getClient(port);
+ HTTPConduit conduit = (HTTPConduit)client.getConduit();
+ HTTPClientPolicy policy = conduit.getClient();
+ //enable Accept gzip, otherwise the server will not try to reply using gzip
+ policy.setAcceptEncoding("gzip;q=1.0, identity; q=0.5, *;q=0");
+ //add interceptor for decoding gzip message
+ client.getInInterceptors().add(new GZIPInInterceptor());
+ assertEquals("foo", port.echo("foo"));
+ }
+
+ public void testFailureGZIPServerSideOnlyInterceptorOnClient() throws Exception
+ {
+ HelloWorld port = getPort();
+ Client client = ClientProxy.getClient(port);
+ HTTPConduit conduit = (HTTPConduit)client.getConduit();
+ HTTPClientPolicy policy = conduit.getClient();
+ //enable Accept gzip, otherwise the server will not try to reply using gzip
+ policy.setAcceptEncoding("gzip;q=1.0, identity; q=0.5, *;q=0");
+ try
+ {
+ port.echo("foo");
+ fail();
+ }
+ catch (Exception e)
+ {
+ //expected exception, as the client is not able to decode gzip message
+ }
+ }
+
+ public void testGZIPServerSideOnlyInterceptorsOnBus() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+ //enable Accept gzip, otherwise the server will not try to reply using gzip
+ GZIPOutInterceptor outInterceptor = new GZIPOutInterceptor();
+ outInterceptor.setThreshold(1024*1024); // 1MB -> no gzip on request
+ bus.getOutInterceptors().add(outInterceptor);
+ //add interceptor for decoding gzip message
+ bus.getInInterceptors().add(new GZIPInInterceptor());
+ BusFactory.setDefaultBus(bus);
+ HelloWorld port = getPort();
+ assertEquals("foo", port.echo("foo"));
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+ public void testFailureGZIPServerSideOnlyInterceptorsOnBus() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+ //enable Accept gzip, otherwise the server will not try to reply using gzip
+ GZIPOutInterceptor outInterceptor = new GZIPOutInterceptor();
+ outInterceptor.setThreshold(1024*1024); // 1MB -> no gzip on request
+ bus.getOutInterceptors().add(outInterceptor);
+ BusFactory.setDefaultBus(bus);
+ HelloWorld port = getPort();
+ try
+ {
+ port.echo("foo");
+ fail();
+ }
+ catch (Exception e)
+ {
+ //expected exception, as the client is not able to decode gzip message
+ }
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+ private HelloWorld getPort() throws MalformedURLException
+ {
+ if (port == null)
+ {
+ URL wsdlURL = new URL(gzipFeatureEndpointURL + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/gzip", "HelloWorldService");
+ Service service = Service.create(wsdlURL, serviceName);
+ QName portQName = new QName("http://org.jboss.ws/jaxws/cxf/gzip", "HelloWorldImplPort");
+ port = (HelloWorld) service.getPort(portQName, HelloWorld.class);
+ }
+ return port;
+ }
+
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/HelloWorld.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/HelloWorld.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/HelloWorld.java 2010-09-15 12:55:55 UTC (rev 12977)
@@ -0,0 +1,30 @@
+/*
+ * 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.cxf.gzip;
+
+import javax.jws.WebService;
+
+@WebService(targetNamespace = "http://org.jboss.ws/jaxws/cxf/gzip")
+public interface HelloWorld
+{
+ String echo(String input);
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/HelloWorldImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/HelloWorldImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/HelloWorldImpl.java 2010-09-15 12:55:55 UTC (rev 12977)
@@ -0,0 +1,43 @@
+/*
+ * 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.cxf.gzip;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.GZIP;
+
+@WebService
+(
+ serviceName = "HelloWorldService",
+ endpointInterface = "org.jboss.test.ws.jaxws.cxf.gzip.HelloWorld",
+ targetNamespace = "http://org.jboss.ws/jaxws/cxf/gzip"
+)
+@GZIP(threshold = 0)
+@Stateless
+public class HelloWorldImpl implements HelloWorld
+{
+ public String echo(String input)
+ {
+ return input;
+ }
+}
14 years, 3 months
JBossWS SVN: r12976 - stack/cxf/trunk/modules/resources/src/main/resources/resources.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-09-15 08:50:01 -0400 (Wed, 15 Sep 2010)
New Revision: 12976
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/resources/deploy.conf
Log:
[JBWS-3090] do not duplicit jaxb & jaxws APIs in endorsed - always remove jbossws-native-jaxws-ext.jar
Modified: stack/cxf/trunk/modules/resources/src/main/resources/resources/deploy.conf
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/resources/deploy.conf 2010-09-15 12:49:42 UTC (rev 12975)
+++ stack/cxf/trunk/modules/resources/src/main/resources/resources/deploy.conf 2010-09-15 12:50:01 UTC (rev 12976)
@@ -1 +1 @@
-bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/cxf-*.jar client/geronimo-*.jar client/jaxws-httpserver-httpspi.jar client/neethi.jar client/saaj-impl.jar client/spring-*.jar client/wss4j.jar client/XmlSchema.jar client/asm.jar client/jetty*.jar client/velocity.jar client/commons-collections.jar client/commons-lang.jar client/jettison.jar client/jaxb-api.jar client/FastInfoset.jar client/commons-beanutils.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/policy.jar client/jbossws-cxf-* client/jbossws-native-jaxrpc.jar client/jaxrpc-api.jar client/jbossws-native-jaxws.jar client/jbossws-native-factories.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/saaj-api.jar client/jbossws-native-client.jar client/jbossws-native-services.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossw!
s-spi.jar client/wscommons-policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/cxf-*.jar common/lib/jaxws-httpserver-httpspi.jar common/lib/geronimo-*.jar common/lib/neethi.jar common/lib/saaj-impl.jar common/lib/spring-*.jar common/lib/wss4j.jar common/lib/XmlSchema.jar common/lib/asm.jar common/lib/FastInfoset.jar common/lib/jboss-jaxb-intros.jar common/lib/jettison.jar common/lib/wscommons-policy.jar common/lib/wsdl4j.jar common/lib/xmlsec.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jaxrpc-api.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/saaj-api.jar common/lib/jbossws-common.jar common/lib/jbossws-framework.jar common/lib/jbossws-spi.jar common/lib/commons-beanutils.jar lib/endorsed/jbossws-cxf-* lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar lib/endorsed/jaxws-api.jar
+bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jbossws-native-jaxws-ext.jar client/cxf-*.jar client/geronimo-*.jar client/jaxws-httpserver-httpspi.jar client/neethi.jar client/saaj-impl.jar client/spring-*.jar client/wss4j.jar client/XmlSchema.jar client/asm.jar client/jetty*.jar client/velocity.jar client/commons-collections.jar client/commons-lang.jar client/jettison.jar client/jaxb-api.jar client/FastInfoset.jar client/commons-beanutils.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/policy.jar client/jbossws-cxf-* client/jbossws-native-jaxrpc.jar client/jaxrpc-api.jar client/jbossws-native-jaxws.jar client/jbossws-native-factories.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/saaj-api.jar client/jbossws-native-client.jar client/jbossws-native-services.jar client/jbossws-common.jar client!
/jbossws-framework.jar client/jbossws-spi.jar client/wscommons-policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/cxf-*.jar common/lib/jaxws-httpserver-httpspi.jar common/lib/geronimo-*.jar common/lib/neethi.jar common/lib/saaj-impl.jar common/lib/spring-*.jar common/lib/wss4j.jar common/lib/XmlSchema.jar common/lib/asm.jar common/lib/FastInfoset.jar common/lib/jboss-jaxb-intros.jar common/lib/jettison.jar common/lib/wscommons-policy.jar common/lib/wsdl4j.jar common/lib/xmlsec.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jaxrpc-api.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/saaj-api.jar common/lib/jbossws-common.jar common/lib/jbossws-framework.jar common/lib/jbossws-spi.jar common/lib/commons-beanutils.jar lib/endorsed/*jbossws* lib/endorsed/*jaxb*.jar lib/endorsed/*ja!
xws*.jar
14 years, 3 months
JBossWS SVN: r12975 - stack/native/trunk/modules/resources/src/main/resources/resources.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-09-15 08:49:42 -0400 (Wed, 15 Sep 2010)
New Revision: 12975
Modified:
stack/native/trunk/modules/resources/src/main/resources/resources/deploy.conf
Log:
[JBWS-3090] do not duplicit jaxb & jaxws APIs in endorsed - always remove jbossws-native-jaxws-ext.jar
Modified: stack/native/trunk/modules/resources/src/main/resources/resources/deploy.conf
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/resources/deploy.conf 2010-09-15 12:02:22 UTC (rev 12974)
+++ stack/native/trunk/modules/resources/src/main/resources/resources/deploy.conf 2010-09-15 12:49:42 UTC (rev 12975)
@@ -1 +1 @@
-bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/cxf-*.jar client/geronimo-*.jar client/neethi.jar client/saaj-impl.jar client/spring-*.jar client/wss4j.jar client/XmlSchema.jar client/asm.jar client/jetty*.jar client/velocity.jar client/commons-collections.jar client/commons-lang.jar client/jettison.jar client/jaxb-api.jar client/FastInfoset.jar client/commons-beanutils.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/policy.jar client/jbossws-native-jaxrpc.jar client/jaxrpc-api.jar client/jbossws-cxf-* client/jbossws-native-jaxws.jar client/jbossws-native-factories.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/saaj-api.jar client/jbossws-native-client.jar client/jbossws-native-services.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/wscommons-policy.ja!
r client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/cxf-*.jar common/lib/geronimo-*.jar common/lib/neethi.jar common/lib/saaj-impl.jar common/lib/spring-*.jar common/lib/wss4j.jar common/lib/XmlSchema.jar common/lib/asm.jar common/lib/FastInfoset.jar common/lib/jboss-jaxb-intros.jar common/lib/jettison.jar common/lib/wscommons-policy.jar common/lib/wsdl4j.jar common/lib/xmlsec.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jaxrpc-api.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/saaj-api.jar common/lib/jbossws-common.jar common/lib/jbossws-framework.jar common/lib/jbossws-spi.jar common/lib/commons-beanutils.jar lib/endorsed/jbossws-cxf-* lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar lib/endorsed/jaxws-api.jar
+bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jbossws-native-jaxws-ext.jar client/cxf-*.jar client/geronimo-*.jar client/jaxws-httpserver-httpspi.jar client/neethi.jar client/saaj-impl.jar client/spring-*.jar client/wss4j.jar client/XmlSchema.jar client/asm.jar client/jetty*.jar client/velocity.jar client/commons-collections.jar client/commons-lang.jar client/jettison.jar client/jaxb-api.jar client/FastInfoset.jar client/commons-beanutils.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/policy.jar client/jbossws-cxf-* client/jbossws-native-jaxrpc.jar client/jaxrpc-api.jar client/jbossws-native-jaxws.jar client/jbossws-native-factories.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/saaj-api.jar client/jbossws-native-client.jar client/jbossws-native-services.jar client/jbossws-common.jar client!
/jbossws-framework.jar client/jbossws-spi.jar client/wscommons-policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/cxf-*.jar common/lib/jaxws-httpserver-httpspi.jar common/lib/geronimo-*.jar common/lib/neethi.jar common/lib/saaj-impl.jar common/lib/spring-*.jar common/lib/wss4j.jar common/lib/XmlSchema.jar common/lib/asm.jar common/lib/FastInfoset.jar common/lib/jboss-jaxb-intros.jar common/lib/jettison.jar common/lib/wscommons-policy.jar common/lib/wsdl4j.jar common/lib/xmlsec.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jaxrpc-api.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/saaj-api.jar common/lib/jbossws-common.jar common/lib/jbossws-framework.jar common/lib/jbossws-spi.jar common/lib/commons-beanutils.jar lib/endorsed/*jbossws* lib/endorsed/*jaxb*.jar lib/endorsed/*ja!
xws*.jar
14 years, 3 months
JBossWS SVN: r12974 - common/trunk/src/main/java/org/jboss/wsf/common.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-09-15 08:02:22 -0400 (Wed, 15 Sep 2010)
New Revision: 12974
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/JavaUtils.java
Log:
[JBWS-2951] fixing NPE in JavaUtils - package retrieval
Modified: common/trunk/src/main/java/org/jboss/wsf/common/JavaUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/JavaUtils.java 2010-09-15 10:32:31 UTC (rev 12973)
+++ common/trunk/src/main/java/org/jboss/wsf/common/JavaUtils.java 2010-09-15 12:02:22 UTC (rev 12974)
@@ -565,7 +565,8 @@
public static String getPackageName(Class<?> clazz)
{
String fullName = clazz.getName();
- return fullName.substring(0, fullName.lastIndexOf("."));
+ int dotIndex = fullName.lastIndexOf(".");
+ return dotIndex == -1 ? "" : fullName.substring(0, dotIndex);
}
public static boolean isReservedKeyword(String keyword)
14 years, 3 months
JBossWS SVN: r12973 - in stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core: client/transport and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2010-09-15 06:32:31 -0400 (Wed, 15 Sep 2010)
New Revision: 12973
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/StubExt.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java
Log:
[JBWS-3114]:Added new connectionTimeout and recevieTimeout configuration
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/StubExt.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/StubExt.java 2010-09-15 10:31:19 UTC (rev 12972)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/StubExt.java 2010-09-15 10:32:31 UTC (rev 12973)
@@ -71,6 +71,16 @@
static final String PROPERTY_MTOM_ENABLED= "org.jboss.ws.mtom.enabled";
/** HTTP chunk size */
static final String PROPERTY_CHUNKED_ENCODING_SIZE = "http://org.jboss.ws/http#chunksize";
+
+ //New added property to provide stack agnostic timeout configuration(JBWS-3114)
+ /** Client ConnectionTimeout property: javax.xml.ws.client.connectionTimeout */
+ static final String PROPERTY_CONNECTION_TIMEOUT = "javax.xml.ws.client.connectionTimeout";
+
+ /** Client ReceiveTimeout property: javax.xml.ws.client.receiveTimeout */
+ static final String PROPERTY_RECEIVE_TIMEOUT = "javax.xml.ws.client.receiveTimeout";
+
+
+
/**
* Add a header that is not bound to an input parameter.
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java 2010-09-15 10:31:19 UTC (rev 12972)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java 2010-09-15 10:32:31 UTC (rev 12973)
@@ -84,6 +84,8 @@
private Marshaller marshaller;
private UnMarshaller unmarshaller;
private Long timeout;
+ private Long connectionTimeout;
+ private Long receiveTimeout;
private static final int DEFAULT_CHUNK_SIZE = 1024;
//We always use chunked transfer encoding unless explicitly disabled by user
private Integer chunkSize = new Integer(DEFAULT_CHUNK_SIZE);
@@ -153,7 +155,20 @@
try
{
setActualTimeout(callProps);
- channel = transport.getChannel(timeout);
+ //JBWS-3114:Provide the new connection timeout configuration
+ if (callProps.containsKey(StubExt.PROPERTY_CONNECTION_TIMEOUT))
+ {
+ connectionTimeout = new Long(callProps.get(StubExt.PROPERTY_CONNECTION_TIMEOUT).toString());
+ }
+ else
+ {
+ if (timeout != null)
+ {
+ connectionTimeout = timeout;
+ }
+ }
+
+ channel = transport.getChannel(connectionTimeout);
WSResponseHandler responseHandler = new WSResponseHandler();
NettyHelper.setResponseHandler(channel, responseHandler);
@@ -178,9 +193,21 @@
//Get the response
Future<Result> futureResult = responseHandler.getFutureResult();
Result result = null;
+ if (callProps.containsKey(StubExt.PROPERTY_RECEIVE_TIMEOUT))
+ {
+ receiveTimeout = new Long(callProps.get(StubExt.PROPERTY_RECEIVE_TIMEOUT).toString());
+ }
+ else
+ {
+ if (timeout != null)
+ {
+ receiveTimeout = timeout;
+ }
+ }
try
{
- result = timeout == null ? futureResult.get() : futureResult.get(timeout, TimeUnit.MILLISECONDS);
+ result = receiveTimeout == null ? futureResult.get() : futureResult.get(receiveTimeout,
+ TimeUnit.MILLISECONDS);
}
catch (ExecutionException ee)
{
@@ -188,6 +215,10 @@
Throwable t = ee.getCause();
throw t != null ? t : ee;
}
+ catch (TimeoutException te)
+ {
+ throw new WSTimeoutException("Receive timeout", receiveTimeout == null ? -1 : receiveTimeout);
+ }
resHeaders = result.getResponseHeaders();
resMetadata = result.getMetadata();
Object resMessage = oneway ? null : unmarshaller.read(result.getResponse(), resMetadata, resHeaders);
@@ -212,14 +243,14 @@
transport.end();
throw ce;
}
+ catch (TimeoutException te)
+ {
+ throw new WSTimeoutException("Connection timeout", connectionTimeout == null ? -1 : connectionTimeout);
+ }
catch (IOException ioe)
{
throw ioe;
}
- catch (TimeoutException te)
- {
- throw new WSTimeoutException(te.getMessage(), timeout);
- }
catch (WSTimeoutException toe)
{
throw toe;
14 years, 3 months
JBossWS SVN: r12972 - in framework/trunk/testsuite/test: java/org/jboss/test/ws/jaxws and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2010-09-15 06:31:19 -0400 (Wed, 15 Sep 2010)
New Revision: 12972
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/Endpoint.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointImpl.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointService.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/JBWS3114TestCase.java
framework/trunk/testsuite/test/resources/jaxws/jbws3114/
framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/
framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/jboss-web.xml
framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/web.xml
Modified:
framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-3114]:Added the testcase for stack agnostic timeout configuration
Modified: framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2010-09-14 17:11:02 UTC (rev 12971)
+++ framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2010-09-15 10:31:19 UTC (rev 12972)
@@ -745,13 +745,13 @@
</metainf>
</jar>
- <!-- jaxws-jbws2486 -->
- <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2486.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws2486/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/test-classes">
- <include name="org/jboss/test/ws/jaxws/jbws2486/*.class"/>
- <exclude name="org/jboss/test/ws/jaxws/jbws2486/*TestCase.class"/>
- </classes>
- </war>
+ <!-- jaxws-jbws2486 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2486.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws2486/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2486/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws2486/*TestCase.class"/>
+ </classes>
+ </war>
<!-- jbws2527 -->
<war warfile="${tests.output.dir}/test-libs/jaxws-jbws2527-client.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws2527/WEB-INF-client/web.xml">
@@ -1021,6 +1021,17 @@
</webinf>
</war>
+ <!-- jaxws-jbws3114 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws3114.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws3114/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws3114/Endpoint.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws3114/EndpointImpl.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/jbws3114/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
+
<!-- jaxws-jbws3123 -->
<jar destfile="${tests.output.dir}/test-libs/jaxws-jbws3123-ejb.jar">
<fileset dir="${tests.output.dir}/test-classes">
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/Endpoint.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/Endpoint.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/Endpoint.java 2010-09-15 10:31:19 UTC (rev 12972)
@@ -0,0 +1,30 @@
+/*
+ * 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.jbws3114;
+import javax.jws.WebService;
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws3114")
+public interface Endpoint
+{
+
+ public String echo(final String message);
+
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointImpl.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointImpl.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointImpl.java 2010-09-15 10:31:19 UTC (rev 12972)
@@ -0,0 +1,43 @@
+/*
+ * 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.jbws3114;
+
+import javax.jws.WebService;
+
+@WebService(name = "Endpoint", portName = "EndpointPort", serviceName="EndpointService", targetNamespace = "http://ws.jboss.org/jbws3114", endpointInterface = "org.jboss.test.ws.jaxws.jbws3114.Endpoint")
+public class EndpointImpl implements Endpoint
+{
+ public String echo(final String message)
+ {
+ try
+ {
+ //To cause the receive timeout
+ Thread.sleep(3);
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ }
+ return message;
+ }
+
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointService.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointService.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointService.java 2010-09-15 10:31:19 UTC (rev 12972)
@@ -0,0 +1,87 @@
+/*
+ * 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.jbws3114;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceException;
+
+@WebServiceClient(name = "EndpointService", targetNamespace = "http://ws.jboss.org/jbws3114")
+public class EndpointService
+ extends Service
+{
+
+ private final static URL ENDPOINTSERVICE_WSDL_LOCATION;
+ private final static WebServiceException ENDPOINTSERVICE_EXCEPTION;
+ private final static QName ENDPOINTSERVICE_QNAME = new QName("http://ws.jboss.org/jbws3114", "EndpointService");
+
+ static {
+ URL url = null;
+ WebServiceException e = null;
+ try {
+ url = new URL("http://localhost:8080/jaxws-jbws3114?wsdl");
+ } catch (MalformedURLException ex) {
+ e = new WebServiceException(ex);
+ }
+ ENDPOINTSERVICE_WSDL_LOCATION = url;
+ ENDPOINTSERVICE_EXCEPTION = e;
+ }
+
+ public EndpointService() {
+ super(__getWsdlLocation(), ENDPOINTSERVICE_QNAME);
+ }
+
+
+ public EndpointService(URL wsdlLocation) {
+ super(wsdlLocation, ENDPOINTSERVICE_QNAME);
+ }
+
+
+ public EndpointService(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ /**
+ *
+ * @return
+ * returns Endpoint
+ */
+ @WebEndpoint(name = "EndpointPort")
+ public Endpoint getEndpointPort() {
+ return super.getPort(new QName("http://ws.jboss.org/jbws3114", "EndpointPort"), Endpoint.class);
+ }
+
+
+ private static URL __getWsdlLocation() {
+ if (ENDPOINTSERVICE_EXCEPTION!= null) {
+ throw ENDPOINTSERVICE_EXCEPTION;
+ }
+ return ENDPOINTSERVICE_WSDL_LOCATION;
+ }
+
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/JBWS3114TestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/JBWS3114TestCase.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/JBWS3114TestCase.java 2010-09-15 10:31:19 UTC (rev 12972)
@@ -0,0 +1,73 @@
+/*
+ * 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.jbws3114;
+
+import java.net.URL;
+
+import javax.xml.ws.BindingProvider;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+/**
+ * https://jira.jboss.org/browse/JBWS-3114
+ * @author ema(a)redhat.com
+ */
+public class JBWS3114TestCase extends JBossWSTest
+{
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws3114";
+
+ private static Endpoint port;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS3114TestCase.class, "jaxws-jbws3114.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ EndpointService service = new EndpointService(wsdlURL);
+ port = service.getEndpointPort();
+ }
+
+ public void testConfigureTimeout() throws Exception
+ {
+ String response = port.echo("testjbws3114");
+ assertEquals("testjbws3114", response);
+ ((BindingProvider) port).getRequestContext().put("javax.xml.ws.client.connectionTimeout", "6000");
+ ((BindingProvider) port).getRequestContext().put("javax.xml.ws.client.receiveTimeout", "1");
+ try
+ {
+ port.echo("testjbws3114");
+ fail("Timeout exeception is expected");
+ }
+ catch (Exception e)
+ {
+ //expected
+ }
+
+ }
+}
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/jboss-web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/jboss-web.xml (rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/jboss-web.xml 2010-09-15 10:31:19 UTC (rev 12972)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <context-root>/jaxws-jbws3114</context-root>
+</jboss-web>
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/web.xml (rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/web.xml 2010-09-15 10:31:19 UTC (rev 12972)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" 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">
+
+ <servlet>
+ <servlet-name>Endpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws3114.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
14 years, 3 months
JBossWS SVN: r12971 - stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-14 13:11:02 -0400 (Tue, 14 Sep 2010)
New Revision: 12971
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
Log:
[JBWS-3101] Prevent NPE on null response message (which is possible when using Provider/Dispatch)
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2010-09-14 17:08:51 UTC (rev 12970)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2010-09-14 17:11:02 UTC (rev 12971)
@@ -399,6 +399,12 @@
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+
+ if (resMessage == null)
+ {
+ log.debug("Null response message");
+ return;
+ }
String wsaTo = null;
14 years, 3 months