JBossWS SVN: r10849 - stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-10-07 08:19:30 -0400 (Wed, 07 Oct 2009)
New Revision: 10849
Modified:
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java
Log:
[JBWS-2674][JBWS-2754] Properly wait for end of transmission
Modified: stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java
===================================================================
--- stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java 2009-10-07 12:18:29 UTC (rev 10848)
+++ stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java 2009-10-07 12:19:30 UTC (rev 10849)
@@ -230,11 +230,15 @@
ChannelFuture cf = e.getChannel().write(response);
if (responseHeaders.containsKey(HttpHeaders.Names.CONTENT_TYPE))
{
- OutputStream out = new NettyTransportOutputStream(channel, 1024);
+ NettyTransportOutputStream out = new NettyTransportOutputStream(channel, 1024);
out.write(content.getBytes("UTF-8"));
out.close();
+ out.getChannelFuture().awaitUninterruptibly();
}
- cf.awaitUninterruptibly();
+ else
+ {
+ cf.awaitUninterruptibly();
+ }
}
private List<String> removeProhibitedCharacters(List<String> values)
15 years, 3 months
JBossWS SVN: r10848 - stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-10-07 08:18:29 -0400 (Wed, 07 Oct 2009)
New Revision: 10848
Modified:
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
Log:
Fixing invalid usecase (see http://java.sun.com/javaee/5/docs/api/javax/activation/DataSource.html#ge...)
Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
===================================================================
--- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java 2009-10-07 12:07:44 UTC (rev 10847)
+++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java 2009-10-07 12:18:29 UTC (rev 10848)
@@ -38,11 +38,10 @@
import javax.xml.ws.soap.MTOMFeature;
import javax.xml.ws.soap.SOAPBinding;
-import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.Endpoint1Iface;
-import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.Endpoint1Impl;
import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.DHRequest;
import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.DHResponse;
-import org.jboss.ws.Constants;
+import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.Endpoint1Iface;
+import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.Endpoint1Impl;
import org.jboss.wsf.test.JBossWSTest;
/**
@@ -61,13 +60,13 @@
@Override
protected void setUp() throws Exception
{
- System.setProperty(Constants.HTTP_KEEP_ALIVE, "false");
+// System.setProperty(Constants.HTTP_KEEP_ALIVE, "false");
}
@Override
protected void tearDown() throws Exception
{
- System.getProperties().remove(Constants.HTTP_KEEP_ALIVE);
+// System.getProperties().remove(Constants.HTTP_KEEP_ALIVE);
}
public void testTwoPorts() throws Exception
@@ -210,7 +209,6 @@
{
Endpoint1Iface port = this.getProxy(publishURL, mtomEnabled);
- final InputStream is = new ByteArrayInputStream("some string".getBytes());
DataSource ds = new DataSource()
{
@@ -221,7 +219,7 @@
public InputStream getInputStream() throws IOException
{
- return is;
+ return new ByteArrayInputStream("some string".getBytes());
}
public String getName()
@@ -235,6 +233,7 @@
}
};
+
DataHandler dh = new DataHandler(ds);
DHResponse response = port.echoDataHandler(new DHRequest(dh));
assertNotNull(response);
15 years, 3 months
JBossWS SVN: r10847 - in stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint: jse and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-10-07 08:07:44 -0400 (Wed, 07 Oct 2009)
New Revision: 10847
Modified:
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
Log:
[JBWS-2674][JBWS-2754] removing useless tomcat hack + extending API coverage (WIP)
Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
===================================================================
--- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2009-10-07 08:46:05 UTC (rev 10846)
+++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2009-10-07 12:07:44 UTC (rev 10847)
@@ -22,7 +22,6 @@
package org.jboss.test.ws.jaxws.endpoint;
import java.io.BufferedReader;
-import java.io.File;
import java.io.InputStreamReader;
import java.net.URL;
@@ -50,27 +49,10 @@
*/
public class EndpointTestCase extends JBossWSTest
{
+
public static Test suite()
{
- return new TestSetup(new JBossWSTestSetup(EndpointTestCase.class, "jaxws-endpoint-servlet.war")) {
-
- private Boolean useJBossWebLoader;
-
- protected void setUp() throws Exception
- {
- MBeanServerConnection server = JBossWSTestHelper.getServer();
- useJBossWebLoader = (Boolean)server.getAttribute(new ObjectName("jboss.web:service=WebServer"), "UseJBossWebLoader");
- server.setAttribute(new ObjectName("jboss.web:service=WebServer"), new Attribute("UseJBossWebLoader", Boolean.TRUE));
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- MBeanServerConnection server = JBossWSTestHelper.getServer();
- server.setAttribute(new ObjectName("jboss.web:service=WebServer"), new Attribute("UseJBossWebLoader", useJBossWebLoader));
- }
- };
+ return new TestSetup(new JBossWSTestSetup(EndpointTestCase.class, "jaxws-endpoint-servlet.war"));
}
public void testWSDLAccess() throws Exception
@@ -100,4 +82,5 @@
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
assertEquals("hello-world", br.readLine());
}
+
}
Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
===================================================================
--- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java 2009-10-07 08:46:05 UTC (rev 10846)
+++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java 2009-10-07 12:07:44 UTC (rev 10847)
@@ -46,7 +46,7 @@
import org.jboss.wsf.test.JBossWSTest;
/**
- * TODO: javadoc
+ * Tests endpoint dynamic publishing in JSE environment.
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
@@ -73,10 +73,10 @@
public void testTwoPorts() throws Exception
{
String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint1";
- Endpoint endpoint1 = publishEndpoint(Endpoint1Impl.class, publishURL1);
+ Endpoint endpoint1 = publishEndpoint1(Endpoint1Impl.class, publishURL1);
String publishURL2 = "http://" + getServerHost() + ":" + port2 + "/jaxws-endpoint2";
- Endpoint endpoint2 = publishEndpoint(new Endpoint1Impl(), publishURL2);
+ Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);
invokeEndpoint1(publishURL1);
invokeEndpoint1(publishURL2);
@@ -88,10 +88,10 @@
public void testTwoPortsAndLongPaths() throws Exception
{
String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number1";
- Endpoint endpoint1 = publishEndpoint(Endpoint1Impl.class, publishURL1);
+ Endpoint endpoint1 = publishEndpoint3(Endpoint1Impl.class, publishURL1);
String publishURL2 = "http://" + getServerHost() + ":" + port2 + "/jaxws-endpoint/endpoint/number2";
- Endpoint endpoint2 = publishEndpoint(new Endpoint1Impl(), publishURL2);
+ Endpoint endpoint2 = publishEndpoint1(new Endpoint1Impl(), publishURL2);
invokeEndpoint1(publishURL1);
invokeEndpoint1(publishURL2);
@@ -103,10 +103,10 @@
public void testTwoPortsAndAlmostIdenticalLongPaths() throws Exception
{
String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number1";
- Endpoint endpoint1 = publishEndpoint(Endpoint1Impl.class, publishURL1);
+ Endpoint endpoint1 = publishEndpoint2(Endpoint1Impl.class, publishURL1);
String publishURL2 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number11";
- Endpoint endpoint2 = publishEndpoint(new Endpoint1Impl(), publishURL2);
+ Endpoint endpoint2 = publishEndpoint3(new Endpoint1Impl(), publishURL2);
invokeEndpoint2(publishURL1);
invokeEndpoint2(publishURL2);
@@ -118,10 +118,10 @@
public void testTwoPortsAndIdenticalPaths() throws Exception
{
String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number1";
- Endpoint endpoint1 = publishEndpoint(Endpoint1Impl.class, publishURL1);
+ Endpoint endpoint1 = publishEndpoint1(Endpoint1Impl.class, publishURL1);
String publishURL2 = "http://" + getServerHost() + ":" + port2 + "/jaxws-endpoint/endpoint/number1";
- Endpoint endpoint2 = publishEndpoint(new Endpoint1Impl(), publishURL2);
+ Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);
invokeEndpoint2(publishURL1);
invokeEndpoint2(publishURL2);
@@ -133,7 +133,7 @@
public void testEndpointException() throws Exception
{
String publishURL = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number1";
- Endpoint endpoint = publishEndpoint(Endpoint1Impl.class, publishURL);
+ Endpoint endpoint = publishEndpoint3(Endpoint1Impl.class, publishURL);
invokeEndpoint3(publishURL);
endpoint.stop();
}
@@ -143,19 +143,31 @@
for (int i = 0; i < 2; i++)
{
String publishURL = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number1";
- Endpoint endpoint = publishEndpoint(Endpoint1Impl.class, publishURL);
+ Endpoint endpoint = publishEndpoint3(Endpoint1Impl.class, publishURL);
invokeEndpoint4(publishURL);
endpoint.stop();
}
}
- private Endpoint publishEndpoint(Object epImpl, String publishURL)
+ private Endpoint publishEndpoint1(Object epImpl, String publishURL)
{
Endpoint endpoint = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, epImpl);
endpoint.publish(publishURL);
return endpoint;
}
+
+ private Endpoint publishEndpoint2(Object epImpl, String publishURL)
+ {
+ Endpoint endpoint = Endpoint.create(epImpl);
+ endpoint.publish(publishURL);
+ return endpoint;
+ }
+ private Endpoint publishEndpoint3(Object epImpl, String publishURL)
+ {
+ return Endpoint.publish(publishURL, epImpl);
+ }
+
private void invokeEndpoint1(String publishURL) throws Exception
{
Endpoint1Iface port = this.getProxy(publishURL);
15 years, 3 months
JBossWS SVN: r10846 - in spi/branches/ropalka/src/main/java/org/jboss/wsf/spi: invocation and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-10-07 04:46:05 -0400 (Wed, 07 Oct 2009)
New Revision: 10846
Modified:
spi/branches/ropalka/src/main/java/org/jboss/wsf/spi/deployment/AbstractExtensible.java
spi/branches/ropalka/src/main/java/org/jboss/wsf/spi/invocation/InvocationContext.java
Log:
[JBWS-2674][JBWS-2754] refactoring (WIP)
Modified: spi/branches/ropalka/src/main/java/org/jboss/wsf/spi/deployment/AbstractExtensible.java
===================================================================
--- spi/branches/ropalka/src/main/java/org/jboss/wsf/spi/deployment/AbstractExtensible.java 2009-10-07 08:45:23 UTC (rev 10845)
+++ spi/branches/ropalka/src/main/java/org/jboss/wsf/spi/deployment/AbstractExtensible.java 2009-10-07 08:46:05 UTC (rev 10846)
@@ -34,7 +34,8 @@
*/
public abstract class AbstractExtensible implements Extensible
{
- private Map<Class, Object> attachments = new HashMap<Class, Object>();
+
+ private Map<Class<?>, Object> attachments = new HashMap<Class<?>, Object>();
private Map<String, Object> properties = new HashMap<String, Object>();
public Collection<Object> getAttachments()
@@ -81,4 +82,5 @@
{
properties.putAll(props);
}
+
}
Modified: spi/branches/ropalka/src/main/java/org/jboss/wsf/spi/invocation/InvocationContext.java
===================================================================
--- spi/branches/ropalka/src/main/java/org/jboss/wsf/spi/invocation/InvocationContext.java 2009-10-07 08:45:23 UTC (rev 10845)
+++ spi/branches/ropalka/src/main/java/org/jboss/wsf/spi/invocation/InvocationContext.java 2009-10-07 08:46:05 UTC (rev 10846)
@@ -21,8 +21,7 @@
*/
package org.jboss.wsf.spi.invocation;
-import java.util.Map;
-import java.util.HashMap;
+import org.jboss.wsf.spi.deployment.AbstractExtensible;
/**
* A basic invocation context.
@@ -30,10 +29,10 @@
* @author Thomas.Diesler(a)jboss.com
* @since 20-Apr-2007
*/
-public class InvocationContext
+public class InvocationContext extends AbstractExtensible
{
+
private Object targetBean;
- private Map<Class, Object> attachments = new HashMap<Class, Object>();
public Object getTargetBean()
{
@@ -45,19 +44,4 @@
this.targetBean = targetBean;
}
-
- public <T> T addAttachment(Class<T> key, Object value)
- {
- return (T)attachments.put(key, value);
- }
-
- public <T> T getAttachment(Class<T> key)
- {
- return (T)attachments.get(key);
- }
-
- public <T> T removeAttachment(Class<T> key)
- {
- return (T)attachments.get(key);
- }
}
15 years, 3 months
JBossWS SVN: r10845 - common/branches/ropalka/src/main/java/org/jboss/ws.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-10-07 04:45:23 -0400 (Wed, 07 Oct 2009)
New Revision: 10845
Modified:
common/branches/ropalka/src/main/java/org/jboss/ws/Constants.java
Log:
[JBWS-2674][JBWS-2754] finally passing attachments test (WIP)
Modified: common/branches/ropalka/src/main/java/org/jboss/ws/Constants.java
===================================================================
--- common/branches/ropalka/src/main/java/org/jboss/ws/Constants.java 2009-10-07 08:04:49 UTC (rev 10844)
+++ common/branches/ropalka/src/main/java/org/jboss/ws/Constants.java 2009-10-07 08:45:23 UTC (rev 10845)
@@ -322,4 +322,11 @@
static final String HTTP_KEEP_ALIVE = "org.jboss.ws.http.keepAlive";
static final String HTTP_MAX_CONNECTIONS = "org.jboss.ws.http.maxConnections";
+
+ static final String NETTY_REQUEST_HEADERS = "org.jboss.ws.http.netty.RequestHeaders";
+
+ static final String NETTY_RESPONSE_HEADERS = "org.jboss.ws.http.netty.ResponseHeaders";
+
+ static final String NETTY_STATUS_CODE = "org.jboss.ws.http.netty.StatusCode";
+
}
15 years, 3 months
JBossWS SVN: r10844 - in stack/native/branches/ropalka/modules/testsuite/native-tests/src/test: java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-10-07 04:04:49 -0400 (Wed, 07 Oct 2009)
New Revision: 10844
Removed:
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/resources/jaxws/endpoint/attachment.txt
Modified:
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java
Log:
[JBWS-2753] providing test case
Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
===================================================================
--- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java 2009-10-07 07:35:24 UTC (rev 10843)
+++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java 2009-10-07 08:04:49 UTC (rev 10844)
@@ -22,14 +22,15 @@
package org.jboss.test.ws.jaxws.endpoint.jse;
import java.io.BufferedReader;
-import java.io.File;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.io.OutputStream;
import java.net.URL;
import javax.activation.DataHandler;
-import javax.activation.FileDataSource;
+import javax.activation.DataSource;
import javax.xml.namespace.QName;
import javax.xml.ws.Endpoint;
import javax.xml.ws.Service;
@@ -41,6 +42,7 @@
import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.Endpoint1Impl;
import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.DHRequest;
import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.DHResponse;
+import org.jboss.ws.Constants;
import org.jboss.wsf.test.JBossWSTest;
/**
@@ -50,13 +52,24 @@
*/
public final class UsecasesTestCase extends JBossWSTest
{
- private static String fs = System.getProperty("file.separator");
- private static File attachmentFile = JBossWSTest.getResourceFile("jaxws" + fs + "endpoint" + fs + "attachment.txt");
private static WebServiceFeature[] mtomEnabled = new WebServiceFeature[] { new MTOMFeature(true) };
private static int port1 = 8871;
private static int port2 = 8872;
+
+
+@Override
+ protected void setUp() throws Exception
+ {
+ System.setProperty(Constants.HTTP_KEEP_ALIVE, "false");
+ }
+ @Override
+ protected void tearDown() throws Exception
+ {
+ System.getProperties().remove(Constants.HTTP_KEEP_ALIVE);
+ }
+
public void testTwoPorts() throws Exception
{
String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint1";
@@ -185,8 +198,32 @@
{
Endpoint1Iface port = this.getProxy(publishURL, mtomEnabled);
- FileDataSource fds = new FileDataSource(attachmentFile);
- DataHandler dh = new DataHandler(fds);
+ final InputStream is = new ByteArrayInputStream("some string".getBytes());
+ DataSource ds = new DataSource()
+ {
+
+ public String getContentType()
+ {
+ return "text/plain";
+ }
+
+ public InputStream getInputStream() throws IOException
+ {
+ return is;
+ }
+
+ public String getName()
+ {
+ return "unspecified";
+ }
+
+ public OutputStream getOutputStream() throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ };
+ DataHandler dh = new DataHandler(ds);
DHResponse response = port.echoDataHandler(new DHRequest(dh));
assertNotNull(response);
Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java
===================================================================
--- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java 2009-10-07 07:35:24 UTC (rev 10843)
+++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java 2009-10-07 08:04:49 UTC (rev 10844)
@@ -22,15 +22,12 @@
package org.jboss.test.ws.jaxws.endpoint.jse.endpoints;
import java.io.IOException;
-import java.io.InputStream;
import javax.activation.DataHandler;
import javax.jws.WebService;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.soap.MTOM;
-import org.jboss.logging.Logger;
-
/**
* Service implementation.
*
@@ -46,7 +43,6 @@
public class Endpoint1Impl implements Endpoint1Iface
{
- private Logger log = Logger.getLogger(Endpoint1Impl.class);
private int count;
public String echo(String input)
@@ -71,13 +67,14 @@
try
{
- log.info("Content type: " + dataHandler.getContentType());
- Object dataContent = dataHandler.getContent();
- log.info("Content class: " + dataContent);
- if ( dataContent instanceof InputStream )
+ if (!dataHandler.getContentType().equals("text/plain"))
{
- ((InputStream)dataContent).close();
+ throw new WebServiceException("Wrong content type");
}
+ if (!dataHandler.getContent().equals("some string"))
+ {
+ throw new WebServiceException("Wrong data");
+ }
}
catch (IOException e)
{
Deleted: stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/resources/jaxws/endpoint/attachment.txt
===================================================================
--- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/resources/jaxws/endpoint/attachment.txt 2009-10-07 07:35:24 UTC (rev 10843)
+++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/resources/jaxws/endpoint/attachment.txt 2009-10-07 08:04:49 UTC (rev 10844)
@@ -1 +0,0 @@
-This is the file content
\ No newline at end of file
15 years, 3 months
JBossWS SVN: r10843 - in stack/native/branches/ropalka/modules: testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-10-07 03:35:24 -0400 (Wed, 07 Oct 2009)
New Revision: 10843
Modified:
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java
Log:
[JBWS-2674][JBWS-2754] finally passing attachments test (WIP)
Modified: stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java
===================================================================
--- stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java 2009-10-06 21:38:01 UTC (rev 10842)
+++ stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java 2009-10-07 07:35:24 UTC (rev 10843)
@@ -41,6 +41,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBufferInputStream;
import org.jboss.netty.buffer.ChannelBuffers;
+import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelStateEvent;
@@ -57,6 +58,7 @@
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
import org.jboss.netty.handler.codec.http.HttpVersion;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.client.transport.NettyTransportOutputStream;
import org.jboss.wsf.spi.invocation.InvocationContext;
/**
@@ -126,7 +128,7 @@
}
finally
{
- writeResponse(e, request, baos.toString(), statusCode, responseHeaders);
+ writeResponse(e, request, baos.toString(), statusCode, responseHeaders, ctx.getChannel());
}
}
@@ -180,7 +182,8 @@
return retVal;
}
- private void writeResponse(MessageEvent e, HttpRequest request, String content, int statusCode, Map<String, List<String>> responseHeaders)
+ private void writeResponse(MessageEvent e, HttpRequest request, String content, int statusCode, Map<String,
+ List<String>> responseHeaders, Channel channel) throws IOException
{
// Build the response object.
HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, getResponseStatus(statusCode));
@@ -192,11 +195,19 @@
{
key = iterator.next();
values = responseHeaders.get(key);
+ values = removeProhibitedCharacters(values);
response.setHeader(key, values);
}
- response.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text/xml; charset=UTF-8");
- response.setHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(content.length()));
- response.setContent(ChannelBuffers.copiedBuffer(content, "UTF-8"));
+ if (!responseHeaders.containsKey(HttpHeaders.Names.CONTENT_TYPE))
+ {
+ response.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text/xml; charset=UTF-8");
+ response.setHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(content.length()));
+ response.setContent(ChannelBuffers.copiedBuffer(content, "UTF-8"));
+ }
+ else
+ {
+ response.setHeader(HttpHeaders.Names.TRANSFER_ENCODING, "chunked");
+ }
String cookieString = request.getHeader(HttpHeaders.Names.COOKIE);
if (cookieString != null)
@@ -217,8 +228,35 @@
// Write the response.
ChannelFuture cf = e.getChannel().write(response);
+ if (responseHeaders.containsKey(HttpHeaders.Names.CONTENT_TYPE))
+ {
+ OutputStream out = new NettyTransportOutputStream(channel, 1024);
+ out.write(content.getBytes("UTF-8"));
+ out.close();
+ }
cf.awaitUninterruptibly();
}
+
+ private List<String> removeProhibitedCharacters(List<String> values)
+ {
+ List<String> retVal = new LinkedList<String>();
+ for (int i = 0; i < values.size(); i++)
+ {
+ retVal.add(i, removeProhibitedCharacters(values.get(i)));
+ }
+
+ return retVal;
+ }
+
+ private String removeProhibitedCharacters(String s)
+ {
+ String retVal = s;
+
+ retVal = retVal.replace('\r', ' ');
+ retVal = retVal.replace('\n', ' ');
+
+ return retVal;
+ }
private HttpResponseStatus getResponseStatus(int statusCode)
{
Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java
===================================================================
--- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java 2009-10-06 21:38:01 UTC (rev 10842)
+++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java 2009-10-07 07:35:24 UTC (rev 10843)
@@ -30,7 +30,7 @@
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
@WebService(targetNamespace = "http://org.jboss.ws/jaxws/endpoint/jse/endpoints/")
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
+@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface Endpoint1Iface
{
String echo(String input);
Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java
===================================================================
--- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java 2009-10-06 21:38:01 UTC (rev 10842)
+++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java 2009-10-07 07:35:24 UTC (rev 10843)
@@ -26,7 +26,6 @@
import javax.activation.DataHandler;
import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.soap.MTOM;
@@ -43,7 +42,6 @@
targetNamespace = "http://org.jboss.ws/jaxws/endpoint/jse/endpoints/",
endpointInterface = "org.jboss.test.ws.jaxws.endpoint.jse.endpoints.Endpoint1Iface"
)
-@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@MTOM
public class Endpoint1Impl implements Endpoint1Iface
{
15 years, 3 months
JBossWS SVN: r10842 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-10-06 17:38:01 -0400 (Tue, 06 Oct 2009)
New Revision: 10842
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java
Log:
[JBWS-2714] Removing useless invocation
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java 2009-10-06 21:28:39 UTC (rev 10841)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java 2009-10-06 21:38:01 UTC (rev 10842)
@@ -90,7 +90,7 @@
*/
public void testEndpoint() throws Exception
{
- System.out.println("FIXME: [CXF-2460] Re-enable test after updating to CXF 2.2.4");
+ System.out.println("FIXME: [CXF-2460][JBWS-2714] Re-enable test after updating to CXF 2.2.4");
// try
// {
// URL wsdlURL = new URL(endpointAddress + "?wsdl");
@@ -123,7 +123,7 @@
URL wsdlURL = new URL(endpointAddress + "?wsdl");
QName serviceName = new QName("http://org.jboss.ws/cxf/jaxbintros", "EndpointBeanService");
- setBindingCustomizationOnClientSide();
+ //setBindingCustomizationOnClientSide();
Service service = Service.create(wsdlURL, serviceName);
AnnotatedUserEndpoint port = service.getPort(AnnotatedUserEndpoint.class);
AnnotatedUserType user = new AnnotatedUserType();
15 years, 3 months