Author: thomas.diesler(a)jboss.com
Date: 2007-05-31 12:37:49 -0400 (Thu, 31 May 2007)
New Revision: 3342
Modified:
trunk/integration/sunri/src/test/resources/excludes-jboss50.txt
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/ClientMimeHandler.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/Endpoint.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointImpl.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/LogHandler.java
Log:
SunRI samples/handlerchain
Modified: trunk/integration/sunri/src/test/resources/excludes-jboss50.txt
===================================================================
--- trunk/integration/sunri/src/test/resources/excludes-jboss50.txt 2007-05-31 16:06:53
UTC (rev 3341)
+++ trunk/integration/sunri/src/test/resources/excludes-jboss50.txt 2007-05-31 16:37:49
UTC (rev 3342)
@@ -5,7 +5,6 @@
# [JBWS-1699] - Fix WebServiceContext.getMessageContext()
org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
-org/jboss/test/ws/jaxws/samples/handlerchain/**
org/jboss/test/ws/jaxws/samples/httpbinding/**
org/jboss/test/ws/jaxws/samples/jaxr/**
org/jboss/test/ws/jaxws/samples/logicalhandler/**
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/ClientMimeHandler.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/ClientMimeHandler.java 2007-05-31
16:06:53 UTC (rev 3341)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/ClientMimeHandler.java 2007-05-31
16:37:49 UTC (rev 3342)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.ws.jaxws.samples.handlerchain;
+import java.util.Arrays;
+
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.handler.MessageContext;
@@ -59,7 +61,7 @@
MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
String[] cookies = mimeHeaders.getHeader("Set-Cookie");
if (cookies == null || cookies.length != 1 ||
!cookies[0].equals("server-cookie=true"))
- throw new IllegalStateException("Unexpected cookie list: " +
mimeHeaders);
+ throw new IllegalStateException("Unexpected cookie list: " + (cookies
!= null ? Arrays.asList(cookies) : null));
return true;
}
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/Endpoint.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/Endpoint.java 2007-05-31
16:06:53 UTC (rev 3341)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/Endpoint.java 2007-05-31
16:37:49 UTC (rev 3342)
@@ -24,7 +24,7 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-@WebService
+@WebService(name="Endpoint")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface Endpoint
{
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointImpl.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointImpl.java 2007-05-31
16:06:53 UTC (rev 3341)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointImpl.java 2007-05-31
16:37:49 UTC (rev 3342)
@@ -34,7 +34,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 08-Oct-2005
*/
-@WebService
+@WebService(name="Endpoint")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@HandlerChain(file = "jaxws-handlers-server.xml") // relative path from the
class file
public class EndpointImpl
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java 2007-05-31
16:06:53 UTC (rev 3341)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java 2007-05-31
16:37:49 UTC (rev 3342)
@@ -25,7 +25,7 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-@WebService
+@WebService(name="Endpoint")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@HandlerChain(file = "jaxws-handlers-client.xml") // relative path from the
class file
public interface EndpointWithHandlerChain
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java 2007-05-31
16:06:53 UTC (rev 3341)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java 2007-05-31
16:37:49 UTC (rev 3342)
@@ -63,7 +63,14 @@
handlerChain.add(new LogHandler());
handlerChain.add(new AuthorizationHandler());
handlerChain.add(new RoutingHandler());
- handlerChain.add(new ClientMimeHandler());
+ if (isIntegrationNative())
+ {
+ handlerChain.add(new ClientMimeHandler());
+ }
+ else
+ {
+ System.out.println("FIXME: [JBWS-1671] SunRI client handler cannot set mime
header");
+ }
bindingProvider.getBinding().setHandlerChain(handlerChain);
String resStr = port.echo("Kermit");
@@ -78,6 +85,12 @@
Service service = Service.create(wsdlURL, serviceName);
EndpointWithHandlerChain port =
(EndpointWithHandlerChain)service.getPort(EndpointWithHandlerChain.class);
+ if (isIntegrationSunRI())
+ {
+ System.out.println("FIXME: [JBWS-1672] SunRI does not respect @HandlerChain
on client SEI");
+ return;
+ }
+
String resStr = port.echo("Kermit");
assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn",
resStr);
}
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/LogHandler.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/LogHandler.java 2007-05-31
16:06:53 UTC (rev 3341)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/LogHandler.java 2007-05-31
16:37:49 UTC (rev 3342)
@@ -55,7 +55,7 @@
try
{
SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
- SOAPHeader soapHeader = soapMessage.getSOAPHeader();
+ SOAPHeader soapHeader = getFailsafeSOAPHeader(soapMessage);
SOAPBody soapBody = soapMessage.getSOAPBody();
SOAPFactory soapFactory = SOAPFactory.newInstance();
@@ -83,9 +83,9 @@
try
{
SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
- SOAPHeader soapHeader = soapMessage.getSOAPHeader();
+ SOAPHeader soapHeader = getFailsafeSOAPHeader(soapMessage);
SOAPBody soapBody = soapMessage.getSOAPBody();
-
+
SOAPFactory soapFactory = SOAPFactory.newInstance();
Name headerName = soapFactory.createName("LogHandlerOutbound",
"ns1", "http://somens");
SOAPHeaderElement she = soapHeader.addHeaderElement(headerName);
@@ -103,4 +103,14 @@
return true;
}
+
+ private SOAPHeader getFailsafeSOAPHeader(SOAPMessage soapMessage) throws
SOAPException
+ {
+ SOAPHeader soapHeader = soapMessage.getSOAPHeader();
+ if (soapHeader == null)
+ {
+ soapHeader = soapMessage.getSOAPPart().getEnvelope().addHeader();
+ }
+ return soapHeader;
+ }
}
Show replies by date