Author: alessio.soldano(a)jboss.com
Date: 2012-05-25 13:09:44 -0400 (Fri, 25 May 2012)
New Revision: 16321
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/AuthorizationHandler.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/EJB3EndpointImpl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/Endpoint.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/EndpointHandler.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/EndpointImpl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/JBWS3287TestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/LogHandler.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/RoutingHandler.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/jaxws-handlers-server.xml
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/META-INF/
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/META-INF/jaxws-endpoint-config.xml
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/META-INF/jboss-webservices.xml
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/jaxws-endpoint-config.xml
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/jboss-webservices.xml
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/web-A.xml
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/web-B.xml
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-3287] Adding testcase
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml 2012-05-25
17:09:13 UTC (rev 16320)
+++ shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml 2012-05-25
17:09:44 UTC (rev 16321)
@@ -1112,35 +1112,75 @@
</classes>
</war>
- <!-- jaxws-jbws3282 -->
- <war
warfile="${tests.output.dir}/test-libs/jaxws-jbws3282.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws3282/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/test-classes">
- <include
name="org/jboss/test/ws/jaxws/jbws3282/EndpointImpl.class"/>
- <include
name="org/jboss/test/ws/jaxws/jbws3282/Endpoint.class"/>
- <include
name="org/jboss/test/ws/jaxws/jbws3282/*Handler.class"/>
- <include
name="org/jboss/test/ws/jaxws/jbws3282/jaxws-handlers-server.xml"/>
- </classes>
- <webinf
dir="${tests.output.dir}/test-resources/jaxws/jbws3282/WEB-INF">
- <include name="**/*" />
- </webinf>
- </war>
+ <!-- jaxws-jbws3282 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws3282.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws3282/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws3282/EndpointImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3282/Endpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3282/*Handler.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3282/jaxws-handlers-server.xml"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/jbws3282/WEB-INF">
+ <include name="**/jaxws-endpoint-config.xml" />
+ </webinf>
+ </war>
+
+ <!-- jaxws-jbws3287-A -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws3287-A.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws3287/WEB-INF/web-A.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws3287/EndpointImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3287/Endpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3287/*Handler.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3287/jaxws-handlers-server.xml"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/jbws3287/WEB-INF">
+ <include name="**/jaxws-endpoint-config.xml" />
+ <include name="**/jboss-webservices.xml" />
+ </webinf>
+ </war>
+
+ <!-- jaxws-jbws3287-B -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws3287-B.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws3287/WEB-INF/web-B.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws3287/EndpointImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3287/Endpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3287/*Handler.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3287/jaxws-handlers-server.xml"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/jbws3287/WEB-INF">
+ <include name="**/jaxws-endpoint-config.xml" />
+ </webinf>
+ </war>
+
+ <!-- jaxws-jbws3287-C -->
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-jbws3287-C.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws3287/EJB3EndpointImpl.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws3287/Endpoint.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws3287/*Handler.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3287/jaxws-handlers-server.xml"/>
+ </fileset>
+ <metainf
dir="${tests.output.dir}/test-resources/jaxws/jbws3287/META-INF">
+ <include name="**/*" />
+ </metainf>
+ </jar>
+
+ <!-- jaxws-jbws3276 -->
+ <war
warfile="${tests.output.dir}/test-libs/jaxws-jbws3276-usecase1.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws3276/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws3276/POJOIface.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3276/POJOImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3276/AnonymousPOJO.class"/>
+ </classes>
+ </war>
- <!-- jaxws-jbws3276 -->
- <war
warfile="${tests.output.dir}/test-libs/jaxws-jbws3276-usecase1.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws3276/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/test-classes">
- <include
name="org/jboss/test/ws/jaxws/jbws3276/POJOIface.class"/>
- <include
name="org/jboss/test/ws/jaxws/jbws3276/POJOImpl.class"/>
- <include
name="org/jboss/test/ws/jaxws/jbws3276/AnonymousPOJO.class"/>
- </classes>
- </war>
+ <war
warfile="${tests.output.dir}/test-libs/jaxws-jbws3276-usecase2.war"
needxmlfile="false">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws3276/POJOIface.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3276/AnonymousPOJO.class"/>
+ </classes>
+ </war>
- <war
warfile="${tests.output.dir}/test-libs/jaxws-jbws3276-usecase2.war"
needxmlfile="false">
- <classes dir="${tests.output.dir}/test-classes">
- <include
name="org/jboss/test/ws/jaxws/jbws3276/POJOIface.class"/>
- <include
name="org/jboss/test/ws/jaxws/jbws3276/AnonymousPOJO.class"/>
- </classes>
- </war>
-
<!-- jaxws-jbws3293 -->
<war warfile="${tests.output.dir}/test-libs/jaxws-jbws3293.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws3293/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/AuthorizationHandler.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/AuthorizationHandler.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/AuthorizationHandler.java 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3287;
+
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.api.handler.GenericSOAPHandler;
+
+public class AuthorizationHandler extends GenericSOAPHandler
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(AuthorizationHandler.class);
+
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ log.info("handleInbound");
+
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPBody soapBody = soapMessage.getSOAPBody();
+
+ SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
+ SOAPElement soapElement =
(SOAPElement)soapBodyElement.getChildElements().next();
+ String value = soapElement.getValue();
+ soapElement.setValue(value + "|AuthIn");
+ }
+ catch (SOAPException e)
+ {
+ throw new WebServiceException(e);
+ }
+
+ return true;
+ }
+
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
+ log.info("handleOutbound");
+
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPBody soapBody = soapMessage.getSOAPBody();
+
+ SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
+ SOAPElement soapElement =
(SOAPElement)soapBodyElement.getChildElements().next();
+ String value = soapElement.getValue();
+ soapElement.setValue(value + "|AuthOut");
+ }
+ catch (SOAPException e)
+ {
+ throw new WebServiceException(e);
+ }
+
+ return true;
+ }
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/EJB3EndpointImpl.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/EJB3EndpointImpl.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/EJB3EndpointImpl.java 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3287;
+
+import javax.ejb.Stateless;
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+
+@Stateless
+@WebService(name="Endpoint", serviceName="EndpointImplService")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@HandlerChain(file = "jaxws-handlers-server.xml") // relative path from the
class file
+public class EJB3EndpointImpl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(EJB3EndpointImpl.class);
+
+ @WebMethod
+ public String echo(String input)
+ {
+ log.info("echo: " + input);
+ return input + "|endpoint";
+ }
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/Endpoint.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/Endpoint.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/Endpoint.java 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3287;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name="Endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface Endpoint
+{
+ public String echo(String input);
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/EndpointHandler.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/EndpointHandler.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/EndpointHandler.java 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3287;
+
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.api.handler.GenericSOAPHandler;
+
+public class EndpointHandler extends GenericSOAPHandler
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(EndpointHandler.class);
+
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ log.info("handleInbound");
+
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPBody soapBody = soapMessage.getSOAPBody();
+
+ SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
+ SOAPElement soapElement =
(SOAPElement)soapBodyElement.getChildElements().next();
+ String value = soapElement.getValue();
+ soapElement.setValue(value + "|EpIn");
+ }
+ catch (SOAPException e)
+ {
+ throw new WebServiceException(e);
+ }
+
+ return true;
+ }
+
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
+ log.info("handleOutbound");
+
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPBody soapBody = soapMessage.getSOAPBody();
+
+ SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
+ SOAPElement soapElement =
(SOAPElement)soapBodyElement.getChildElements().next();
+ String value = soapElement.getValue();
+ soapElement.setValue(value + "|EpOut");
+ }
+ catch (SOAPException e)
+ {
+ throw new WebServiceException(e);
+ }
+
+ return true;
+ }
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/EndpointImpl.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/EndpointImpl.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/EndpointImpl.java 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3287;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+
+@WebService(name="Endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@HandlerChain(file = "jaxws-handlers-server.xml") // relative path from the
class file
+public class EndpointImpl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(EndpointImpl.class);
+
+ @WebMethod
+ public String echo(String input)
+ {
+ log.info("echo: " + input);
+ return input + "|endpoint";
+ }
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/JBWS3287TestCase.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/JBWS3287TestCase.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/JBWS3287TestCase.java 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3287;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Verifies deployment descriptor support for jbossws-config-file / jbossws-config-name
+ *
+ *
https://issues.jboss.org/browse/JBWS-3287
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-May-2012
+ */
+public class JBWS3287TestCase extends JBossWSTest
+{
+ private static final String targetNS =
"http://jbws3287.jaxws.ws.test.jboss.org/";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS3287TestCase.class, "jaxws-jbws3287-A.war,
jaxws-jbws3287-B.war, jaxws-jbws3287-C.jar");
+ }
+
+ public void testJBossWebservicesXmlDD() throws Exception
+ {
+ runTestInternal("jaxws-jbws3287-A/TestService?wsdl");
+ }
+
+ public void testWebXmlDD() throws Exception
+ {
+ runTestInternal("jaxws-jbws3287-B/TestService?wsdl");
+ }
+
+ public void testEJB3JBossWebservicesXmlDD() throws Exception
+ {
+ runTestInternal("jaxws-jbws3287-C/EndpointImplService/Endpoint?wsdl");
+ }
+
+ private void runTestInternal(String path) throws Exception {
+ QName serviceName = new QName(targetNS, "EndpointImplService");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/" +
path);
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+
+ String resStr = port.echo("Kermit");
+
assertEquals("Kermit|RoutIn|AuthIn|EpIn|LogIn|endpoint|LogOut|EpOut|AuthOut|RoutOut",
resStr);
+ }
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/LogHandler.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/LogHandler.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/LogHandler.java 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3287;
+
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.api.handler.GenericSOAPHandler;
+
+public class LogHandler extends GenericSOAPHandler
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(LogHandler.class);
+
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ log.info("handleInbound");
+
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPBody soapBody = soapMessage.getSOAPBody();
+
+ SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
+ SOAPElement soapElement =
(SOAPElement)soapBodyElement.getChildElements().next();
+ String value = soapElement.getValue();
+ soapElement.setValue(value + "|LogIn");
+ }
+ catch (SOAPException e)
+ {
+ throw new WebServiceException(e);
+ }
+
+ return true;
+ }
+
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
+ log.info("handleOutbound");
+
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPBody soapBody = soapMessage.getSOAPBody();
+
+ SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
+ SOAPElement soapElement =
(SOAPElement)soapBodyElement.getChildElements().next();
+ String value = soapElement.getValue();
+ soapElement.setValue(value + "|LogOut");
+ }
+ catch (SOAPException e)
+ {
+ throw new WebServiceException(e);
+ }
+
+ return true;
+ }
+
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/RoutingHandler.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/RoutingHandler.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/RoutingHandler.java 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3287;
+
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.api.handler.GenericSOAPHandler;
+
+public class RoutingHandler extends GenericSOAPHandler
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(RoutingHandler.class);
+
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ log.info("handleInbound");
+
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPBody soapBody = soapMessage.getSOAPBody();
+
+ SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
+ SOAPElement soapElement =
(SOAPElement)soapBodyElement.getChildElements().next();
+ String value = soapElement.getValue();
+ soapElement.setValue(value + "|RoutIn");
+ }
+ catch (SOAPException e)
+ {
+ throw new WebServiceException(e);
+ }
+
+ return true;
+ }
+
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
+ log.info("handleOutbound");
+
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPBody soapBody = soapMessage.getSOAPBody();
+
+ SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
+ SOAPElement soapElement =
(SOAPElement)soapBodyElement.getChildElements().next();
+ String value = soapElement.getValue();
+ soapElement.setValue(value + "|RoutOut");
+ }
+ catch (SOAPException e)
+ {
+ throw new WebServiceException(e);
+ }
+
+ return true;
+ }
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/jaxws-handlers-server.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/jaxws-handlers-server.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3287/jaxws-handlers-server.xml 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<handler-chains
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
javaee_web_services_1_2.xsd">
+
+ <handler-chain>
+ <handler>
+ <handler-name> EndpointHandler </handler-name>
+ <handler-class> org.jboss.test.ws.jaxws.jbws3287.EndpointHandler
</handler-class>
+ </handler>
+ </handler-chain>
+</handler-chains>
\ No newline at end of file
Added:
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/META-INF/jaxws-endpoint-config.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/META-INF/jaxws-endpoint-config.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/META-INF/jaxws-endpoint-config.xml 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0
schema/jbossws-jaxws-config_4_0.xsd">
+
+ <endpoint-config>
+ <config-name>Custom Endpoint</config-name>
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Log Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.test.ws.jaxws.jbws3287.LogHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Authorization Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.test.ws.jaxws.jbws3287.AuthorizationHandler</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name>Routing Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.test.ws.jaxws.jbws3287.RoutingHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </endpoint-config>
+
+</jaxws-config>
\ No newline at end of file
Added:
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/META-INF/jboss-webservices.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/META-INF/jboss-webservices.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/META-INF/jboss-webservices.xml 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,11 @@
+<?xml version="1.1" encoding="UTF-8"?>
+<webservices
+
xmlns="http://www.jboss.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ version="1.2"
+
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee">
+
+ <config-name>Custom Endpoint</config-name>
+ <config-file>META-INF/jaxws-endpoint-config.xml</config-file>
+
+</webservices>
\ No newline at end of file
Added:
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/jaxws-endpoint-config.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/jaxws-endpoint-config.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/jaxws-endpoint-config.xml 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0
schema/jbossws-jaxws-config_4_0.xsd">
+
+ <endpoint-config>
+ <config-name>Custom Endpoint</config-name>
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Log Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.test.ws.jaxws.jbws3287.LogHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Authorization Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.test.ws.jaxws.jbws3287.AuthorizationHandler</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name>Routing Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.test.ws.jaxws.jbws3287.RoutingHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </endpoint-config>
+
+</jaxws-config>
\ No newline at end of file
Added:
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/jboss-webservices.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/jboss-webservices.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/jboss-webservices.xml 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,11 @@
+<?xml version="1.1" encoding="UTF-8"?>
+<webservices
+
xmlns="http://www.jboss.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ version="1.2"
+
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee">
+
+ <config-name>Custom Endpoint</config-name>
+ <config-file>WEB-INF/jaxws-endpoint-config.xml</config-file>
+
+</webservices>
\ No newline at end of file
Added:
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/web-A.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/web-A.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/web-A.xml 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>TestService</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws3287.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Added:
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/web-B.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/web-B.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3287/WEB-INF/web-B.xml 2012-05-25
17:09:44 UTC (rev 16321)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>TestService</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws3287.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+ <context-param>
+ <param-name>jbossws-config-name</param-name>
+ <param-value>Custom Endpoint</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>jbossws-config-file</param-name>
+ <param-value>WEB-INF/jaxws-endpoint-config.xml</param-value>
+ </context-param>
+
+</web-app>
+