JBossWS SVN: r2639 - trunk/jbossws-tests/ant-import.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-19 08:28:32 -0400 (Mon, 19 Mar 2007)
New Revision: 2639
Modified:
trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
Log:
[jbws-1581] add jboss-web.xml
Modified: trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-03-19 12:05:46 UTC (rev 2638)
+++ trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-03-19 12:28:32 UTC (rev 2639)
@@ -242,6 +242,9 @@
<include name="org/jboss/test/ws/jaxws/jbws1581/EndpointBean.class"/>
<include name="org/jboss/test/ws/jaxws/jbws1581/EndpointInterface.class"/>
</classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/jbws1581/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
</war>
<jar jarfile="${tests.output.dir}/libs/jaxws-jbws1581.jar">
<fileset dir="${tests.output.dir}/classes">
17 years, 9 months
JBossWS SVN: r2638 - in trunk/jbossws-tests: src/java/org/jboss/test/ws/jaxws and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-19 08:05:46 -0400 (Mon, 19 Mar 2007)
New Revision: 2638
Added:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EJB3Bean.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EJB3Remote.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EndpointBean.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EndpointInterface.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/JBWS1581TestCase.java
trunk/jbossws-tests/src/resources/jaxws/jbws1581/
trunk/jbossws-tests/src/resources/jaxws/jbws1581/META-INF/
trunk/jbossws-tests/src/resources/jaxws/jbws1581/META-INF/wsdl/
trunk/jbossws-tests/src/resources/jaxws/jbws1581/META-INF/wsdl/TestService.wsdl
trunk/jbossws-tests/src/resources/jaxws/jbws1581/WEB-INF/
trunk/jbossws-tests/src/resources/jaxws/jbws1581/WEB-INF/web.xml
Modified:
trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
Log:
Add test for jbws-1581
Modified: trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-03-18 08:37:19 UTC (rev 2637)
+++ trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-03-19 12:05:46 UTC (rev 2638)
@@ -236,6 +236,24 @@
</classes>
</war>
+ <!-- jaxws-jbws1581 -->
+ <war warfile="${tests.output.dir}/libs/jaxws-jbws1581.war" webxml="${tests.output.dir}/resources/jaxws/jbws1581/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/jbws1581/EndpointBean.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws1581/EndpointInterface.class"/>
+ </classes>
+ </war>
+ <jar jarfile="${tests.output.dir}/libs/jaxws-jbws1581.jar">
+ <fileset dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/jbws1581/EJB3Bean.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws1581/EJB3Remote.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws1581/EndpointInterface.class"/>
+ </fileset>
+ <metainf dir="${tests.output.dir}/resources/jaxws/jbws1581/META-INF">
+ <include name="wsdl/**"/>
+ </metainf>
+ </jar>
+
<!-- jaxws metadata -->
<war warfile="${tests.output.dir}/libs/jaxws-metadata.war" webxml="${tests.output.dir}/resources/jaxws/metadata/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EJB3Bean.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EJB3Bean.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EJB3Bean.java 2007-03-19 12:05:46 UTC (rev 2638)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws1581;
+
+import java.net.URL;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.xml.ws.WebServiceRef;
+
+import org.jboss.annotation.ejb.RemoteBinding;
+
+@Stateless
+(a)Remote(EJB3Remote.class)
+@RemoteBinding(jndiBinding = "/ejb3/EJB3Bean")
+public class EJB3Bean implements EJB3Remote
+{
+ @WebServiceRef(wsdlLocation = "META-INF/wsdl/TestService.wsdl")
+ public EndpointInterface port;
+
+ public String runTest(String message)
+ {
+ URL seiSource = EndpointInterface.class.getProtectionDomain().getCodeSource().getLocation();
+ URL ejb3Source = EJB3Bean.class.getProtectionDomain().getCodeSource().getLocation();
+
+ if (seiSource.equals(ejb3Source) == false)
+ message = "SEI incorrectly loaded from: " + seiSource;
+
+ return port.hello(message);
+ }
+
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EJB3Bean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EJB3Remote.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EJB3Remote.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EJB3Remote.java 2007-03-19 12:05:46 UTC (rev 2638)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws1581;
+
+
+public interface EJB3Remote
+{
+
+ public String runTest(final String message);
+
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EJB3Remote.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EndpointBean.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EndpointBean.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EndpointBean.java 2007-03-19 12:05:46 UTC (rev 2638)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws1581;
+
+import javax.jws.WebService;
+
+import org.jboss.logging.Logger;
+
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jbws1581.EndpointInterface", serviceName = "TestService")
+public class EndpointBean
+{
+ private static final Logger log = Logger.getLogger(EndpointBean.class);
+
+ public String hello(final String message)
+ {
+ log.info("hello: " + message);
+ return message;
+ }
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EndpointBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EndpointInterface.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EndpointInterface.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EndpointInterface.java 2007-03-19 12:05:46 UTC (rev 2638)
@@ -0,0 +1,25 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Thu Nov 02 21:17:37 CET 2006
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+package org.jboss.test.ws.jaxws.jbws1581;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+
+/**
+ * The SEI that is packaged with the war endpoint may potentially
+ * contain different annotations that the one packaged with the EJB client
+ */
+public interface EndpointInterface
+{
+ String hello(String msg);
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/EndpointInterface.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/JBWS1581TestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/JBWS1581TestCase.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/JBWS1581TestCase.java 2007-03-19 12:05:46 UTC (rev 2638)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws1581;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+
+/**
+ * EJB vehicle using loader repository not sufficiently isolated
+ *
+ * http://jira.jboss.org/jira/browse/JBWS-1581
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 19-Mar-2007
+ */
+public class JBWS1581TestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(JBWS1581TestCase.class, "jaxws-jbws1581.war, jaxws-jbws1581.jar");
+ }
+
+ public void testCall() throws Exception
+ {
+ EJB3Remote remote = (EJB3Remote)getInitialContext().lookup("/ejb3/EJB3Bean");
+ String retStr = remote.runTest("Hello World!");
+ assertEquals("Hello World!", retStr);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1581/JBWS1581TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/resources/jaxws/jbws1581/META-INF/wsdl/TestService.wsdl
===================================================================
--- trunk/jbossws-tests/src/resources/jaxws/jbws1581/META-INF/wsdl/TestService.wsdl (rev 0)
+++ trunk/jbossws-tests/src/resources/jaxws/jbws1581/META-INF/wsdl/TestService.wsdl 2007-03-19 12:05:46 UTC (rev 2638)
@@ -0,0 +1,33 @@
+<definitions name='TestService' targetNamespace='http://jbws1581.jaxws.ws.test.jboss.org/' xmlns='http://schemas.xmlsoap.org/wsdl/'
+ xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://jbws1581.jaxws.ws.test.jboss.org/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types></types>
+ <message name='EndpointInterface_hello'>
+ <part name='arg0' type='xsd:string'/>
+ </message>
+ <message name='EndpointInterface_helloResponse'>
+ <part name='return' type='xsd:string'/>
+ </message>
+ <portType name='EndpointInterface'>
+ <operation name='hello' parameterOrder='arg0'>
+ <input message='tns:EndpointInterface_hello'/>
+ <output message='tns:EndpointInterface_helloResponse'/>
+ </operation>
+ </portType>
+ <binding name='EndpointInterfaceBinding' type='tns:EndpointInterface'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='hello'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://jbws1581.jaxws.ws.test.jboss.org/' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://jbws1581.jaxws.ws.test.jboss.org/' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='TestService'>
+ <port binding='tns:EndpointInterfaceBinding' name='EndpointBeanPort'>
+ <soap:address location='http://@jbosstest.host.name@:8080/jaxws-jbws1581'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: trunk/jbossws-tests/src/resources/jaxws/jbws1581/META-INF/wsdl/TestService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/resources/jaxws/jbws1581/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxws/jbws1581/WEB-INF/web.xml (rev 0)
+++ trunk/jbossws-tests/src/resources/jaxws/jbws1581/WEB-INF/web.xml 2007-03-19 12:05:46 UTC (rev 2638)
@@ -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>EndpointBean</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws1581.EndpointBean</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>EndpointBean</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Property changes on: trunk/jbossws-tests/src/resources/jaxws/jbws1581/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 9 months
JBossWS SVN: r2637 - trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-18 04:37:19 -0400 (Sun, 18 Mar 2007)
New Revision: 2637
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java
Log:
Prevent endless loop on async exception
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2007-03-18 00:27:03 UTC (rev 2636)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2007-03-18 08:37:19 UTC (rev 2637)
@@ -334,15 +334,17 @@
Map<String, Object> resContext = response.getContext();
Object result = invokeInternal(payload, resContext);
response.set(result);
-
- // Call the handler if available
- if (handler != null)
- handler.handleResponse(response);
}
catch (Exception ex)
{
handleAsynInvokeException(ex);
}
+ finally
+ {
+ // Call the handler if available
+ if (handler != null)
+ handler.handleResponse(response);
+ }
}
// 4.18 Conformance (Failed Dispatch.invokeAsync): When an operation is invoked using an invokeAsync
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java 2007-03-18 00:27:03 UTC (rev 2636)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java 2007-03-18 08:37:19 UTC (rev 2637)
@@ -58,6 +58,9 @@
if (delegate == null)
throw new IllegalStateException("Future not available");
+ if (exception != null)
+ throw exception;
+
return delegate;
}
@@ -87,7 +90,7 @@
{
getFuture().get();
}
-
+
if (exception != null)
throw new ExecutionException(exception);
17 years, 9 months
JBossWS SVN: r2636 - in trunk: jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-17 20:27:03 -0400 (Sat, 17 Mar 2007)
New Revision: 2636
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/ServletTest.java
trunk/jbossws-tests/src/resources/jaxrpc/jbws1093/WEB-INF/web.xml
Log:
Fix <port-component-ref> handling for ejb/servlet
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java 2007-03-17 18:07:34 UTC (rev 2635)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java 2007-03-18 00:27:03 UTC (rev 2636)
@@ -72,9 +72,10 @@
setValue((UnifiedPortComponentRefMetaData)ref, navigator, namespaceURI, localName, value);
else if (ref instanceof UnifiedServiceRefMetaData)
setValue((UnifiedServiceRefMetaData)ref, navigator, namespaceURI, localName, value);
+ else if (ref instanceof UnifiedCallPropertyMetaData)
+ setValue((UnifiedCallPropertyMetaData)ref, navigator, namespaceURI, localName, value);
else if (ref instanceof UnifiedStubPropertyMetaData)
setValue((UnifiedStubPropertyMetaData)ref, navigator, namespaceURI, localName, value);
-
}
private void setValue(UnifiedServiceRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2007-03-17 18:07:34 UTC (rev 2635)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2007-03-18 00:27:03 UTC (rev 2636)
@@ -23,24 +23,18 @@
// $Id$
-import java.lang.reflect.AnnotatedElement;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
import java.util.List;
-import java.util.Map;
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.integration.ServiceRefMetaData;
import org.jboss.ws.integration.UnifiedVirtualFile;
-import org.jboss.xb.QNameBuilder;
import org.w3c.dom.Element;
/**
@@ -70,8 +64,8 @@
private String mappingFile;
// The optional <service-qname> element
private QName serviceQName;
- // The LinkedHashMap<String, PortComponentRefMetaData> for <port-component-ref> elements
- private Map<String, UnifiedPortComponentRefMetaData> portComponentRefs = new LinkedHashMap<String, UnifiedPortComponentRefMetaData>();
+ // The list <port-component-ref> elements
+ private List<UnifiedPortComponentRefMetaData> portComponentRefs = new ArrayList<UnifiedPortComponentRefMetaData>();
// The optional <handler> elements. JAX-RPC handlers declared in the standard J2EE1.4 descriptor
private List<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>();
// The optional <handler-chains> elements. JAX-WS handlers declared in the standard JavaEE5 descriptor
@@ -129,7 +123,7 @@
continue;
}
- UnifiedPortComponentRefMetaData targetPCRef = portComponentRefs.get(seiName);
+ UnifiedPortComponentRefMetaData targetPCRef = getPortComponentRef(seiName);
if (targetPCRef == null)
{
log.warn("Cannot find port component ref with SEI name: " + seiName);
@@ -190,18 +184,24 @@
public Collection<UnifiedPortComponentRefMetaData> getPortComponentRefs()
{
- return portComponentRefs.values();
+ return portComponentRefs;
}
public UnifiedPortComponentRefMetaData getPortComponentRef(String seiName)
{
- UnifiedPortComponentRefMetaData ref = portComponentRefs.get(seiName);
- return ref;
+ if (seiName == null)
+ throw new IllegalArgumentException("SEI name cannot be null");
+ for (UnifiedPortComponentRefMetaData ref : portComponentRefs)
+ {
+ if (seiName.equals(ref.getServiceEndpointInterface()))
+ return ref;
+ }
+ return null;
}
public void addPortComponentRef(UnifiedPortComponentRefMetaData pcRef)
{
- portComponentRefs.put(pcRef.getServiceEndpointInterface(), pcRef);
+ portComponentRefs.add(pcRef);
}
public List<UnifiedHandlerMetaData> getHandlers()
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2007-03-17 18:07:34 UTC (rev 2635)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2007-03-18 00:27:03 UTC (rev 2636)
@@ -85,8 +85,7 @@
public void testAccessServlet() throws Exception
{
- String host = System.getProperty("jbosstest.host.name");
- URL servletURL = new URL("http://" + host + ":8080" + "/jaxrpc-jbws1093/ServletTest");
+ URL servletURL = new URL("http://" + getServerHost() + ":8080" + "/jaxrpc-jbws1093/ServletTest");
InputStream is = servletURL.openStream();
InputStreamReader isr = new InputStreamReader(is);
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/ServletTest.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/ServletTest.java 2007-03-17 18:07:34 UTC (rev 2635)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/ServletTest.java 2007-03-18 00:27:03 UTC (rev 2636)
@@ -38,9 +38,6 @@
*/
public class ServletTest extends HttpServlet
{
-
- private static final long serialVersionUID = 8465532467878198647L;
-
public static final String MESSAGE = "Success!!";
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
Modified: trunk/jbossws-tests/src/resources/jaxrpc/jbws1093/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/jbws1093/WEB-INF/web.xml 2007-03-17 18:07:34 UTC (rev 2635)
+++ trunk/jbossws-tests/src/resources/jaxrpc/jbws1093/WEB-INF/web.xml 2007-03-18 00:27:03 UTC (rev 2636)
@@ -6,24 +6,24 @@
version="2.4">
<servlet>
+ <servlet-name>TestEndpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxrpc.jbws1093.TestEndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet>
<servlet-name>ServletTest</servlet-name>
<servlet-class>org.jboss.test.ws.jaxrpc.jbws1093.ServletTest</servlet-class>
</servlet>
- <servlet>
+ <servlet-mapping>
<servlet-name>TestEndpoint</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxrpc.jbws1093.TestEndpointImpl</servlet-class>
- </servlet>
+ <url-pattern>/TestEndpoint</url-pattern>
+ </servlet-mapping>
<servlet-mapping>
<servlet-name>ServletTest</servlet-name>
<url-pattern>/ServletTest</url-pattern>
</servlet-mapping>
- <servlet-mapping>
- <servlet-name>TestEndpoint</servlet-name>
- <url-pattern>/TestEndpoint</url-pattern>
- </servlet-mapping>
-
</web-app>
17 years, 9 months
JBossWS SVN: r2635 - in trunk: jbossws-core and 17 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-17 14:07:34 -0400 (Sat, 17 Mar 2007)
New Revision: 2635
Added:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java
Removed:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java
Modified:
trunk/build/version.properties
trunk/jbossws-core/.classpath
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBinding.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EndpointInfo.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/common/EventingEndpointBase.java
trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/jaxws/AbstractSubscriptionManagerEndpoint.java
trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
trunk/jbossws-core/src/java/org/jboss/ws/extensions/xop/XOPContext.java
trunk/jbossws-tests/build.xml
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
Log:
Fix logic/soap message context
Modified: trunk/build/version.properties
===================================================================
--- trunk/build/version.properties 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/build/version.properties 2007-03-17 18:07:34 UTC (rev 2635)
@@ -18,7 +18,7 @@
ibm-wsdl4j=1.5.2jboss
javassist=3.5.0.CR1
jboss-jbossxb=2.0.0.CR1
-jboss-microcontainer=2.0.0.Beta3
+jboss-microcontainer=2.0.0.Beta3.1
jboss-remoting=2.2.0.Alpha7
sun-jaxb=2.0.3
Modified: trunk/jbossws-core/.classpath
===================================================================
--- trunk/jbossws-core/.classpath 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/.classpath 2007-03-17 18:07:34 UTC (rev 2635)
@@ -13,7 +13,7 @@
<classpathentry kind="lib" path="/build/thirdparty/jboss-j2ee.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jboss-logging-log4j.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jboss-logging-spi.jar"/>
- <classpathentry kind="lib" path="/build/thirdparty/jboss-remoting.jar"/>
+ <classpathentry kind="lib" path="/build/thirdparty/jboss-remoting.jar" sourcepath="/home/tdiesler/cvs/JBossRemoting/tags/remoting_2_2_0_Alpha7/src/main"/>
<classpathentry kind="lib" path="/build/thirdparty/jboss-xml-binding.jar" sourcepath="/build/thirdparty/jboss-xml-binding-sources.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/wsdl4j.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/xmlsec.jar"/>
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBinding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBinding.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBinding.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -28,7 +28,6 @@
import javax.xml.namespace.QName;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.server.ServerHandlerDelegate;
import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.metadata.umdm.OperationMetaData;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -26,6 +26,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
@@ -47,7 +48,6 @@
import org.jboss.ws.core.DirectionHolder.Direction;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.core.jaxrpc.handler.HandlerChainBaseImpl;
import org.jboss.ws.core.soap.EndpointInfo;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.SOAPBodyImpl;
@@ -200,8 +200,9 @@
ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, new QName(Constants.NS_JBOSSWS_URI, "AnonymousService"));
wsMetaData.addService(serviceMetaData);
- epMetaData = new ClientEndpointMetaData(serviceMetaData, new QName(Constants.NS_JBOSSWS_URI, "AnonymousPort"),
- new QName(Constants.NS_JBOSSWS_URI, "Anonymous"), Type.JAXRPC);
+ QName anonQName = new QName(Constants.NS_JBOSSWS_URI, "Anonymous");
+ QName anonPort = new QName(Constants.NS_JBOSSWS_URI, "AnonymousPort");
+ epMetaData = new ClientEndpointMetaData(serviceMetaData, anonPort, anonQName, Type.JAXRPC);
epMetaData.setStyle(Style.RPC);
serviceMetaData.addEndpoint(epMetaData);
@@ -231,7 +232,7 @@
* 6) unwrap the result using the BindingProvider
* 7) return the result
*/
- protected Object invoke(QName opName, Object[] inputParams, Map<String, Object> resContext, boolean forceOneway) throws Exception
+ protected Object invoke(QName opName, Object[] inputParams, boolean forceOneway) throws Exception
{
if (opName.equals(operationName) == false)
setOperationName(opName);
@@ -240,19 +241,19 @@
boolean oneway = forceOneway || opMetaData.isOneWay();
// Associate a message context with the current thread
- CommonMessageContext reqContext = MessageContextAssociation.peekMessageContext();
- reqContext.setOperationMetaData(opMetaData);
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ msgContext.setOperationMetaData(opMetaData);
- // copy properties to the message context
- for (String key : getRequestContext().keySet())
- {
- Object value = getRequestContext().get(key);
- reqContext.setProperty(key, value);
- }
+ // Copy properties to the message context
+ msgContext.putAll(getRequestContext());
// The direction of the message
DirectionHolder direction = new DirectionHolder(Direction.OutBound);
-
+
+ // Get the order of pre/post handlerchains
+ HandlerType[] handlerType = new HandlerType[] { HandlerType.PRE, HandlerType.ENDPOINT, HandlerType.POST };
+ HandlerType[] faultType = new HandlerType[] { HandlerType.PRE, HandlerType.ENDPOINT, HandlerType.POST };
+
QName portName = epMetaData.getPortName();
try
{
@@ -264,25 +265,26 @@
epInv = new EndpointInvocation(opMetaData);
epInv.initInputParams(inputParams);
+ // Set the required outbound properties
+ setOutboundContextProperties();
+
// Bind the request message
SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData, epInv, unboundHeaders);
// Add possible attachment parts
addAttachmentParts(reqMessage);
- setOutboundContextProperties();
-
// Call the request handlers
- boolean handlerPass = callRequestHandlerChain(portName, HandlerType.PRE);
- handlerPass = handlerPass && callRequestHandlerChain(portName, HandlerType.ENDPOINT);
- handlerPass = handlerPass && callRequestHandlerChain(portName, HandlerType.POST);
+ boolean handlerPass = callRequestHandlerChain(portName, handlerType[0]);
+ handlerPass = handlerPass && callRequestHandlerChain(portName, handlerType[1]);
+ handlerPass = handlerPass && callRequestHandlerChain(portName, handlerType[2]);
if (handlerPass)
{
String targetAddress = getTargetEndpointAddress();
// Fall back to wsa:To
- AddressingProperties addrProps = (AddressingProperties)reqContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ AddressingProperties addrProps = (AddressingProperties)msgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
if (targetAddress == null && addrProps != null && addrProps.getTo() != null)
{
AddressingConstantsImpl ADDR = new AddressingConstantsImpl();
@@ -292,12 +294,14 @@
try
{
URL wsaToURL = new URL(wsaTo);
- if(log.isDebugEnabled()) log.debug("Sending request to addressing destination: " + wsaToURL);
+ if (log.isDebugEnabled())
+ log.debug("Sending request to addressing destination: " + wsaToURL);
targetAddress = wsaToURL.toExternalForm();
}
catch (MalformedURLException ex)
{
- if(log.isDebugEnabled()) log.debug("Not a valid URL: " + wsaTo);
+ if (log.isDebugEnabled())
+ log.debug("Not a valid URL: " + wsaTo);
}
}
}
@@ -306,7 +310,8 @@
if (targetAddress == null)
throw new WSException("Target endpoint address not set");
- EndpointInfo epInfo = new EndpointInfo(epMetaData, targetAddress, getRequestContext());
+ Map<String, Object> callProps = new HashMap<String, Object>(getRequestContext());
+ EndpointInfo epInfo = new EndpointInfo(epMetaData, targetAddress, callProps);
SOAPMessage resMessage;
if (oneway)
@@ -318,11 +323,14 @@
resMessage = new SOAPConnectionImpl().call(reqMessage, epInfo);
}
- // at pivot the message context might be replaced
- reqContext = processPivotInternal(reqContext, direction);
+ // At pivot the message context might be replaced
+ msgContext = processPivotInternal(msgContext, direction);
+
+ // Copy the remoting meta data
+ msgContext.putAll(callProps);
// Associate response message with message context
- reqContext.setSOAPMessage(resMessage);
+ msgContext.setSOAPMessage(resMessage);
}
setInboundContextProperties();
@@ -334,26 +342,29 @@
// Verify
if (binding instanceof CommonSOAPBinding)
((CommonSOAPBinding)binding).checkMustUnderstand(opMetaData);
-
- // Call the response handlers
- handlerPass = callResponseHandlerChain(portName, HandlerType.POST);
+ // Call the response handler chain, removing the fault type entry will not call handleFault for that chain
+ handlerPass = callResponseHandlerChain(portName, handlerType[2]);
+ faultType[2] = null;
+
// unbind the return values
if (handlerPass)
{
// unbind the return values
- SOAPMessage resMessage = reqContext.getSOAPMessage();
+ SOAPMessage resMessage = msgContext.getSOAPMessage();
binding.unbindResponseMessage(opMetaData, resMessage, epInv, unboundHeaders);
}
- handlerPass = handlerPass && callResponseHandlerChain(portName, HandlerType.ENDPOINT);
- handlerPass = handlerPass && callResponseHandlerChain(portName, HandlerType.PRE);
+ handlerPass = handlerPass && callResponseHandlerChain(portName, handlerType[1]);
+ faultType[1] = null;
+ handlerPass = handlerPass && callResponseHandlerChain(portName, handlerType[0]);
+ faultType[0] = null;
// Check if protocol handlers modified the payload
if (((SOAPBodyImpl)reqMessage.getSOAPBody()).isModifiedFromSource())
{
log.debug("Handler modified body payload, unbind message again");
- SOAPMessage resMessage = reqContext.getSOAPMessage();
+ SOAPMessage resMessage = msgContext.getSOAPMessage();
binding.unbindResponseMessage(opMetaData, resMessage, epInv, unboundHeaders);
}
@@ -365,20 +376,21 @@
catch (Exception ex)
{
// Reverse the message direction
- processPivotInternal(reqContext, direction);
-
- callFaultHandlerChain(portName, HandlerType.POST, ex);
- callFaultHandlerChain(portName, HandlerType.ENDPOINT, ex);
- callFaultHandlerChain(portName, HandlerType.PRE, ex);
+ processPivotInternal(msgContext, direction);
+
+ if (faultType[2] != null)
+ callFaultHandlerChain(portName, faultType[2], ex);
+ if (faultType[1] != null)
+ callFaultHandlerChain(portName, faultType[1], ex);
+ if (faultType[0] != null)
+ callFaultHandlerChain(portName, faultType[0], ex);
throw ex;
}
finally
{
- resContext.putAll(reqContext.getProperties());
-
- closeHandlerChain(portName, HandlerType.POST);
- closeHandlerChain(portName, HandlerType.ENDPOINT);
- closeHandlerChain(portName, HandlerType.PRE);
+ closeHandlerChain(portName, handlerType[2]);
+ closeHandlerChain(portName, handlerType[1]);
+ closeHandlerChain(portName, handlerType[0]);
}
}
@@ -396,7 +408,8 @@
{
for (AttachmentPart part : attachmentParts)
{
- if(log.isDebugEnabled()) log.debug("Adding attachment part: " + part.getContentId());
+ if (log.isDebugEnabled())
+ log.debug("Adding attachment part: " + part.getContentId());
reqMessage.addAttachmentPart(part);
}
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -26,7 +26,6 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@@ -147,59 +146,6 @@
return getSerializationContext().getNamespaceRegistry();
}
- /** Get the message context properties */
- public Map<String, Object> getProperties()
- {
- Map<String, Object> props = new HashMap<String, Object>();
- for (String key : keySet())
- {
- Object value = get(key);
- props.put(key, value);
- }
- return props;
- }
-
- /**
- * Returns true if the MessageContext contains a property with the specified name.
- */
- public boolean containsProperty(String name)
- {
- return containsKey(name);
- }
-
- /**
- * Gets the value of a specific property from the MessageContext
- */
- public Object getProperty(String name)
- {
- return get(name);
- }
-
- /**
- * Returns an Iterator view of the names of the properties in this MessageContext
- */
- public Iterator getPropertyNames()
- {
- return keySet().iterator();
- }
-
- /**
- * Removes a property (name-value pair) from the MessageContext
- */
- public void removeProperty(String name)
- {
- remove(name);
- }
-
- /**
- * Sets the name and value of a property associated with the MessageContext.
- * If the MessageContext contains a value of the same property, the old value is replaced.
- */
- public void setProperty(String name, Object value)
- {
- put(name, value);
- }
-
// Map interface
public int size()
@@ -237,10 +183,9 @@
Object value = null;
ScopedProperty scopedProp = scopedProps.get(key);
+ if (log.isTraceEnabled())
+ log.trace("get("+ key + "): " + scopedProp);
- if (!("" + key).startsWith("javax.xml") && !("" + key).startsWith("org.jboss"))
- log.info("get("+ key + "): " + scopedProp);
-
if (isValidInScope(scopedProp))
value = scopedProp.getValue();
@@ -254,8 +199,8 @@
throw new IllegalArgumentException("Cannot set value for HANDLER scoped property: " + key);
ScopedProperty newProp = new ScopedProperty(key, value, currentScope);
- if (!("" + key).startsWith("javax.xml") && !("" + key).startsWith("org.jboss"))
- log.info("put: " + newProp);
+ if (log.isTraceEnabled())
+ log.trace("put: " + newProp);
scopedProps.put(key, newProp);
return prevProp != null ? prevProp.getValue() : null;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -23,18 +23,14 @@
// $Id$
-import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
-import javax.xml.rpc.soap.SOAPFaultException;
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.Name;
@@ -47,6 +43,7 @@
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPHeaderElement;
import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
import org.apache.xerces.xs.XSElementDeclaration;
import org.apache.xerces.xs.XSTypeDefinition;
@@ -56,7 +53,7 @@
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.server.ServerHandlerDelegate;
+import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.NameImpl;
@@ -75,7 +72,6 @@
import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.core.utils.MimeUtils;
import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.metadata.umdm.TypesMetaData;
@@ -138,7 +134,8 @@
/** On the client side, generate the payload from IN parameters. */
public Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
{
- if(log.isDebugEnabled()) log.debug("bindRequestMessage: " + opMetaData.getQName());
+ if (log.isDebugEnabled())
+ log.debug("bindRequestMessage: " + opMetaData.getQName());
try
{
@@ -149,8 +146,7 @@
// Disable MTOM for rpc/encoded
if (opMetaData.isRPCEncoded())
XOPContext.setMTOMEnabled(false);
- else
- XOPContext.setMTOMEnabled( isMTOMEnabled() );
+ else XOPContext.setMTOMEnabled(isMTOMEnabled());
// Associate current message with message context
SOAPMessageImpl reqMessage = (SOAPMessageImpl)createMessage(opMetaData);
@@ -170,7 +166,8 @@
QName opQName = opMetaData.getQName();
Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
- if(log.isDebugEnabled()) log.debug("Create RPC body element: " + opName);
+ if (log.isDebugEnabled())
+ log.debug("Create RPC body element: " + opName);
soapBodyElement = new SOAPBodyElementRpc(opName);
soapBodyElement = (SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
}
@@ -186,6 +183,14 @@
CIDGenerator cidGenerator = reqMessage.getCidGenerator();
AttachmentPart part = createAttachmentPart(paramMetaData, value, cidGenerator);
reqMessage.addAttachmentPart(part);
+
+ // Add the attachment to the standard property
+ if (value instanceof DataHandler && msgContext instanceof MessageContextJAXWS)
+ {
+ DataHandler dataHandler = (DataHandler)value;
+ Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+ attachments.put(dataHandler.getContentType(), dataHandler);
+ }
}
else
{
@@ -209,7 +214,8 @@
xmlName = namespaceRegistry.registerQName(xmlName);
Name soapName = new NameImpl(xmlName.getLocalPart(), xmlName.getPrefix(), xmlName.getNamespaceURI());
- if(log.isDebugEnabled()) log.debug("Add unboundHeader element: " + soapName);
+ if (log.isDebugEnabled())
+ log.debug("Add unboundHeader element: " + soapName);
SOAPContentElement contentElement = new SOAPHeaderElementImpl(soapName);
contentElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
soapHeader.addChildElement(contentElement);
@@ -236,7 +242,8 @@
/** On the server side, extract the IN parameters from the payload and populate an Invocation object */
public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object payload) throws BindingException
{
- if(log.isDebugEnabled()) log.debug("unbindRequestMessage: " + opMetaData.getQName());
+ if (log.isDebugEnabled())
+ log.debug("unbindRequestMessage: " + opMetaData.getQName());
try
{
@@ -258,7 +265,7 @@
// Disable MTOM for rpc/encoded
if (opMetaData.isRPCEncoded())
- msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+ msgContext.put(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
// Get the namespace registry
NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
@@ -287,8 +294,16 @@
{
if (paramMetaData.isSwA())
{
- Object value = getAttachmentFromMessage(paramMetaData, reqMessage);
- epInv.setRequestParamValue(xmlName, value);
+ AttachmentPart part = getAttachmentFromMessage(paramMetaData, reqMessage);
+ epInv.setRequestParamValue(xmlName, part);
+
+ // Add the attachment to the standard property
+ if (part.getDataHandler() != null && msgContext instanceof MessageContextJAXWS)
+ {
+ DataHandler dataHandler = part.getDataHandler();
+ Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
+ attachments.put(part.getContentId(), dataHandler);
+ }
}
else
{
@@ -323,7 +338,8 @@
/** On the server side, generate the payload from OUT parameters. */
public Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException
{
- if(log.isDebugEnabled()) log.debug("bindResponseMessage: " + opMetaData.getQName());
+ if (log.isDebugEnabled())
+ log.debug("bindResponseMessage: " + opMetaData.getQName());
try
{
@@ -334,8 +350,7 @@
// Disable MTOM for rpc/encoded
if (opMetaData.isRPCEncoded())
XOPContext.setMTOMEnabled(false);
- else
- XOPContext.setMTOMEnabled( isMTOMEnabled() );
+ else XOPContext.setMTOMEnabled(isMTOMEnabled());
// Associate current message with message context
SOAPMessageImpl resMessage = (SOAPMessageImpl)createMessage(opMetaData);
@@ -371,15 +386,25 @@
if (retMetaData != null)
{
Object value = epInv.getReturnValue();
+
// TODO calls to ParameterWrapping should be elsewhere
if (opMetaData.isDocumentWrapped())
value = ParameterWrapping.wrapResponseParameters(retMetaData, value, epInv.getOutParameters());
+
if (retMetaData.isSwA())
{
CIDGenerator cidGenerator = resMessage.getCidGenerator();
AttachmentPart part = createAttachmentPart(retMetaData, value, cidGenerator);
resMessage.addAttachmentPart(part);
epInv.setReturnValue(part);
+
+ // Add the attachment to the standard property
+ if (part.getDataHandler() != null && msgContext instanceof MessageContextJAXWS)
+ {
+ DataHandler dataHandler = part.getDataHandler();
+ Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+ attachments.put(part.getContentId(), dataHandler);
+ }
}
else
{
@@ -399,6 +424,14 @@
CIDGenerator cidGenerator = resMessage.getCidGenerator();
AttachmentPart part = createAttachmentPart(paramMetaData, value, cidGenerator);
resMessage.addAttachmentPart(part);
+
+ // Add the attachment to the standard property
+ if (value instanceof DataHandler && msgContext instanceof MessageContextJAXWS)
+ {
+ DataHandler dataHandler = (DataHandler)value;
+ Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+ attachments.put(dataHandler.getContentType(), dataHandler);
+ }
}
else
{
@@ -424,9 +457,10 @@
/** On the client side, extract the OUT parameters from the payload and return them to the client. */
public void unbindResponseMessage(OperationMetaData opMetaData, Object payload, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
- throws BindingException
+ throws BindingException
{
- if(log.isDebugEnabled()) log.debug("unbindResponseMessage: " + opMetaData.getQName());
+ if (log.isDebugEnabled())
+ log.debug("unbindResponseMessage: " + opMetaData.getQName());
try
{
@@ -455,7 +489,7 @@
// Disable MTOM for rpc/encoded
if (opMetaData.isRPCEncoded())
- msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+ msgContext.put(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
SOAPHeader soapHeader = soapEnvelope.getHeader();
SOAPBody soapBody = soapEnvelope.getBody();
@@ -509,8 +543,16 @@
{
if (retMetaData.isSwA())
{
- Object value = getAttachmentFromMessage(retMetaData, resMessage);
- epInv.setReturnValue(value);
+ AttachmentPart part = getAttachmentFromMessage(retMetaData, resMessage);
+ epInv.setReturnValue(part);
+
+ // Add the attachment to the standard property
+ if (part.getDataHandler() != null && msgContext instanceof MessageContextJAXWS)
+ {
+ DataHandler dataHandler = part.getDataHandler();
+ Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
+ attachments.put(part.getContentId(), dataHandler);
+ }
}
else
{
@@ -524,8 +566,16 @@
QName xmlName = paramMetaData.getXmlName();
if (paramMetaData.isSwA())
{
- Object value = getAttachmentFromMessage(paramMetaData, resMessage);
- epInv.setResponseParamValue(xmlName, value);
+ AttachmentPart part = getAttachmentFromMessage(paramMetaData, resMessage);
+ epInv.setResponseParamValue(xmlName, part);
+
+ // Add the attachment to the standard property
+ if (part.getDataHandler() != null && msgContext instanceof MessageContextJAXWS)
+ {
+ DataHandler dataHandler = part.getDataHandler();
+ Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
+ attachments.put(part.getContentId(), dataHandler);
+ }
}
else
{
@@ -620,7 +670,7 @@
return part;
}
- private Object getAttachmentFromMessage(ParameterMetaData paramMetaData, SOAPMessage message) throws SOAPException, BindingException
+ private AttachmentPart getAttachmentFromMessage(ParameterMetaData paramMetaData, SOAPMessage message) throws SOAPException, BindingException
{
QName xmlName = paramMetaData.getXmlName();
@@ -694,7 +744,7 @@
SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
soapMessage.setXOPMessage(true);
}
- else if(paramMetaData.isSwaRef())
+ else if (paramMetaData.isSwaRef())
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
@@ -735,7 +785,7 @@
if (SOAP_ARRAY_NAME.equals(elName))
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+ msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
try
{
QName compXMLName = paramMetaData.getXmlName();
@@ -751,7 +801,7 @@
}
finally
{
- msgContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
}
}
}
@@ -798,7 +848,7 @@
SOAPMessageImpl soapMessage = (SOAPMessageImpl)MessageContextAssociation.peekMessageContext().getSOAPMessage();
soapMessage.setXOPMessage(true);
}
- else if(paramMetaData.isSwaRef())
+ else if (paramMetaData.isSwaRef())
{
SOAPMessageImpl soapMessage = (SOAPMessageImpl)MessageContextAssociation.peekMessageContext().getSOAPMessage();
soapMessage.setSWARefMessage(true);
@@ -810,13 +860,13 @@
abstract protected void throwFaultException(SOAPFaultImpl fault) throws Exception;
abstract protected void verifyUnderstoodHeader(SOAPHeaderElement element) throws Exception;
-
+
public void checkMustUnderstand(OperationMetaData opMetaData) throws Exception
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
if (msgContext == null)
throw new WSException("MessageContext not available");
-
+
SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
if (soapEnvelope == null || soapEnvelope.getHeader() == null)
@@ -834,14 +884,14 @@
if (!isBoundHeader && soapHeaderElement.getMustUnderstand())
verifyUnderstoodHeader(soapHeaderElement);
- }
+ }
}
-
+
public void setHeaderSource(HeaderSource source)
{
headerSource = source;
}
-
+
private void handleException(Exception ex) throws BindingException
{
if (ex instanceof RuntimeException)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -29,6 +29,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -45,7 +46,7 @@
public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
{
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ MessageContextJAXRPC msgContext = (MessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
String soapAction = opMetaData.getSOAPAction();
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -504,7 +504,7 @@
Object retObj = null;
try
{
- retObj = super.invoke(opName, inputParams, properties, forceOneway);
+ retObj = super.invoke(opName, inputParams, forceOneway);
return retObj;
}
catch (SOAPFaultException ex)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -23,6 +23,10 @@
// $Id$
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
import javax.xml.rpc.handler.MessageContext;
import javax.xml.soap.SOAPMessage;
@@ -45,7 +49,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 06-May-2004
*/
-public class MessageContextJAXRPC extends CommonMessageContext implements MessageContext
+public abstract class MessageContextJAXRPC extends CommonMessageContext implements MessageContext
{
private static Logger log = Logger.getLogger(MessageContextJAXRPC.class);
@@ -98,4 +102,56 @@
return requestContext;
}
+ /** Get the message context properties */
+ public Map<String, Object> getProperties()
+ {
+ Map<String, Object> props = new HashMap<String, Object>();
+ for (String key : keySet())
+ {
+ Object value = get(key);
+ props.put(key, value);
+ }
+ return props;
+ }
+
+ /**
+ * Returns true if the MessageContext contains a property with the specified name.
+ */
+ public boolean containsProperty(String name)
+ {
+ return containsKey(name);
+ }
+
+ /**
+ * Gets the value of a specific property from the MessageContext
+ */
+ public Object getProperty(String name)
+ {
+ return get(name);
+ }
+
+ /**
+ * Returns an Iterator view of the names of the properties in this MessageContext
+ */
+ public Iterator getPropertyNames()
+ {
+ return keySet().iterator();
+ }
+
+ /**
+ * Removes a property (name-value pair) from the MessageContext
+ */
+ public void removeProperty(String name)
+ {
+ remove(name);
+ }
+
+ /**
+ * Sets the name and value of a property associated with the MessageContext.
+ * If the MessageContext contains a value of the same property, the old value is replaced.
+ */
+ public void setProperty(String name, Object value)
+ {
+ put(name, value);
+ }
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -73,10 +73,10 @@
// the soapAction attribute of soapbind:operation is either not present, or
// present with an empty string as its value.
- if (msgContext.getProperty(BindingProvider.SOAPACTION_USE_PROPERTY) != null)
+ if (msgContext.get(BindingProvider.SOAPACTION_USE_PROPERTY) != null)
log.info("Ignore BindingProvider.SOAPACTION_USE_PROPERTY because of BP-1.0 R2745, R2745");
- String soapActionProperty = (String)msgContext.getProperty(BindingProvider.SOAPACTION_URI_PROPERTY);
+ String soapActionProperty = (String)msgContext.get(BindingProvider.SOAPACTION_URI_PROPERTY);
if (soapActionProperty != null)
soapAction = soapActionProperty;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -23,6 +23,7 @@
// $Id$
+import java.net.HttpURLConnection;
import java.rmi.RemoteException;
import java.util.HashMap;
import java.util.HashSet;
@@ -31,6 +32,7 @@
import java.util.Observable;
import java.util.Set;
+import javax.activation.DataHandler;
import javax.xml.namespace.QName;
import javax.xml.ws.Binding;
import javax.xml.ws.BindingProvider;
@@ -46,6 +48,7 @@
import javax.xml.ws.soap.SOAPFaultException;
import org.jboss.logging.Logger;
+import org.jboss.remoting.transport.http.HTTPMetadataConstants;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.core.CommonBindingProvider;
import org.jboss.ws.core.CommonClient;
@@ -128,7 +131,7 @@
*/
public void update(Observable observable, Object object)
{
- if(log.isDebugEnabled()) log.debug("Configuration change event received. Reconfigure handler chain: " + object);
+ log.debug("Configuration change event received. Reconfigure handler chain: " + object);
// re-populate the binding handler chain
resetCreateBindingHandlerChain();
@@ -138,9 +141,9 @@
protected boolean callRequestHandlerChain(QName portName, HandlerType type)
{
BindingExt binding = (BindingExt)getBindingProvider().getBinding();
- HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type));
+ HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type));
executorMap.put(type, executor);
-
+
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
return executor.handleMessage(msgContext);
}
@@ -149,7 +152,7 @@
protected boolean callResponseHandlerChain(QName portName, HandlerType type)
{
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
- HandlerChainExecutor executor = executorMap.get(type);
+ HandlerChainExecutor executor = executorMap.get(type);
return (executor != null ? executor.handleMessage(msgContext) : true);
}
@@ -157,7 +160,7 @@
protected boolean callFaultHandlerChain(QName portName, HandlerType type, Exception ex)
{
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
- HandlerChainExecutor executor = executorMap.get(type);
+ HandlerChainExecutor executor = executorMap.get(type);
return (executor != null ? executor.handleFault(msgContext, ex) : true);
}
@@ -165,16 +168,32 @@
protected void closeHandlerChain(QName portName, HandlerType type)
{
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
- HandlerChainExecutor executor = executorMap.get(type);
- if (executor != null) executor.close(msgContext);
+ HandlerChainExecutor executor = executorMap.get(type);
+ if (executor != null)
+ executor.close(msgContext);
}
@Override
protected void setInboundContextProperties()
{
- // Mark the message context as outbound
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- msgContext.setProperty(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new Boolean(false));
+ // Get the HTTP_RESPONSE_CODE
+ MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
+ Integer resposeCode = (Integer)msgContext.get(HTTPMetadataConstants.RESPONSE_CODE);
+ if (resposeCode != null)
+ msgContext.put(MessageContextJAXWS.HTTP_RESPONSE_CODE, resposeCode);
+
+ // Map of attachments to a message for the inbound message, key is the MIME Content-ID, value is a DataHandler
+ msgContext.put(MessageContext.INBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
+
+ // Get the HTTP response headers
+ // [JBREM-728] Improve access to HTTP response headers
+ Map<String, List> headers = new HashMap<String, List>();
+ for (Map.Entry en : msgContext.entrySet())
+ {
+ if (en.getKey() instanceof String && en.getValue() instanceof List)
+ headers.put((String)en.getKey(), (List)en.getValue());
+ }
+ msgContext.put(MessageContext.HTTP_RESPONSE_HEADERS, headers);
}
@Override
@@ -182,14 +201,17 @@
{
// Mark the message context as outbound
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- msgContext.setProperty(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new Boolean(true));
+ msgContext.put(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);
+
+ // Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler
+ msgContext.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
}
// Invoked by the proxy invokation handler
public Object invoke(QName opName, Object[] args, Map<String, Object> resContext) throws RemoteException
{
// Associate a message context with the current thread
- SOAPMessageContextJAXWS msgContext = new SOAPMessageContextJAXWS();
+ CommonMessageContext msgContext = new SOAPMessageContextJAXWS();
MessageContextAssociation.pushMessageContext(msgContext);
// The contents of the request context are used to initialize the message context (see section 9.4.1)
@@ -200,7 +222,7 @@
try
{
- Object retObj = invoke(opName, args, resContext, false);
+ Object retObj = invoke(opName, args, false);
return retObj;
}
catch (Exception ex)
@@ -218,14 +240,23 @@
}
finally
{
+ // Copy the inbound msg properties to the binding's response context
+ msgContext = MessageContextAssociation.peekMessageContext();
+ for (String key : msgContext.keySet())
+ {
+ Object value = msgContext.get(key);
+ resContext.put(key, value);
+ }
+
// Reset the message context association
MessageContextAssociation.popMessageContext();
}
}
- protected CommonMessageContext processPivot(CommonMessageContext requestContext)
+ protected CommonMessageContext processPivot(CommonMessageContext reqMessageContext)
{
- return MessageContextJAXWS.processPivot(requestContext);
+ MessageContextJAXWS resMessageContext = MessageContextJAXWS.processPivot(reqMessageContext);
+ return resMessageContext;
}
/**
@@ -337,7 +368,7 @@
{
if (handlerResolver instanceof HandlerResolverImpl)
return ((HandlerResolverImpl)handlerResolver).getHeaders();
-
+
Set<QName> headers = new HashSet<QName>();
List<Handler> handlerChain = handlerResolver.getHandlerChain(new PortInfoImpl(epMetaData));
if (handlerChain != null)
@@ -346,7 +377,7 @@
if (handler instanceof SOAPHandler)
headers.addAll(((SOAPHandler)handler).getHeaders());
}
-
+
return headers;
}
}
\ No newline at end of file
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -95,7 +95,7 @@
public void close(MessageContext msgContext)
{
log.debug("close");
- CommonMessageContext context = (CommonMessageContext)msgContext;
+ MessageContextJAXWS context = (MessageContextJAXWS)msgContext;
for (int index = 1; index <= executedHandlers.size(); index++)
{
Handler currHandler = executedHandlers.get(executedHandlers.size() - index);
@@ -123,8 +123,6 @@
{
log.debug("Enter: handle" + (isOutbound ? "Out" : "In ") + "BoundMessage");
- msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
-
int index = getFirstHandler();
Handler currHandler = null;
try
@@ -163,7 +161,6 @@
if (doNext == false)
falseIndex = index;
- msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
log.debug("Exit: handle" + (isOutbound ? "Out" : "In ") + "BoundMessage with status: " + doNext);
}
}
@@ -203,8 +200,6 @@
}
}
- msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
-
int index = getFirstHandler();
Handler currHandler = null;
@@ -239,7 +234,6 @@
}
finally
{
- msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
log.debug("Exit: handle" + (isOutbound ? "Out" : "In ") + "BoundFault with status: " + doNext);
}
}
@@ -286,12 +280,13 @@
private boolean handleMessage(Handler currHandler, MessageContext msgContext)
{
CommonMessageContext context = (CommonMessageContext)msgContext;
- if (currHandler instanceof LogicalHandler && msgContext instanceof SOAPMessageContextJAXWS)
+ if (currHandler instanceof LogicalHandler)
{
if (epMetaData.getStyle() == Style.RPC)
throw new WebServiceException("Cannot use logical handler with RPC");
- msgContext = new LogicalMessageContextImpl((SOAPMessageContextJAXWS)msgContext);
+ if (msgContext instanceof SOAPMessageContextJAXWS)
+ msgContext = new LogicalMessageContextImpl((SOAPMessageContextJAXWS)msgContext);
}
if (executedHandlers.contains(currHandler) == false)
@@ -299,24 +294,27 @@
try
{
+ context.put(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
context.setCurrentScope(Scope.HANDLER);
return currHandler.handleMessage(msgContext);
}
finally
{
context.setCurrentScope(Scope.APPLICATION);
+ context.remove(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM);
}
}
private boolean handleFault(Handler currHandler, MessageContext msgContext)
{
CommonMessageContext context = (CommonMessageContext)msgContext;
- if (currHandler instanceof LogicalHandler && msgContext instanceof SOAPMessageContextJAXWS)
+ if (currHandler instanceof LogicalHandler)
{
if (epMetaData.getStyle() == Style.RPC)
throw new WebServiceException("Cannot use logical handler with RPC");
- msgContext = new LogicalMessageContextImpl((SOAPMessageContextJAXWS)msgContext);
+ if (msgContext instanceof SOAPMessageContextJAXWS)
+ msgContext = new LogicalMessageContextImpl((SOAPMessageContextJAXWS)msgContext);
}
if (executedHandlers.contains(currHandler) == false)
@@ -324,12 +322,14 @@
try
{
+ context.put(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
context.setCurrentScope(Scope.HANDLER);
return currHandler.handleFault(msgContext);
}
finally
{
context.setCurrentScope(Scope.APPLICATION);
+ context.remove(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM);
}
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -23,9 +23,14 @@
// $Id:LogicalMessageContextImpl.java 888 2006-09-02 00:37:13Z thomas.diesler(a)jboss.com $
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.LogicalMessage;
import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.MessageContext;
/**
* The LogicalMessageContext interface extends MessageContext to provide access to a the
@@ -34,15 +39,15 @@
* @author Thomas.Diesler(a)jboss.org
* @since 31-Aug-2006
*/
-public class LogicalMessageContextImpl extends MessageContextJAXWS implements LogicalMessageContext
+public class LogicalMessageContextImpl implements LogicalMessageContext
{
// The LogicalMessage in this message context
private LogicalMessage logicalMessage;
+ private MessageContext delegate;
public LogicalMessageContextImpl(SOAPMessageContextJAXWS soapContext)
{
- super(soapContext);
-
+ this.delegate = soapContext;
SOAPMessage soapMessage = soapContext.getMessage();
logicalMessage = new LogicalMessageImpl(soapMessage);
}
@@ -55,4 +60,86 @@
{
return logicalMessage;
}
+
+ // MessageContext delegation
+
+ public void clear()
+ {
+ delegate.clear();
+ }
+
+ public boolean containsKey(Object key)
+ {
+ return delegate.containsKey(key);
+ }
+
+ public boolean containsValue(Object value)
+ {
+ return delegate.containsValue(value);
+ }
+
+ public Set<Entry<String, Object>> entrySet()
+ {
+ return delegate.entrySet();
+ }
+
+ public boolean equals(Object o)
+ {
+ return delegate.equals(o);
+ }
+
+ public Object get(Object key)
+ {
+ return delegate.get(key);
+ }
+
+ public Scope getScope(String name)
+ {
+ return delegate.getScope(name);
+ }
+
+ public int hashCode()
+ {
+ return delegate.hashCode();
+ }
+
+ public boolean isEmpty()
+ {
+ return delegate.isEmpty();
+ }
+
+ public Set<String> keySet()
+ {
+ return delegate.keySet();
+ }
+
+ public Object put(String key, Object value)
+ {
+ return delegate.put(key, value);
+ }
+
+ public void putAll(Map<? extends String, ? extends Object> t)
+ {
+ delegate.putAll(t);
+ }
+
+ public Object remove(Object key)
+ {
+ return delegate.remove(key);
+ }
+
+ public void setScope(String name, Scope scope)
+ {
+ delegate.setScope(name, scope);
+ }
+
+ public int size()
+ {
+ return delegate.size();
+ }
+
+ public Collection<Object> values()
+ {
+ return delegate.values();
+ }
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -23,17 +23,13 @@
// $Id: MessageContextImpl.java 275 2006-05-04 21:36:29Z jason.greene(a)jboss.com $
-import javax.xml.ws.addressing.JAXWSAConstants;
-import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import javax.xml.ws.handler.MessageContext;
import org.jboss.logging.Logger;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.StubExt;
import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
import org.jboss.ws.core.jaxws.SerializationContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.xb.binding.NamespaceRegistry;
@@ -47,7 +43,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Jul-2006
*/
-public class MessageContextJAXWS extends CommonMessageContext implements MessageContext
+public abstract class MessageContextJAXWS extends CommonMessageContext implements MessageContext
{
private static Logger log = Logger.getLogger(MessageContextJAXWS.class);
@@ -98,11 +94,11 @@
return prop.getScope();
}
- public static CommonMessageContext processPivot(CommonMessageContext reqContext)
+ public static MessageContextJAXWS processPivot(CommonMessageContext reqContext)
{
log.debug("Begin response processing");
- Boolean outbound = (Boolean)reqContext.getProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+ Boolean outbound = (Boolean)reqContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
if (outbound == null)
throw new IllegalStateException("Cannot find property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
@@ -111,7 +107,7 @@
resContext.setSOAPMessage(null);
// Reverse the direction
- resContext.setProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY, new Boolean(!outbound));
+ resContext.put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, new Boolean(!outbound));
MessageContextAssociation.pushMessageContext(resContext);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -137,29 +137,4 @@
{
return roles;
}
-
- public boolean containsProperty(String name)
- {
- return containsKey(name);
- }
-
- public Object getProperty(String name)
- {
- return get(name);
- }
-
- public Iterator getPropertyNames()
- {
- return keySet().iterator();
- }
-
- public void removeProperty(String name)
- {
- remove(name);
- }
-
- public void setProperty(String name, Object value)
- {
- put(name, value);
- }
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -26,7 +26,9 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.UndeclaredThrowableException;
+import java.util.HashMap;
+import javax.activation.DataHandler;
import javax.management.MBeanException;
import javax.xml.namespace.QName;
import javax.xml.rpc.soap.SOAPFaultException;
@@ -145,6 +147,9 @@
HandlerType[] handlerType = delegate.getHandlerTypeOrder();
HandlerType[] faultType = delegate.getHandlerTypeOrder();
+ // Set the required inbound context properties
+ setInboundContextProperties();
+
try
{
boolean oneway = false;
@@ -195,19 +200,22 @@
}
// Invoke the service endpoint
- msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+ msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
try
{
invokeServiceEndpointInstance(seInstance, epInv);
}
finally
{
- msgContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
}
// Reverse the message direction
msgContext = processPivotInternal(msgContext, direction);
+ // Set the required outbound context properties
+ setOutboundContextProperties();
+
if (binding instanceof CommonSOAPBinding)
XOPContext.setMTOMEnabled(((CommonSOAPBinding)binding).isMTOMEnabled());
@@ -223,9 +231,9 @@
msgContext.setSOAPMessage(resMessage);
}
- // call the response handler chain, removing the fault type entry will not call handleFault for that chain
if (oneway == false)
{
+ // call the response handler chain, removing the fault type entry will not call handleFault for that chain
handlersPass = callResponseHandlerChain(sepMetaData, handlerType[2]);
faultType[2] = null;
handlersPass = handlersPass && callResponseHandlerChain(sepMetaData, handlerType[1]);
@@ -273,6 +281,26 @@
}
}
+ protected void setInboundContextProperties()
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext instanceof MessageContextJAXWS)
+ {
+ // Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler
+ msgContext.put(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
+ }
+ }
+
+ protected void setOutboundContextProperties()
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext instanceof MessageContextJAXWS)
+ {
+ // Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler
+ msgContext.put(MessageContextJAXWS.OUTBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
+ }
+ }
+
private CommonMessageContext processPivotInternal(CommonMessageContext msgContext, DirectionHolder direction)
{
if (direction.getDirection() == Direction.InBound)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -413,23 +413,23 @@
if (type == EndpointMetaData.Type.JAXRPC)
{
msgContext = new SOAPMessageContextJAXRPC();
- msgContext.setProperty(MessageContextJAXRPC.SERVLET_CONTEXT, servletContext);
- msgContext.setProperty(MessageContextJAXRPC.SERVLET_REQUEST, httpRequest);
- msgContext.setProperty(MessageContextJAXRPC.SERVLET_RESPONSE, httpResponse);
- msgContext.setProperty(MessageContextJAXRPC.SERVLET_SESSION, httpSessionCallback);
+ msgContext.put(MessageContextJAXRPC.SERVLET_CONTEXT, servletContext);
+ msgContext.put(MessageContextJAXRPC.SERVLET_REQUEST, httpRequest);
+ msgContext.put(MessageContextJAXRPC.SERVLET_RESPONSE, httpResponse);
+ msgContext.put(MessageContextJAXRPC.SERVLET_SESSION, httpSessionCallback);
}
else
{
msgContext = new SOAPMessageContextJAXWS();
- msgContext.setProperty(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new Boolean(false));
- msgContext.setProperty(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
- msgContext.setProperty(MessageContextJAXWS.HTTP_REQUEST_HEADERS, headerSource.getHeaderMap());
- msgContext.setProperty(MessageContextJAXWS.HTTP_REQUEST_METHOD, httpRequest.getMethod());
- msgContext.setProperty(MessageContextJAXWS.QUERY_STRING, httpRequest.getQueryString());
- msgContext.setProperty(MessageContextJAXWS.PATH_INFO, httpRequest.getPathInfo());
- msgContext.setProperty(MessageContextJAXWS.SERVLET_CONTEXT, servletContext);
- msgContext.setProperty(MessageContextJAXWS.SERVLET_REQUEST, httpRequest);
- msgContext.setProperty(MessageContextJAXWS.SERVLET_RESPONSE, httpResponse);
+ msgContext.put(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new Boolean(false));
+ msgContext.put(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
+ msgContext.put(MessageContextJAXWS.HTTP_REQUEST_HEADERS, headerSource.getHeaderMap());
+ msgContext.put(MessageContextJAXWS.HTTP_REQUEST_METHOD, httpRequest.getMethod());
+ msgContext.put(MessageContextJAXWS.QUERY_STRING, httpRequest.getQueryString());
+ msgContext.put(MessageContextJAXWS.PATH_INFO, httpRequest.getPathInfo());
+ msgContext.put(MessageContextJAXWS.SERVLET_CONTEXT, servletContext);
+ msgContext.put(MessageContextJAXWS.SERVLET_REQUEST, httpRequest);
+ msgContext.put(MessageContextJAXWS.SERVLET_RESPONSE, httpResponse);
}
msgContext.setEndpointMetaData(sepMetaData);
@@ -442,11 +442,11 @@
// REplace the message context with the response context
msgContext = MessageContextAssociation.peekMessageContext();
- Map<String, List<String>> headers = (Map<String, List<String>>)msgContext.getProperty(MessageContextJAXWS.HTTP_RESPONSE_HEADERS);
+ Map<String, List<String>> headers = (Map<String, List<String>>)msgContext.get(MessageContextJAXWS.HTTP_RESPONSE_HEADERS);
if (headers != null)
headerSource.setHeaderMap(headers);
- Integer code = (Integer)msgContext.getProperty(MessageContextJAXWS.HTTP_RESPONSE_CODE);
+ Integer code = (Integer)msgContext.get(MessageContextJAXWS.HTTP_RESPONSE_CODE);
if (code != null)
httpResponse.setStatus(code.intValue());
@@ -487,7 +487,7 @@
String wsaTo = null;
// Get the destination from the AddressingProperties
- AddressingProperties outProps = (AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND);
+ AddressingProperties outProps = (AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND);
if (outProps != null && outProps.getTo() != null)
{
AddressingConstantsImpl ADDR = new AddressingConstantsImpl();
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EndpointInfo.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EndpointInfo.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EndpointInfo.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -23,7 +23,6 @@
// $Id$
-import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
@@ -43,7 +42,7 @@
public EndpointInfo(EndpointMetaData epMetaData, String targetAddress, Map<String, Object> callProps)
{
this.targetAddress = targetAddress;
- this.properties = new HashMap<String, Object>();
+ this.properties = callProps;
// Add the service properties
Properties serviceProps = epMetaData.getServiceMetaData().getProperties();
@@ -72,12 +71,6 @@
properties.put(key, val);
}
}
-
- // Add the call properties
- if (callProps != null)
- {
- properties.putAll(callProps);
- }
}
public Map<String, Object> getProperties()
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -334,7 +334,7 @@
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
if (msgContext != null && UnifiedMetaData.isFinalRelease() == false)
{
- Boolean allowExpand = (Boolean)msgContext.getProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ Boolean allowExpand = (Boolean)msgContext.get(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
if (handleFault == false && allowExpand != Boolean.TRUE)
throw new WSException("Expanding content element to DOM");
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -131,7 +131,7 @@
Object timeout = null;
String targetAddress;
- Map callProps;
+ Map<String, Object> callProps = new HashMap<String,Object>();
if (endpoint instanceof EndpointInfo)
{
@@ -149,12 +149,10 @@
{
EndpointReference epr = (EndpointReference)endpoint;
targetAddress = epr.getAddress().toString();
- callProps = null;
}
else
{
targetAddress = endpoint.toString();
- callProps = null;
}
// enforce xop transitions
@@ -166,7 +164,7 @@
reqMessage.saveChanges();
// setup remoting client
- Map metadata = createRemotingMetaData(reqMessage, callProps);
+ Map<String, Object> metadata = createRemotingMetaData(reqMessage, callProps);
Client client = createRemotingClient(endpoint, targetAddress, oneway);
try
@@ -201,6 +199,9 @@
// Disconnect the remoting client
client.disconnect();
+
+ callProps.clear();
+ callProps.putAll(metadata);
// debug the incomming response message
if (resMessage != null && msgLog.isTraceEnabled())
@@ -279,7 +280,7 @@
return client;
}
- private Map createRemotingMetaData(SOAPMessage reqMessage, Map callProps) throws SOAPException
+ private Map<String, Object> createRemotingMetaData(SOAPMessage reqMessage, Map callProps) throws SOAPException
{
// R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
// with a quoted value equal to the value of the soapAction attribute of
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -576,7 +576,7 @@
// TODO: This property must be reset, otherwise you negate its purpose
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+ msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
if (msgContext instanceof MessageContextJAXWS)
((MessageContextJAXWS)msgContext).setScope(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Scope.APPLICATION);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -59,7 +59,7 @@
// Dispatch based on wsa:Action
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- AddressingProperties inProps = (AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+ AddressingProperties inProps = (AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
if (inProps != null && inProps.getAction() != null)
{
String wsaAction = inProps.getAction().getURI().toASCIIString();
Modified: trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/common/EventingEndpointBase.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/common/EventingEndpointBase.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/common/EventingEndpointBase.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -53,7 +53,7 @@
protected static AddressingProperties getAddrProperties()
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- AddressingProperties inProps = (AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+ AddressingProperties inProps = (AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
assertAddrProperties(inProps);
return inProps;
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/jaxws/AbstractSubscriptionManagerEndpoint.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/jaxws/AbstractSubscriptionManagerEndpoint.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/jaxws/AbstractSubscriptionManagerEndpoint.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -140,7 +140,7 @@
{
URI subscriptionId = null;
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- AddressingProperties addrProps = (AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+ AddressingProperties addrProps = (AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
if (null == addrProps)
{
Modified: trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -249,13 +249,13 @@
if (operationConfig.getUsername() != null)
{
- Object user = ctx.getProperty(Stub.USERNAME_PROPERTY);
- Object pass = ctx.getProperty(Stub.PASSWORD_PROPERTY);
+ Object user = ctx.get(Stub.USERNAME_PROPERTY);
+ Object pass = ctx.get(Stub.PASSWORD_PROPERTY);
if (user != null && pass != null)
{
operations.add(new OperationDescription<EncodingOperation>(SendUsernameOperation.class, null, user.toString(), pass.toString(), null));
- ctx.setProperty(StubExt.PROPERTY_AUTH_TYPE, StubExt.PROPERTY_AUTH_TYPE_WSSE);
+ ctx.put(StubExt.PROPERTY_AUTH_TYPE, StubExt.PROPERTY_AUTH_TYPE_WSSE);
}
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/extensions/xop/XOPContext.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/extensions/xop/XOPContext.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/extensions/xop/XOPContext.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -137,14 +137,14 @@
public static boolean isMTOMEnabled()
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- Boolean mtomEnabled = (Boolean)msgContext.getProperty(StubExt.PROPERTY_MTOM_ENABLED);
+ Boolean mtomEnabled = (Boolean)msgContext.get(StubExt.PROPERTY_MTOM_ENABLED);
return Boolean.TRUE.equals(mtomEnabled);
}
public static void setMTOMEnabled(boolean b)
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.valueOf(b));
+ msgContext.put(StubExt.PROPERTY_MTOM_ENABLED, Boolean.valueOf(b));
}
/**
Modified: trunk/jbossws-tests/build.xml
===================================================================
--- trunk/jbossws-tests/build.xml 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-tests/build.xml 2007-03-17 18:07:34 UTC (rev 2635)
@@ -35,7 +35,7 @@
<!-- ================================================================== -->
<!-- Use -Ddebug=true for remote debugging -->
- <condition property="remote.debug.line" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006">
+ <condition property="remote.debug.line" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005">
<isset property="debug"/>
</condition>
<condition property="remote.debug.line" value="">
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -45,7 +45,7 @@
public boolean canAccessSession() throws RemoteException
{
CommonMessageContext context = MessageContextAssociation.peekMessageContext();
- HttpSession session = (HttpSession)context.getProperty(MessageContextJAXRPC.SERVLET_SESSION);
+ HttpSession session = (HttpSession)context.get(MessageContextJAXRPC.SERVLET_SESSION);
session.setAttribute("Test", "Test String");
String testString = (String)session.getAttribute("Test");
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -48,7 +48,7 @@
if(responseOptimized.equals("0"))
{
CommonMessageContext ctx = MessageContextAssociation.peekMessageContext();
- ctx.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+ ctx.put(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
}
}
}
Deleted: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java 2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -1,510 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
-
-// $Id$
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceException;
-
-import junit.framework.Test;
-
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.JBossWSTestSetup;
-
-/**
- * Test JAXWS handler lifecycle
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-MAr-2007
- */
-public class HandlerLifecycleClientTestCase extends JBossWSTest
-{
- private static SOAPEndpoint port;
- private static TrackerEndpoint trackerPort;
-
- public static Test suite()
- {
- return JBossWSTestSetup.newTestSetup(HandlerLifecycleClientTestCase.class, "jaxws-handlerlifecycle.war");
- }
-
- public void setUp() throws Exception
- {
- if (trackerPort == null)
- {
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/tracker?wsdl");
- QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "TrackerEndpointService");
- Service service = Service.create(wsdlURL, serviceName);
- trackerPort = (TrackerEndpoint)service.getPort(TrackerEndpoint.class);
- }
-
- if (port == null)
- {
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/soap?wsdl");
- QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "SOAPEndpointService");
- Service service = Service.create(wsdlURL, serviceName);
- port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
- }
- }
-
- protected void tearDown() throws Exception
- {
- HandlerTracker.clearListMessages();
- trackerPort.clearListMessages();
- assertEquals("[]", HandlerTracker.getListMessages());
- assertEquals("[]", trackerPort.getListMessages());
- }
-
- /**
- * All handlers return true
- */
- public void testHandleMessageTrue() throws Exception
- {
- System.out.println("FIXME: [JBWS-1579] @EndpointConfig ignored on SEI");
-
- String testResponse = port.runTest(getName());
-
- String trackerMessages = HandlerTracker.getListMessages();
- List<String> expMessages = new ArrayList<String>();
- expMessages.add("ClientHandler1:PostConstruct");
- expMessages.add("ClientHandler2:PostConstruct");
- expMessages.add("ClientHandler3:PostConstruct");
- expMessages.add("ClientHandler1:Message:OutBound");
- expMessages.add("ClientHandler2:Message:OutBound");
- expMessages.add("ClientHandler3:Message:OutBound");
- expMessages.add("ClientHandler3:Message:InBound");
- expMessages.add("ClientHandler2:Message:InBound");
- expMessages.add("ClientHandler1:Message:InBound");
- expMessages.add("ClientHandler3:Close");
- expMessages.add("ClientHandler2:Close");
- expMessages.add("ClientHandler1:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- trackerMessages = trackerPort.getListMessages();
- expMessages = new ArrayList<String>();
-
- // Handler construction
- expMessages.add("PreServerHandler1:PostConstruct");
- expMessages.add("PreServerHandler2:PostConstruct");
- expMessages.add("ServerHandler1:PostConstruct");
- expMessages.add("ServerHandler2:PostConstruct");
- expMessages.add("ServerHandler3:PostConstruct");
- expMessages.add("PostServerHandler1:PostConstruct");
- expMessages.add("PostServerHandler2:PostConstruct");
-
- // Inbound server message
- expMessages.add("PostServerHandler2:Message:InBound");
- expMessages.add("PostServerHandler1:Message:InBound");
- expMessages.add("ServerHandler3:Message:InBound");
- expMessages.add("ServerHandler2:Message:InBound");
- expMessages.add("ServerHandler1:Message:InBound");
- expMessages.add("PreServerHandler2:Message:InBound");
- expMessages.add("PreServerHandler1:Message:InBound");
-
- // Pre/Post handler are defined in the context of outbound
- expMessages.add("PreServerHandler1:Message:OutBound");
- expMessages.add("PreServerHandler2:Message:OutBound");
- expMessages.add("ServerHandler1:Message:OutBound");
- expMessages.add("ServerHandler2:Message:OutBound");
- expMessages.add("ServerHandler3:Message:OutBound");
- expMessages.add("PostServerHandler1:Message:OutBound");
- expMessages.add("PostServerHandler2:Message:OutBound");
-
- // Handler closing
- expMessages.add("PreServerHandler1:Close");
- expMessages.add("PreServerHandler2:Close");
- expMessages.add("ServerHandler1:Close");
- expMessages.add("ServerHandler2:Close");
- expMessages.add("ServerHandler3:Close");
- expMessages.add("PostServerHandler1:Close");
- expMessages.add("PostServerHandler2:Close");
-
- assertEquals(expMessages.toString(), trackerMessages);
-
- assertEquals(getName() + "Response", testResponse);
- }
-
- /**
- * ClientHandler2 returns false on outbound
- */
- public void testClientOutboundHandleMessageFalse() throws Exception
- {
- String testResponse = port.runTest(getName());
-
- String trackerMessages = HandlerTracker.getListMessages();
- List<String> expMessages = new ArrayList<String>();
- expMessages.add("ClientHandler1:Message:OutBound");
- expMessages.add("ClientHandler2:Message:OutBound:false");
- expMessages.add("ClientHandler2:Close");
- expMessages.add("ClientHandler1:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- trackerMessages = trackerPort.getListMessages();
- expMessages = new ArrayList<String>();
- assertEquals(expMessages.toString(), trackerMessages);
-
- assertNull(testResponse);
- }
-
- /**
- * ClientHandler2 throws a RuntimeException on outbound
- */
- public void testClientOutboundHandleMessageThrowsRuntimeException() throws Exception
- {
- String testResponse;
- try
- {
- testResponse = port.runTest(getName());
- fail("RuntimeException expected, but got: " + testResponse);
- }
- catch (WebServiceException ex)
- {
- testResponse = ex.getMessage();
- }
-
- String trackerMessages = HandlerTracker.getListMessages();
- List<String> expMessages = new ArrayList<String>();
- expMessages.add("ClientHandler1:Message:OutBound");
- expMessages.add("ClientHandler2:Message:OutBound:ErrorInClientHandler2");
- expMessages.add("ClientHandler1:Fault:InBound");
- expMessages.add("ClientHandler2:Close");
- expMessages.add("ClientHandler1:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- trackerMessages = trackerPort.getListMessages();
- expMessages = new ArrayList<String>();
- assertEquals(expMessages.toString(), trackerMessages);
-
- assertEquals("ErrorInClientHandler2", testResponse);
- }
-
- /**
- * ServerHandler2 returns false on inbound
- */
- public void testServerInboundHandleMessageFalse() throws Exception
- {
- String testResponse = port.runTest(getName());
-
- String trackerMessages = trackerPort.getListMessages();
- List<String> expMessages = new ArrayList<String>();
- expMessages.add("PostServerHandler2:Message:InBound");
- expMessages.add("PostServerHandler1:Message:InBound");
- expMessages.add("ServerHandler3:Message:InBound");
- expMessages.add("ServerHandler2:Message:InBound:false");
- expMessages.add("ServerHandler3:Message:OutBound");
- expMessages.add("PostServerHandler1:Message:OutBound");
- expMessages.add("PostServerHandler2:Message:OutBound");
- expMessages.add("ServerHandler2:Close");
- expMessages.add("ServerHandler3:Close");
- expMessages.add("PostServerHandler1:Close");
- expMessages.add("PostServerHandler2:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- trackerMessages = HandlerTracker.getListMessages();
- expMessages = new ArrayList<String>();
- expMessages.add("ClientHandler1:Message:OutBound");
- expMessages.add("ClientHandler2:Message:OutBound");
- expMessages.add("ClientHandler3:Message:OutBound");
- expMessages.add("ClientHandler3:Message:InBound");
- expMessages.add("ClientHandler2:Message:InBound");
- expMessages.add("ClientHandler1:Message:InBound");
- expMessages.add("ClientHandler3:Close");
- expMessages.add("ClientHandler2:Close");
- expMessages.add("ClientHandler1:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- assertEquals("testServerHandler2Response", testResponse);
- }
-
- /**
- * ServerHandler2 trows a RuntimeException on inbound
- */
- public void testServerInboundHandleMessageThrowsRuntimeException() throws Exception
- {
- String testResponse;
- try
- {
- testResponse = port.runTest(getName());
- fail("RuntimeException expected, but got: " + testResponse);
- }
- catch (WebServiceException ex)
- {
- testResponse = ex.getMessage();
- }
-
- String trackerMessages = trackerPort.getListMessages();
- List<String> expMessages = new ArrayList<String>();
- expMessages.add("PostServerHandler2:Message:InBound");
- expMessages.add("PostServerHandler1:Message:InBound");
- expMessages.add("ServerHandler3:Message:InBound");
- expMessages.add("ServerHandler2:Message:InBound:ErrorInServerHandler2");
- expMessages.add("ServerHandler3:Fault:OutBound");
- expMessages.add("PostServerHandler1:Fault:OutBound");
- expMessages.add("PostServerHandler2:Fault:OutBound");
- expMessages.add("ServerHandler2:Close");
- expMessages.add("ServerHandler3:Close");
- expMessages.add("PostServerHandler1:Close");
- expMessages.add("PostServerHandler2:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- trackerMessages = HandlerTracker.getListMessages();
- expMessages = new ArrayList<String>();
- expMessages.add("ClientHandler1:Message:OutBound");
- expMessages.add("ClientHandler2:Message:OutBound");
- expMessages.add("ClientHandler3:Message:OutBound");
- expMessages.add("ClientHandler3:Fault:InBound");
- expMessages.add("ClientHandler2:Fault:InBound");
- expMessages.add("ClientHandler1:Fault:InBound");
- expMessages.add("ClientHandler3:Close");
- expMessages.add("ClientHandler2:Close");
- expMessages.add("ClientHandler1:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- assertEquals("ErrorInServerHandler2", testResponse);
- }
-
- /**
- * ServerHandler2 returns false on outbound
- */
- public void testServerOutboundHandleMessageFalse() throws Exception
- {
- String testResponse = port.runTest(getName());
-
- String trackerMessages = trackerPort.getListMessages();
- List<String> expMessages = new ArrayList<String>();
- expMessages.add("PostServerHandler2:Message:InBound");
- expMessages.add("PostServerHandler1:Message:InBound");
- expMessages.add("ServerHandler3:Message:InBound");
- expMessages.add("ServerHandler2:Message:InBound");
- expMessages.add("ServerHandler1:Message:InBound");
- expMessages.add("PreServerHandler2:Message:InBound");
- expMessages.add("PreServerHandler1:Message:InBound");
- expMessages.add("PreServerHandler1:Message:OutBound");
- expMessages.add("PreServerHandler2:Message:OutBound");
- expMessages.add("ServerHandler1:Message:OutBound");
- expMessages.add("ServerHandler2:Message:OutBound:false");
- expMessages.add("PreServerHandler1:Close");
- expMessages.add("PreServerHandler2:Close");
- expMessages.add("ServerHandler1:Close");
- expMessages.add("ServerHandler2:Close");
- expMessages.add("ServerHandler3:Close");
- expMessages.add("PostServerHandler1:Close");
- expMessages.add("PostServerHandler2:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- trackerMessages = HandlerTracker.getListMessages();
- expMessages = new ArrayList<String>();
- expMessages.add("ClientHandler1:Message:OutBound");
- expMessages.add("ClientHandler2:Message:OutBound");
- expMessages.add("ClientHandler3:Message:OutBound");
- expMessages.add("ClientHandler3:Message:InBound");
- expMessages.add("ClientHandler2:Message:InBound");
- expMessages.add("ClientHandler1:Message:InBound");
- expMessages.add("ClientHandler3:Close");
- expMessages.add("ClientHandler2:Close");
- expMessages.add("ClientHandler1:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- assertEquals(getName() + "Response", testResponse);
- }
-
- /**
- * ServerHandler2 trows a RuntimeException on outbound
- */
- public void testServerOutboundHandleMessageThrowsRuntimeException() throws Exception
- {
- String testResponse;
- try
- {
- testResponse = port.runTest(getName());
- fail("RuntimeException expected, but got: " + testResponse);
- }
- catch (WebServiceException ex)
- {
- testResponse = ex.getMessage();
- }
-
- String trackerMessages = trackerPort.getListMessages();
- List<String> expMessages = new ArrayList<String>();
- expMessages.add("PostServerHandler2:Message:InBound");
- expMessages.add("PostServerHandler1:Message:InBound");
- expMessages.add("ServerHandler3:Message:InBound");
- expMessages.add("ServerHandler2:Message:InBound");
- expMessages.add("ServerHandler1:Message:InBound");
- expMessages.add("PreServerHandler2:Message:InBound");
- expMessages.add("PreServerHandler1:Message:InBound");
- expMessages.add("PreServerHandler1:Message:OutBound");
- expMessages.add("PreServerHandler2:Message:OutBound");
- expMessages.add("ServerHandler1:Message:OutBound");
- expMessages.add("ServerHandler2:Message:OutBound:ErrorInServerHandler2");
- expMessages.add("ServerHandler3:Fault:OutBound");
- expMessages.add("PostServerHandler1:Fault:OutBound");
- expMessages.add("PostServerHandler2:Fault:OutBound");
- expMessages.add("PreServerHandler1:Close");
- expMessages.add("PreServerHandler2:Close");
- expMessages.add("ServerHandler1:Close");
- expMessages.add("ServerHandler2:Close");
- expMessages.add("ServerHandler3:Close");
- expMessages.add("PostServerHandler1:Close");
- expMessages.add("PostServerHandler2:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- trackerMessages = HandlerTracker.getListMessages();
- expMessages = new ArrayList<String>();
- expMessages.add("ClientHandler1:Message:OutBound");
- expMessages.add("ClientHandler2:Message:OutBound");
- expMessages.add("ClientHandler3:Message:OutBound");
- expMessages.add("ClientHandler3:Fault:InBound");
- expMessages.add("ClientHandler2:Fault:InBound");
- expMessages.add("ClientHandler1:Fault:InBound");
- expMessages.add("ClientHandler3:Close");
- expMessages.add("ClientHandler2:Close");
- expMessages.add("ClientHandler1:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- assertEquals("ErrorInServerHandler2", testResponse);
- }
-
- /**
- * ClientHandler2 returns false on inbound
- */
- public void testClientInboundHandleMessageFalse() throws Exception
- {
- String testResponse = port.runTest(getName());
-
- String trackerMessages = HandlerTracker.getListMessages();
- List<String> expMessages = new ArrayList<String>();
- expMessages.add("ClientHandler1:Message:OutBound");
- expMessages.add("ClientHandler2:Message:OutBound");
- expMessages.add("ClientHandler3:Message:OutBound");
- expMessages.add("ClientHandler3:Message:InBound");
- expMessages.add("ClientHandler2:Message:InBound:false");
- expMessages.add("ClientHandler3:Close");
- expMessages.add("ClientHandler2:Close");
- expMessages.add("ClientHandler1:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- trackerMessages = trackerPort.getListMessages();
- expMessages = new ArrayList<String>();
- expMessages.add("PostServerHandler2:Message:InBound");
- expMessages.add("PostServerHandler1:Message:InBound");
- expMessages.add("ServerHandler3:Message:InBound");
- expMessages.add("ServerHandler2:Message:InBound");
- expMessages.add("ServerHandler1:Message:InBound");
- expMessages.add("PreServerHandler2:Message:InBound");
- expMessages.add("PreServerHandler1:Message:InBound");
- expMessages.add("PreServerHandler1:Message:OutBound");
- expMessages.add("PreServerHandler2:Message:OutBound");
- expMessages.add("ServerHandler1:Message:OutBound");
- expMessages.add("ServerHandler2:Message:OutBound");
- expMessages.add("ServerHandler3:Message:OutBound");
- expMessages.add("PostServerHandler1:Message:OutBound");
- expMessages.add("PostServerHandler2:Message:OutBound");
- expMessages.add("PreServerHandler1:Close");
- expMessages.add("PreServerHandler2:Close");
- expMessages.add("ServerHandler1:Close");
- expMessages.add("ServerHandler2:Close");
- expMessages.add("ServerHandler3:Close");
- expMessages.add("PostServerHandler1:Close");
- expMessages.add("PostServerHandler2:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- assertEquals(getName() + "Response", testResponse);
- }
-
- /**
- * ClientHandler2 throws a RuntimeException on intbound
- */
- public void testClientInboundHandleMessageThrowsRuntimeException() throws Exception
- {
- String testResponse;
- try
- {
- testResponse = port.runTest(getName());
- fail("RuntimeException expected, but got: " + testResponse);
- }
- catch (WebServiceException ex)
- {
- testResponse = ex.getMessage();
- }
-
- String trackerMessages = HandlerTracker.getListMessages();
- List<String> expMessages = new ArrayList<String>();
- expMessages.add("ClientHandler1:Message:OutBound");
- expMessages.add("ClientHandler2:Message:OutBound");
- expMessages.add("ClientHandler3:Message:OutBound");
- expMessages.add("ClientHandler3:Message:InBound");
- expMessages.add("ClientHandler2:Message:InBound:ErrorInClientHandler2");
- expMessages.add("ClientHandler1:Fault:InBound");
- expMessages.add("ClientHandler3:Close");
- expMessages.add("ClientHandler2:Close");
- expMessages.add("ClientHandler1:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- trackerMessages = trackerPort.getListMessages();
- expMessages = new ArrayList<String>();
- expMessages.add("PostServerHandler2:Message:InBound");
- expMessages.add("PostServerHandler1:Message:InBound");
- expMessages.add("ServerHandler3:Message:InBound");
- expMessages.add("ServerHandler2:Message:InBound");
- expMessages.add("ServerHandler1:Message:InBound");
- expMessages.add("PreServerHandler2:Message:InBound");
- expMessages.add("PreServerHandler1:Message:InBound");
- expMessages.add("PreServerHandler1:Message:OutBound");
- expMessages.add("PreServerHandler2:Message:OutBound");
- expMessages.add("ServerHandler1:Message:OutBound");
- expMessages.add("ServerHandler2:Message:OutBound");
- expMessages.add("ServerHandler3:Message:OutBound");
- expMessages.add("PostServerHandler1:Message:OutBound");
- expMessages.add("PostServerHandler2:Message:OutBound");
- expMessages.add("PreServerHandler1:Close");
- expMessages.add("PreServerHandler2:Close");
- expMessages.add("ServerHandler1:Close");
- expMessages.add("ServerHandler2:Close");
- expMessages.add("ServerHandler3:Close");
- expMessages.add("PostServerHandler1:Close");
- expMessages.add("PostServerHandler2:Close");
- assertEquals(expMessages.toString(), trackerMessages);
-
- assertEquals("ErrorInClientHandler2", testResponse);
- }
-
- public void testPropertyScoping() throws Exception
- {
- Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
- Map<String, Object> resContext = ((BindingProvider)port).getResponseContext();
- reqContext.put("client-req-prop", Boolean.TRUE);
-
- String retStr = port.runTest(getName());
- assertEquals(getName() + "Response", retStr);
-
- assertNull(resContext.get("client-handler-prop"));
- assertEquals(Boolean.TRUE, resContext.get("client-res-prop"));
- }
-}
Copied: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java (from rev 2634, trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java)
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java 2007-03-17 18:07:34 UTC (rev 2635)
@@ -0,0 +1,510 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+// $Id$
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+
+/**
+ * Test JAXWS handler lifecycle
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 13-MAr-2007
+ */
+public class HandlerLifecycleTestCase extends JBossWSTest
+{
+ private static SOAPEndpoint port;
+ private static TrackerEndpoint trackerPort;
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(HandlerLifecycleTestCase.class, "jaxws-handlerlifecycle.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ if (trackerPort == null)
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/tracker?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "TrackerEndpointService");
+ Service service = Service.create(wsdlURL, serviceName);
+ trackerPort = (TrackerEndpoint)service.getPort(TrackerEndpoint.class);
+ }
+
+ if (port == null)
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/soap?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "SOAPEndpointService");
+ Service service = Service.create(wsdlURL, serviceName);
+ port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
+ }
+ }
+
+ protected void tearDown() throws Exception
+ {
+ HandlerTracker.clearListMessages();
+ trackerPort.clearListMessages();
+ assertEquals("[]", HandlerTracker.getListMessages());
+ assertEquals("[]", trackerPort.getListMessages());
+ }
+
+ /**
+ * All handlers return true
+ */
+ public void testHandleMessageTrue() throws Exception
+ {
+ System.out.println("FIXME: [JBWS-1579] @EndpointConfig ignored on SEI");
+
+ String testResponse = port.runTest(getName());
+
+ String trackerMessages = HandlerTracker.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:PostConstruct");
+ expMessages.add("ClientHandler2:PostConstruct");
+ expMessages.add("ClientHandler3:PostConstruct");
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:InBound");
+ expMessages.add("ClientHandler2:Message:InBound");
+ expMessages.add("ClientHandler1:Message:InBound");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = trackerPort.getListMessages();
+ expMessages = new ArrayList<String>();
+
+ // Handler construction
+ expMessages.add("PreServerHandler1:PostConstruct");
+ expMessages.add("PreServerHandler2:PostConstruct");
+ expMessages.add("ServerHandler1:PostConstruct");
+ expMessages.add("ServerHandler2:PostConstruct");
+ expMessages.add("ServerHandler3:PostConstruct");
+ expMessages.add("PostServerHandler1:PostConstruct");
+ expMessages.add("PostServerHandler2:PostConstruct");
+
+ // Inbound server message
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound");
+ expMessages.add("ServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler2:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:InBound");
+
+ // Pre/Post handler are defined in the context of outbound
+ expMessages.add("PreServerHandler1:Message:OutBound");
+ expMessages.add("PreServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler1:Message:OutBound");
+ expMessages.add("ServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler3:Message:OutBound");
+ expMessages.add("PostServerHandler1:Message:OutBound");
+ expMessages.add("PostServerHandler2:Message:OutBound");
+
+ // Handler closing
+ expMessages.add("PreServerHandler1:Close");
+ expMessages.add("PreServerHandler2:Close");
+ expMessages.add("ServerHandler1:Close");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertEquals(getName() + "Response", testResponse);
+ }
+
+ /**
+ * ClientHandler2 returns false on outbound
+ */
+ public void testClientOutboundHandleMessageFalse() throws Exception
+ {
+ String testResponse = port.runTest(getName());
+
+ String trackerMessages = HandlerTracker.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound:false");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = trackerPort.getListMessages();
+ expMessages = new ArrayList<String>();
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertNull(testResponse);
+ }
+
+ /**
+ * ClientHandler2 throws a RuntimeException on outbound
+ */
+ public void testClientOutboundHandleMessageThrowsRuntimeException() throws Exception
+ {
+ String testResponse;
+ try
+ {
+ testResponse = port.runTest(getName());
+ fail("RuntimeException expected, but got: " + testResponse);
+ }
+ catch (WebServiceException ex)
+ {
+ testResponse = ex.getMessage();
+ }
+
+ String trackerMessages = HandlerTracker.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound:ErrorInClientHandler2");
+ expMessages.add("ClientHandler1:Fault:InBound");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = trackerPort.getListMessages();
+ expMessages = new ArrayList<String>();
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertEquals("ErrorInClientHandler2", testResponse);
+ }
+
+ /**
+ * ServerHandler2 returns false on inbound
+ */
+ public void testServerInboundHandleMessageFalse() throws Exception
+ {
+ String testResponse = port.runTest(getName());
+
+ String trackerMessages = trackerPort.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound:false");
+ expMessages.add("ServerHandler3:Message:OutBound");
+ expMessages.add("PostServerHandler1:Message:OutBound");
+ expMessages.add("PostServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = HandlerTracker.getListMessages();
+ expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:InBound");
+ expMessages.add("ClientHandler2:Message:InBound");
+ expMessages.add("ClientHandler1:Message:InBound");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertEquals("testServerHandler2Response", testResponse);
+ }
+
+ /**
+ * ServerHandler2 trows a RuntimeException on inbound
+ */
+ public void testServerInboundHandleMessageThrowsRuntimeException() throws Exception
+ {
+ String testResponse;
+ try
+ {
+ testResponse = port.runTest(getName());
+ fail("RuntimeException expected, but got: " + testResponse);
+ }
+ catch (WebServiceException ex)
+ {
+ testResponse = ex.getMessage();
+ }
+
+ String trackerMessages = trackerPort.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound:ErrorInServerHandler2");
+ expMessages.add("ServerHandler3:Fault:OutBound");
+ expMessages.add("PostServerHandler1:Fault:OutBound");
+ expMessages.add("PostServerHandler2:Fault:OutBound");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = HandlerTracker.getListMessages();
+ expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Fault:InBound");
+ expMessages.add("ClientHandler2:Fault:InBound");
+ expMessages.add("ClientHandler1:Fault:InBound");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertEquals("ErrorInServerHandler2", testResponse);
+ }
+
+ /**
+ * ServerHandler2 returns false on outbound
+ */
+ public void testServerOutboundHandleMessageFalse() throws Exception
+ {
+ String testResponse = port.runTest(getName());
+
+ String trackerMessages = trackerPort.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound");
+ expMessages.add("ServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler2:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:OutBound");
+ expMessages.add("PreServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler1:Message:OutBound");
+ expMessages.add("ServerHandler2:Message:OutBound:false");
+ expMessages.add("PreServerHandler1:Close");
+ expMessages.add("PreServerHandler2:Close");
+ expMessages.add("ServerHandler1:Close");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = HandlerTracker.getListMessages();
+ expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:InBound");
+ expMessages.add("ClientHandler2:Message:InBound");
+ expMessages.add("ClientHandler1:Message:InBound");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertEquals(getName() + "Response", testResponse);
+ }
+
+ /**
+ * ServerHandler2 trows a RuntimeException on outbound
+ */
+ public void testServerOutboundHandleMessageThrowsRuntimeException() throws Exception
+ {
+ String testResponse;
+ try
+ {
+ testResponse = port.runTest(getName());
+ fail("RuntimeException expected, but got: " + testResponse);
+ }
+ catch (WebServiceException ex)
+ {
+ testResponse = ex.getMessage();
+ }
+
+ String trackerMessages = trackerPort.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound");
+ expMessages.add("ServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler2:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:OutBound");
+ expMessages.add("PreServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler1:Message:OutBound");
+ expMessages.add("ServerHandler2:Message:OutBound:ErrorInServerHandler2");
+ expMessages.add("ServerHandler3:Fault:OutBound");
+ expMessages.add("PostServerHandler1:Fault:OutBound");
+ expMessages.add("PostServerHandler2:Fault:OutBound");
+ expMessages.add("PreServerHandler1:Close");
+ expMessages.add("PreServerHandler2:Close");
+ expMessages.add("ServerHandler1:Close");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = HandlerTracker.getListMessages();
+ expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Fault:InBound");
+ expMessages.add("ClientHandler2:Fault:InBound");
+ expMessages.add("ClientHandler1:Fault:InBound");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertEquals("ErrorInServerHandler2", testResponse);
+ }
+
+ /**
+ * ClientHandler2 returns false on inbound
+ */
+ public void testClientInboundHandleMessageFalse() throws Exception
+ {
+ String testResponse = port.runTest(getName());
+
+ String trackerMessages = HandlerTracker.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:InBound");
+ expMessages.add("ClientHandler2:Message:InBound:false");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = trackerPort.getListMessages();
+ expMessages = new ArrayList<String>();
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound");
+ expMessages.add("ServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler2:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:OutBound");
+ expMessages.add("PreServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler1:Message:OutBound");
+ expMessages.add("ServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler3:Message:OutBound");
+ expMessages.add("PostServerHandler1:Message:OutBound");
+ expMessages.add("PostServerHandler2:Message:OutBound");
+ expMessages.add("PreServerHandler1:Close");
+ expMessages.add("PreServerHandler2:Close");
+ expMessages.add("ServerHandler1:Close");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertEquals(getName() + "Response", testResponse);
+ }
+
+ /**
+ * ClientHandler2 throws a RuntimeException on intbound
+ */
+ public void testClientInboundHandleMessageThrowsRuntimeException() throws Exception
+ {
+ String testResponse;
+ try
+ {
+ testResponse = port.runTest(getName());
+ fail("RuntimeException expected, but got: " + testResponse);
+ }
+ catch (WebServiceException ex)
+ {
+ testResponse = ex.getMessage();
+ }
+
+ String trackerMessages = HandlerTracker.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:InBound");
+ expMessages.add("ClientHandler2:Message:InBound:ErrorInClientHandler2");
+ expMessages.add("ClientHandler1:Fault:InBound");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = trackerPort.getListMessages();
+ expMessages = new ArrayList<String>();
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound");
+ expMessages.add("ServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler2:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:OutBound");
+ expMessages.add("PreServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler1:Message:OutBound");
+ expMessages.add("ServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler3:Message:OutBound");
+ expMessages.add("PostServerHandler1:Message:OutBound");
+ expMessages.add("PostServerHandler2:Message:OutBound");
+ expMessages.add("PreServerHandler1:Close");
+ expMessages.add("PreServerHandler2:Close");
+ expMessages.add("ServerHandler1:Close");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertEquals("ErrorInClientHandler2", testResponse);
+ }
+
+ public void testPropertyScoping() throws Exception
+ {
+ Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
+ Map<String, Object> resContext = ((BindingProvider)port).getResponseContext();
+ reqContext.put("client-req-prop", Boolean.TRUE);
+
+ String retStr = port.runTest(getName());
+ assertEquals(getName() + "Response", retStr);
+
+ assertNull(resContext.get("client-handler-prop"));
+ assertEquals(Boolean.TRUE, resContext.get("client-res-prop"));
+ }
+}
17 years, 9 months
JBossWS SVN: r2634 - in trunk/jbossws-core/src/java/org/jboss/ws/core: jaxws and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-03-16 19:44:09 -0400 (Fri, 16 Mar 2007)
New Revision: 2634
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/SerializationContext.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/ObjectContent.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java
Log:
Fix fault bean serialization
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/SerializationContext.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/SerializationContext.java 2007-03-16 22:02:41 UTC (rev 2633)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/SerializationContext.java 2007-03-16 23:44:09 UTC (rev 2634)
@@ -38,8 +38,9 @@
public abstract class SerializationContext
{
public static final String CONTEXT_TYPES = "org.jboss.ws.jaxrpc.binding.contextTypes";
-
- // The type mapping that is valid for this serialization context
+
+ private Class javaType;
+
private TypeMappingImpl typeMapping;
// The namespace registry that is valid for this serialization context
private NamespaceRegistry namespaceRegistry = new NamespaceRegistry();
@@ -70,4 +71,14 @@
{
return namespaceRegistry;
}
+
+ public Class getJavaType()
+ {
+ return javaType;
+ }
+
+ public void setJavaType(Class javaType)
+ {
+ this.javaType = javaType;
+ }
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2007-03-16 22:02:41 UTC (rev 2633)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2007-03-16 23:44:09 UTC (rev 2634)
@@ -63,10 +63,9 @@
Result result = null;
try
{
- // The PMD contains the base type, which is needed for JAXB to marshall xsi:type correctly.
+ // The serialization context contains the base type, which is needed for JAXB to marshall xsi:type correctly.
// This should be more efficient and accurate than searching the type mapping
- ParameterMetaData pmd = (ParameterMetaData)serContext.getProperty(ParameterMetaData.class.getName());
- Class expectedType = pmd.getJavaType();
+ Class expectedType = serContext.getJavaType();
Class actualType = value.getClass();
JAXBContextCache contextCache = JAXBContextCache.getContextCache();
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2007-03-16 22:02:41 UTC (rev 2633)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2007-03-16 23:44:09 UTC (rev 2634)
@@ -307,7 +307,8 @@
// Get the serializer from the type mapping
QName xmlType = faultMetaData.getXmlType();
- Class javaType = faultMetaData.getFaultBean() != null ? faultMetaData.getFaultBean() : faultMetaData.getJavaType();
+ Class javaType = faultMetaData.getFaultBean();
+ serContext.setJavaType(javaType);
SerializerFactoryBase serFactory = (SerializerFactoryBase)serContext.getTypeMapping().getSerializer(javaType, xmlType);
if (serFactory == null)
throw new WebServiceException("Cannot obtain serializer factory: xmlType=" + xmlType + ", javaType=" + javaType);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/ObjectContent.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/ObjectContent.java 2007-03-16 22:02:41 UTC (rev 2633)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/ObjectContent.java 2007-03-16 23:44:09 UTC (rev 2634)
@@ -133,6 +133,7 @@
SerializationContext serContext = msgContext.getSerializationContext();
serContext.setProperty(ParameterMetaData.class.getName(), container.getParamMetaData());
+ serContext.setJavaType(javaType);
TypeMappingImpl typeMapping = serContext.getTypeMapping();
XMLFragment xmlFragment = null;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java 2007-03-16 22:02:41 UTC (rev 2633)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java 2007-03-16 23:44:09 UTC (rev 2634)
@@ -126,6 +126,7 @@
SerializationContext serContext = msgContext.getSerializationContext();
ParameterMetaData pmd = container.getParamMetaData();
serContext.setProperty(ParameterMetaData.class.getName(), pmd);
+ serContext.setJavaType(javaType);
List<Class> registeredTypes = pmd.getOperationMetaData().getEndpointMetaData().getRegisteredTypes();
serContext.setProperty(SerializationContext.CONTEXT_TYPES, registeredTypes.toArray(new Class[0]));
17 years, 9 months
JBossWS SVN: r2633 - in trunk: jbossws-core/src/java/org/jboss/ws/core/soap and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-16 18:02:41 -0400 (Fri, 16 Mar 2007)
New Revision: 2633
Modified:
trunk/build/ant.properties.example
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
Log:
Fix NPE in SOAPBodyImpl with Provider
Modified: trunk/build/ant.properties.example
===================================================================
--- trunk/build/ant.properties.example 2007-03-16 20:40:00 UTC (rev 2632)
+++ trunk/build/ant.properties.example 2007-03-16 22:02:41 UTC (rev 2633)
@@ -9,7 +9,7 @@
#jboss40.home=/home/tdiesler/svn/jbossas/branches/Branch_4_0/build/output/jboss-4.0.5.SP1-ejb3
# The JBoss server under test. This can be [jboss50|jboss42|jboss40|tomcat]
-jbossws.integration.target=jboss42
+jbossws.integration.target=jboss50
# The JBoss server instance
jboss.server.instance=default
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-16 20:40:00 UTC (rev 2632)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-16 22:02:41 UTC (rev 2633)
@@ -218,7 +218,6 @@
public SOAPFault getFault()
{
log.trace("getFault");
- expandToDOM(true);
Iterator it = faultIterator();
SOAPFault soapFault = it.hasNext() ? (SOAPFault)it.next() : null;
return soapFault;
@@ -232,6 +231,7 @@
private Iterator faultIterator()
{
+ expandToDOM(true);
return getChildElements(new QName(getNamespaceURI(), "Fault"));
}
@@ -335,7 +335,7 @@
if (msgContext != null && UnifiedMetaData.isFinalRelease() == false)
{
Boolean allowExpand = (Boolean)msgContext.getProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- if (handleFault == false && allowExpand == false)
+ if (handleFault == false && allowExpand != Boolean.TRUE)
throw new WSException("Expanding content element to DOM");
}
17 years, 9 months
JBossWS SVN: r2632 - trunk/jbossws-core/src/java/org/jboss/ws/core/soap.
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-03-16 16:40:00 -0400 (Fri, 16 Mar 2007)
New Revision: 2632
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
Log:
Revert hasFault change that was included in 2629
(It introduced severe TCK regression)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-16 19:18:35 UTC (rev 2631)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-16 20:40:00 UTC (rev 2632)
@@ -79,7 +79,6 @@
private Source payload;
private boolean isDOMValid = true;
private boolean isModifiedFromSource;
- private boolean hasFault;
public SOAPBodyImpl(String prefix, String namespace)
{
@@ -157,7 +156,6 @@
SOAPFaultImpl soapFault = new SOAPFaultImpl(getPrefix(), getNamespaceURI());
soapFault = (SOAPFaultImpl)addChildElement(soapFault);
soapFault.setFaultCode(soapFault.getDefaultFaultCode());
- hasFault = true;
return soapFault;
}
@@ -172,7 +170,6 @@
soapFault = (SOAPFaultImpl)addChildElement(soapFault);
soapFault.setFaultCode(faultCode);
soapFault.setFaultString(faultString);
- hasFault = true;
return soapFault;
}
@@ -187,7 +184,6 @@
soapFault = (SOAPFaultImpl)addChildElement(soapFault);
soapFault.setFaultCode(faultCode);
soapFault.setFaultString(faultString);
- hasFault = true;
return soapFault;
}
@@ -202,7 +198,6 @@
soapFault.setFaultCode(faultCode);
soapFault.setFaultString(faultString, locale);
addChildElement(soapFault);
- hasFault = true;
return soapFault;
}
@@ -217,7 +212,6 @@
soapFault.setFaultCode(faultCode);
soapFault.setFaultString(faultString, locale);
addChildElement(soapFault);
- hasFault = true;
return soapFault;
}
@@ -227,14 +221,13 @@
expandToDOM(true);
Iterator it = faultIterator();
SOAPFault soapFault = it.hasNext() ? (SOAPFault)it.next() : null;
- hasFault = (soapFault != null);
return soapFault;
}
public boolean hasFault()
{
log.trace("hasFault");
- return hasFault;
+ return faultIterator().hasNext();
}
private Iterator faultIterator()
17 years, 9 months
JBossWS SVN: r2631 - in trunk: jbossws-core/src/java/org/jboss/ws/core/jaxws/handler and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-16 15:18:35 -0400 (Fri, 16 Mar 2007)
New Revision: 2631
Added:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler1.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler2.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler3.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostClientHandler1.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostClientHandler2.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostServerHandler1.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostServerHandler2.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreClientHandler1.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreClientHandler2.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreServerHandler1.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreServerHandler2.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler1.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler2.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler3.java
trunk/jbossws-tests/src/resources/jaxws/handlerlifecycle/META-INF/
trunk/jbossws-tests/src/resources/jaxws/handlerlifecycle/META-INF/jaxws-client-config.xml
trunk/jbossws-tests/src/resources/jaxws/handlerlifecycle/WEB-INF/jaxws-endpoint-config.xml
Removed:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleServletTestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.java
trunk/jbossws-tests/src/resources/jaxws/handlerlifecycle/ServletClient/
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerHandlerDelegate.java
trunk/jbossws-core/src/resources/jbossws.sar/META-INF/standard-jaxws-endpoint-config.xml
trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerTracker.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpoint.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-client-handlers.xml
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-server-handlers.xml
Log:
Fixed: [JBWS-1578] Redefine order of jaxws handlers
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -72,6 +72,14 @@
sepMetaData.registerConfigObserver(this);
}
+ /**
+ * For JAXRPC PRE/POST are defined in the context of message origin.
+ */
+ protected HandlerType[] getHandlerTypeOrder()
+ {
+ return new HandlerType[] { HandlerType.PRE, HandlerType.ENDPOINT, HandlerType.POST };
+ }
+
public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
{
SOAPMessageContextJAXRPC msgContext = (SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
@@ -94,7 +102,7 @@
handlerChain = jaxrpcHandlerChain;
else if (type == HandlerType.POST)
handlerChain = postHandlerChain;
-
+
if (handlerChain != null)
status = handlerChain.handleRequest(msgContext);
@@ -104,7 +112,7 @@
public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
{
SOAPMessageContextJAXRPC msgContext = (SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
-
+
HandlerChain handlerChain = null;
if (type == HandlerType.PRE)
handlerChain = preHandlerChain;
@@ -112,10 +120,10 @@
handlerChain = jaxrpcHandlerChain;
else if (type == HandlerType.POST)
handlerChain = postHandlerChain;
-
+
boolean status = (handlerChain != null ? handlerChain.handleResponse(msgContext) : true);
- if(type == HandlerType.ENDPOINT)
+ if (type == HandlerType.ENDPOINT)
XOPContext.visitAndRestoreXOPData();
return status;
@@ -132,10 +140,10 @@
handlerChain = jaxrpcHandlerChain;
else if (type == HandlerType.POST)
handlerChain = postHandlerChain;
-
+
boolean status = (handlerChain != null ? handlerChain.handleFault(msgContext) : true);
- if(type == HandlerType.ENDPOINT)
+ if (type == HandlerType.ENDPOINT)
XOPContext.visitAndRestoreXOPData();
return status;
@@ -164,16 +172,17 @@
{
hConfig.put(param.getParamName(), param.getParamValue());
}
-
+
Set<QName> headers = jaxrpcMetaData.getSoapHeaders();
QName[] headerArr = new QName[headers.size()];
headers.toArray(headerArr);
-
+
Class hClass = jaxrpcMetaData.getHandlerClass();
hConfig.put(HandlerType.class.getName(), jaxrpcMetaData.getHandlerType());
HandlerInfo info = new HandlerInfo(hClass, hConfig, headerArr);
- if(log.isDebugEnabled()) log.debug("Adding server side handler to service '" + sepMetaData.getPortName() + "': " + info);
+ if (log.isDebugEnabled())
+ log.debug("Adding server side handler to service '" + sepMetaData.getPortName() + "': " + info);
hInfos.add(info);
}
@@ -182,7 +191,8 @@
private void initHandlerChain(ServerEndpointMetaData sepMetaData, List<HandlerInfo> hInfos, Set<String> handlerRoles, HandlerType type)
{
- if(log.isDebugEnabled()) log.debug("Init handler chain with [" + hInfos.size() + "] handlers");
+ if (log.isDebugEnabled())
+ log.debug("Init handler chain with [" + hInfos.size() + "] handlers");
ServerHandlerChain handlerChain = new ServerHandlerChain(hInfos, handlerRoles, type);
if (type == HandlerType.PRE)
@@ -200,7 +210,7 @@
handlerChain.pullHeaders(headers);
Collections.addAll(roles, handlerChain.getRoles());
}
-
+
public Set<String> getRoles()
{
return roles;
@@ -210,7 +220,7 @@
{
return headers;
}
-
+
public void update(Observable observable, Object object)
{
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -171,28 +171,6 @@
return doNext;
}
- private int getFirstHandler()
- {
- int index;
- if (falseIndex == -1)
- {
- index = (isOutbound ? 0 : handlers.size() - 1);
- }
- else
- {
- index = (isOutbound ? falseIndex - 1 : falseIndex + 1);
- }
- return index;
- }
-
- private int getNextIndex(int prevIndex)
- {
- int nextIndex = (isOutbound ? prevIndex + 1 : prevIndex - 1);
- if (nextIndex >= handlers.size())
- nextIndex = -1;
- return nextIndex;
- }
-
public boolean handleFault(MessageContext msgContext, Exception ex)
{
isOutbound = (Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
@@ -228,6 +206,7 @@
msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
int index = getFirstHandler();
+
Handler currHandler = null;
try
{
@@ -268,6 +247,28 @@
return doNext;
}
+ private int getFirstHandler()
+ {
+ int index;
+ if (falseIndex == -1)
+ {
+ index = (isOutbound ? 0 : handlers.size() - 1);
+ }
+ else
+ {
+ index = getNextIndex(falseIndex);
+ }
+ return index;
+ }
+
+ private int getNextIndex(int prevIndex)
+ {
+ int nextIndex = (isOutbound ? prevIndex + 1 : prevIndex - 1);
+ if (nextIndex >= handlers.size())
+ nextIndex = -1;
+ return nextIndex;
+ }
+
// 4.14 Conformance (Exceptions During Handler Processing): Exceptions thrown during handler processing on
// the client MUST be passed on to the application. If the exception in question is a subclass of WebService-
// Exception then an implementation MUST rethrow it as-is, without any additional wrapping, otherwise it
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -61,6 +61,14 @@
sepMetaData.registerConfigObserver(this);
}
+ /**
+ * For JAXWS PRE/POST are defined in the context of an outbound message
+ */
+ protected HandlerType[] getHandlerTypeOrder()
+ {
+ return new HandlerType[] { HandlerType.POST, HandlerType.ENDPOINT, HandlerType.PRE };
+ }
+
public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
{
log.debug("callRequestHandlerChain: " + type);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -140,7 +140,11 @@
// The direction of the message
DirectionHolder direction = new DirectionHolder(Direction.InBound);
-
+
+ // Get the order of pre/post handlerchains
+ HandlerType[] handlerType = delegate.getHandlerTypeOrder();
+ HandlerType[] faultType = delegate.getHandlerTypeOrder();
+
try
{
boolean oneway = false;
@@ -149,8 +153,8 @@
CommonBinding binding = bindingProvider.getCommonBinding();
binding.setHeaderSource(delegate);
- // call the handler chain
- boolean handlersPass = callRequestHandlerChain(sepMetaData, HandlerType.PRE);
+ // call the request handler chain
+ boolean handlersPass = callRequestHandlerChain(sepMetaData, handlerType[0]);
// Unbind the request message
if (handlersPass)
@@ -173,13 +177,13 @@
*/
if (binding instanceof CommonSOAPBinding)
((CommonSOAPBinding)binding).checkMustUnderstand(opMetaData);
-
+
// Unbind the request message
epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
}
- handlersPass = handlersPass && callRequestHandlerChain(sepMetaData, HandlerType.ENDPOINT);
- handlersPass = handlersPass && callRequestHandlerChain(sepMetaData, HandlerType.POST);
+ handlersPass = handlersPass && callRequestHandlerChain(sepMetaData, handlerType[1]);
+ handlersPass = handlersPass && callRequestHandlerChain(sepMetaData, handlerType[2]);
if (handlersPass)
{
@@ -219,12 +223,15 @@
msgContext.setSOAPMessage(resMessage);
}
- // call the handler chain
+ // call the response handler chain, removing the fault type entry will not call handleFault for that chain
if (oneway == false)
{
- handlersPass = callResponseHandlerChain(sepMetaData, HandlerType.POST);
- handlersPass = handlersPass && callResponseHandlerChain(sepMetaData, HandlerType.ENDPOINT);
- handlersPass = handlersPass && callResponseHandlerChain(sepMetaData, HandlerType.PRE);
+ handlersPass = callResponseHandlerChain(sepMetaData, handlerType[2]);
+ faultType[2] = null;
+ handlersPass = handlersPass && callResponseHandlerChain(sepMetaData, handlerType[1]);
+ faultType[1] = null;
+ handlersPass = handlersPass && callResponseHandlerChain(sepMetaData, handlerType[0]);
+ faultType[0] = null;
}
SOAPMessage resMessage = msgContext.getSOAPMessage();
@@ -240,10 +247,14 @@
CommonBinding binding = bindingProvider.getCommonBinding();
binding.bindFaultMessage(ex);
- // call the handler chain
- boolean handlersPass = callFaultHandlerChain(sepMetaData, HandlerType.POST, ex);
- handlersPass = handlersPass && callFaultHandlerChain(sepMetaData, HandlerType.ENDPOINT, ex);
- handlersPass = handlersPass && callFaultHandlerChain(sepMetaData, HandlerType.PRE, ex);
+ // call the fault handler chain
+ boolean handlersPass = true;
+ if (faultType[2] != null)
+ handlersPass = handlersPass && callFaultHandlerChain(sepMetaData, faultType[2], ex);
+ if (faultType[1] != null)
+ handlersPass = handlersPass && callFaultHandlerChain(sepMetaData, faultType[1], ex);
+ if (faultType[0] != null)
+ handlersPass = handlersPass && callFaultHandlerChain(sepMetaData, faultType[0], ex);
}
catch (RuntimeException subEx)
{
@@ -254,9 +265,9 @@
}
finally
{
- closeHandlerChain(sepMetaData, HandlerType.POST);
- closeHandlerChain(sepMetaData, HandlerType.ENDPOINT);
- closeHandlerChain(sepMetaData, HandlerType.PRE);
+ closeHandlerChain(sepMetaData, handlerType[2]);
+ closeHandlerChain(sepMetaData, handlerType[1]);
+ closeHandlerChain(sepMetaData, handlerType[0]);
destroyServiceEndpointInstance(seInstance);
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerHandlerDelegate.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerHandlerDelegate.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerHandlerDelegate.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -41,6 +41,9 @@
this.sepMetaData = sepMetaData;
}
+ // Get the order of pre/post handlerchains
+ protected abstract HandlerType[] getHandlerTypeOrder();
+
public abstract boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type);
public abstract boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type);
Modified: trunk/jbossws-core/src/resources/jbossws.sar/META-INF/standard-jaxws-endpoint-config.xml
===================================================================
--- trunk/jbossws-core/src/resources/jbossws.sar/META-INF/standard-jaxws-endpoint-config.xml 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-core/src/resources/jbossws.sar/META-INF/standard-jaxws-endpoint-config.xml 2007-03-16 19:18:35 UTC (rev 2631)
@@ -11,7 +11,7 @@
<endpoint-config>
<config-name>Standard WSAddressing Endpoint</config-name>
- <pre-handler-chains>
+ <post-handler-chains>
<javaee:handler-chain>
<javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
<javaee:handler>
@@ -19,12 +19,12 @@
<javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
- </pre-handler-chains>
+ </post-handler-chains>
</endpoint-config>
<endpoint-config>
<config-name>Standard WSSecurity Endpoint</config-name>
- <pre-handler-chains>
+ <post-handler-chains>
<javaee:handler-chain>
<javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
<javaee:handler>
@@ -32,7 +32,7 @@
<javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
- </pre-handler-chains>
+ </post-handler-chains>
</endpoint-config>
</jaxws-config>
Modified: trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-03-16 19:18:35 UTC (rev 2631)
@@ -128,22 +128,16 @@
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.class"/>
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/TrackerEndpointBean.class"/>
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.class"/>
- <include name="org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.class"/>
+ <include name="org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler*.class"/>
+ <include name="org/jboss/test/ws/jaxws/handlerlifecycle/PreServerHandler*.class"/>
+ <include name="org/jboss/test/ws/jaxws/handlerlifecycle/PostServerHandler*.class"/>
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/HandlerTracker.class"/>
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-server-handlers.xml"/>
</classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/handlerlifecycle/WEB-INF">
+ <include name="jaxws-endpoint-config.xml"/>
+ </webinf>
</war>
- <war warfile="${tests.output.dir}/libs/jaxws-handlerlifecycle-client.war" webxml="${tests.output.dir}/resources/jaxws/handlerlifecycle/ServletClient/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/classes">
- <include name="org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpoint.class"/>
- <include name="org/jboss/test/ws/jaxws/handlerlifecycle/TrackerEndpoint.class"/>
- <include name="org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.class"/>
- <include name="org/jboss/test/ws/jaxws/handlerlifecycle/HandlerTracker.class"/>
- <include name="org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.class"/>
- <include name="org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.class"/>
- <include name="org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-client-handlers.xml"/>
- </classes>
- </war>
<!-- jaxws-handlerscope -->
<war warfile="${tests.output.dir}/libs/jaxws-handlerscope.war" webxml="${tests.output.dir}/resources/jaxws/handlerscope/WEB-INF/web.xml">
Deleted: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
-
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.MessageContext.Scope;
-
-public class ClientHandler extends LifecycleHandler
-{
- @Override
- public boolean handleOutbound(MessageContext msgContext)
- {
- // set a handler prop
- msgContext.put("client-handler-prop", Boolean.TRUE);
-
- if (msgContext.get("client-req-prop") != Boolean.TRUE)
- throw new IllegalStateException("Cannot find client-req-prop");
-
- return super.handleOutbound(msgContext);
- }
-
- @Override
- public boolean handleInbound(MessageContext msgContext)
- {
- if (msgContext.get("client-handler-prop") != Boolean.TRUE)
- throw new IllegalStateException("Cannot find client-handler-prop");
-
- // set a app prop
- msgContext.put("client-res-prop", Boolean.TRUE);
- msgContext.setScope("client-res-prop", Scope.APPLICATION);
-
- return super.handleInbound(msgContext);
- }
-}
Copied: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler1.java (from rev 2628, trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java)
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler1.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler1.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
+
+public class ClientHandler1 extends LifecycleHandler
+{
+ protected boolean handleOutboundMessage(MessageContext msgContext)
+ {
+ boolean doNext = true;
+ if (doNext && getTestMethod(msgContext).startsWith("testPropertyScoping"))
+ {
+ // set a handler prop
+ msgContext.put("client-handler-prop", Boolean.TRUE);
+
+ if (msgContext.get("client-req-prop") != Boolean.TRUE)
+ throw new IllegalStateException("Cannot find client-req-prop");
+ }
+ return doNext;
+ }
+
+ protected boolean handleInboundMessage(MessageContext msgContext)
+ {
+ boolean doNext = true;
+ if (doNext && getTestMethod(msgContext).startsWith("testPropertyScoping"))
+ {
+ if (msgContext.get("client-handler-prop") != Boolean.TRUE)
+ throw new IllegalStateException("Cannot find client-handler-prop");
+
+ // set a app prop
+ msgContext.put("client-res-prop", Boolean.TRUE);
+ msgContext.setScope("client-res-prop", Scope.APPLICATION);
+ }
+ return doNext;
+ }
+}
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler2.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler2.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler2.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+
+
+public class ClientHandler2 extends LifecycleHandler
+{
+ protected boolean handleOutboundMessage(MessageContext msgContext)
+ {
+ boolean doNext = true;
+ if (getTestMethod(msgContext).startsWith("testClientOutboundHandleMessageFalse"))
+ {
+ doNext = false;
+ }
+ else if (getTestMethod(msgContext).startsWith("testClientOutboundHandleMessageThrowsRuntimeException"))
+ {
+ throw new WebServiceException("ErrorIn" + this);
+ }
+ return doNext;
+ }
+
+ protected boolean handleInboundMessage(MessageContext msgContext)
+ {
+ boolean doNext = true;
+ if (getTestMethod(msgContext).startsWith("testClientInboundHandleMessageFalse"))
+ {
+ doNext = false;
+ }
+ else if (getTestMethod(msgContext).startsWith("testClientInboundHandleMessageThrowsRuntimeException"))
+ {
+ throw new WebServiceException("ErrorIn" + this);
+ }
+ return doNext;
+ }
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler2.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler3.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler3.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler3.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+
+
+public class ClientHandler3 extends LifecycleHandler
+{
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -24,12 +24,14 @@
// $Id$
import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
-import javax.xml.ws.Binding;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
import junit.framework.Test;
@@ -46,7 +48,7 @@
{
private static SOAPEndpoint port;
private static TrackerEndpoint trackerPort;
-
+
public static Test suite()
{
return JBossWSTestSetup.newTestSetup(HandlerLifecycleClientTestCase.class, "jaxws-handlerlifecycle.war");
@@ -54,6 +56,14 @@
public void setUp() throws Exception
{
+ if (trackerPort == null)
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/tracker?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "TrackerEndpointService");
+ Service service = Service.create(wsdlURL, serviceName);
+ trackerPort = (TrackerEndpoint)service.getPort(TrackerEndpoint.class);
+ }
+
if (port == null)
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/soap?wsdl");
@@ -61,44 +71,440 @@
Service service = Service.create(wsdlURL, serviceName);
port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
}
- if (trackerPort == null)
+ }
+
+ protected void tearDown() throws Exception
+ {
+ HandlerTracker.clearListMessages();
+ trackerPort.clearListMessages();
+ assertEquals("[]", HandlerTracker.getListMessages());
+ assertEquals("[]", trackerPort.getListMessages());
+ }
+
+ /**
+ * All handlers return true
+ */
+ public void testHandleMessageTrue() throws Exception
+ {
+ System.out.println("FIXME: [JBWS-1579] @EndpointConfig ignored on SEI");
+
+ String testResponse = port.runTest(getName());
+
+ String trackerMessages = HandlerTracker.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:PostConstruct");
+ expMessages.add("ClientHandler2:PostConstruct");
+ expMessages.add("ClientHandler3:PostConstruct");
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:InBound");
+ expMessages.add("ClientHandler2:Message:InBound");
+ expMessages.add("ClientHandler1:Message:InBound");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = trackerPort.getListMessages();
+ expMessages = new ArrayList<String>();
+
+ // Handler construction
+ expMessages.add("PreServerHandler1:PostConstruct");
+ expMessages.add("PreServerHandler2:PostConstruct");
+ expMessages.add("ServerHandler1:PostConstruct");
+ expMessages.add("ServerHandler2:PostConstruct");
+ expMessages.add("ServerHandler3:PostConstruct");
+ expMessages.add("PostServerHandler1:PostConstruct");
+ expMessages.add("PostServerHandler2:PostConstruct");
+
+ // Inbound server message
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound");
+ expMessages.add("ServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler2:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:InBound");
+
+ // Pre/Post handler are defined in the context of outbound
+ expMessages.add("PreServerHandler1:Message:OutBound");
+ expMessages.add("PreServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler1:Message:OutBound");
+ expMessages.add("ServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler3:Message:OutBound");
+ expMessages.add("PostServerHandler1:Message:OutBound");
+ expMessages.add("PostServerHandler2:Message:OutBound");
+
+ // Handler closing
+ expMessages.add("PreServerHandler1:Close");
+ expMessages.add("PreServerHandler2:Close");
+ expMessages.add("ServerHandler1:Close");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertEquals(getName() + "Response", testResponse);
+ }
+
+ /**
+ * ClientHandler2 returns false on outbound
+ */
+ public void testClientOutboundHandleMessageFalse() throws Exception
+ {
+ String testResponse = port.runTest(getName());
+
+ String trackerMessages = HandlerTracker.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound:false");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = trackerPort.getListMessages();
+ expMessages = new ArrayList<String>();
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertNull(testResponse);
+ }
+
+ /**
+ * ClientHandler2 throws a RuntimeException on outbound
+ */
+ public void testClientOutboundHandleMessageThrowsRuntimeException() throws Exception
+ {
+ String testResponse;
+ try
{
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/tracker?wsdl");
- QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "TrackerEndpointService");
- Service service = Service.create(wsdlURL, serviceName);
- trackerPort = (TrackerEndpoint)service.getPort(TrackerEndpoint.class);
+ testResponse = port.runTest(getName());
+ fail("RuntimeException expected, but got: " + testResponse);
}
+ catch (WebServiceException ex)
+ {
+ testResponse = ex.getMessage();
+ }
+
+ String trackerMessages = HandlerTracker.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound:ErrorInClientHandler2");
+ expMessages.add("ClientHandler1:Fault:InBound");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = trackerPort.getListMessages();
+ expMessages = new ArrayList<String>();
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertEquals("ErrorInClientHandler2", testResponse);
}
-
- public void testClientAccess() throws Exception
+
+ /**
+ * ServerHandler2 returns false on inbound
+ */
+ public void testServerInboundHandleMessageFalse() throws Exception
{
- Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
- Map<String, Object> resContext = ((BindingProvider)port).getResponseContext();
- reqContext.put("client-req-prop", Boolean.TRUE);
+ String testResponse = port.runTest(getName());
+
+ String trackerMessages = trackerPort.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound:false");
+ expMessages.add("ServerHandler3:Message:OutBound");
+ expMessages.add("PostServerHandler1:Message:OutBound");
+ expMessages.add("PostServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = HandlerTracker.getListMessages();
+ expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:InBound");
+ expMessages.add("ClientHandler2:Message:InBound");
+ expMessages.add("ClientHandler1:Message:InBound");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
- String retStr = port.echo("hello");
- assertEquals("hello", retStr);
+ assertEquals("testServerHandler2Response", testResponse);
+ }
+
+ /**
+ * ServerHandler2 trows a RuntimeException on inbound
+ */
+ public void testServerInboundHandleMessageThrowsRuntimeException() throws Exception
+ {
+ String testResponse;
+ try
+ {
+ testResponse = port.runTest(getName());
+ fail("RuntimeException expected, but got: " + testResponse);
+ }
+ catch (WebServiceException ex)
+ {
+ testResponse = ex.getMessage();
+ }
+
+ String trackerMessages = trackerPort.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound:ErrorInServerHandler2");
+ expMessages.add("ServerHandler3:Fault:OutBound");
+ expMessages.add("PostServerHandler1:Fault:OutBound");
+ expMessages.add("PostServerHandler2:Fault:OutBound");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = HandlerTracker.getListMessages();
+ expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Fault:InBound");
+ expMessages.add("ClientHandler2:Fault:InBound");
+ expMessages.add("ClientHandler1:Fault:InBound");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
- assertNull(resContext.get("client-handler-prop"));
- assertEquals(Boolean.TRUE, resContext.get("client-res-prop"));
+ assertEquals("ErrorInServerHandler2", testResponse);
}
-
- public void testTrackerMessages() throws Exception
+
+ /**
+ * ServerHandler2 returns false on outbound
+ */
+ public void testServerOutboundHandleMessageFalse() throws Exception
{
- String retStr = HandlerTracker.getListMessages();
- assertEquals("[ClientHandler:PostConstruct, ClientHandler:OutBound, ClientHandler:InBound, ClientHandler:Close]", retStr);
+ String testResponse = port.runTest(getName());
+
+ String trackerMessages = trackerPort.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound");
+ expMessages.add("ServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler2:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:OutBound");
+ expMessages.add("PreServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler1:Message:OutBound");
+ expMessages.add("ServerHandler2:Message:OutBound:false");
+ expMessages.add("PreServerHandler1:Close");
+ expMessages.add("PreServerHandler2:Close");
+ expMessages.add("ServerHandler1:Close");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = HandlerTracker.getListMessages();
+ expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:InBound");
+ expMessages.add("ClientHandler2:Message:InBound");
+ expMessages.add("ClientHandler1:Message:InBound");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
- retStr = trackerPort.getListMessages();
- assertEquals("[ServerHandler:PostConstruct, ServerHandler:InBound, ServerHandler:OutBound, ServerHandler:Close]", retStr);
-
+ assertEquals(getName() + "Response", testResponse);
}
- public void testClearTrackerData() throws Exception
+ /**
+ * ServerHandler2 trows a RuntimeException on outbound
+ */
+ public void testServerOutboundHandleMessageThrowsRuntimeException() throws Exception
{
- HandlerTracker.clearListMessages();
- trackerPort.clearListMessages();
+ String testResponse;
+ try
+ {
+ testResponse = port.runTest(getName());
+ fail("RuntimeException expected, but got: " + testResponse);
+ }
+ catch (WebServiceException ex)
+ {
+ testResponse = ex.getMessage();
+ }
+
+ String trackerMessages = trackerPort.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound");
+ expMessages.add("ServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler2:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:OutBound");
+ expMessages.add("PreServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler1:Message:OutBound");
+ expMessages.add("ServerHandler2:Message:OutBound:ErrorInServerHandler2");
+ expMessages.add("ServerHandler3:Fault:OutBound");
+ expMessages.add("PostServerHandler1:Fault:OutBound");
+ expMessages.add("PostServerHandler2:Fault:OutBound");
+ expMessages.add("PreServerHandler1:Close");
+ expMessages.add("PreServerHandler2:Close");
+ expMessages.add("ServerHandler1:Close");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = HandlerTracker.getListMessages();
+ expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Fault:InBound");
+ expMessages.add("ClientHandler2:Fault:InBound");
+ expMessages.add("ClientHandler1:Fault:InBound");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
- assertEquals("[]", HandlerTracker.getListMessages());
- assertEquals("[]", trackerPort.getListMessages());
+ assertEquals("ErrorInServerHandler2", testResponse);
}
+
+ /**
+ * ClientHandler2 returns false on inbound
+ */
+ public void testClientInboundHandleMessageFalse() throws Exception
+ {
+ String testResponse = port.runTest(getName());
+
+ String trackerMessages = HandlerTracker.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:InBound");
+ expMessages.add("ClientHandler2:Message:InBound:false");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = trackerPort.getListMessages();
+ expMessages = new ArrayList<String>();
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound");
+ expMessages.add("ServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler2:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:OutBound");
+ expMessages.add("PreServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler1:Message:OutBound");
+ expMessages.add("ServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler3:Message:OutBound");
+ expMessages.add("PostServerHandler1:Message:OutBound");
+ expMessages.add("PostServerHandler2:Message:OutBound");
+ expMessages.add("PreServerHandler1:Close");
+ expMessages.add("PreServerHandler2:Close");
+ expMessages.add("ServerHandler1:Close");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertEquals(getName() + "Response", testResponse);
+ }
+
+ /**
+ * ClientHandler2 throws a RuntimeException on intbound
+ */
+ public void testClientInboundHandleMessageThrowsRuntimeException() throws Exception
+ {
+ String testResponse;
+ try
+ {
+ testResponse = port.runTest(getName());
+ fail("RuntimeException expected, but got: " + testResponse);
+ }
+ catch (WebServiceException ex)
+ {
+ testResponse = ex.getMessage();
+ }
+
+ String trackerMessages = HandlerTracker.getListMessages();
+ List<String> expMessages = new ArrayList<String>();
+ expMessages.add("ClientHandler1:Message:OutBound");
+ expMessages.add("ClientHandler2:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("ClientHandler3:Message:InBound");
+ expMessages.add("ClientHandler2:Message:InBound:ErrorInClientHandler2");
+ expMessages.add("ClientHandler1:Fault:InBound");
+ expMessages.add("ClientHandler3:Close");
+ expMessages.add("ClientHandler2:Close");
+ expMessages.add("ClientHandler1:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ trackerMessages = trackerPort.getListMessages();
+ expMessages = new ArrayList<String>();
+ expMessages.add("PostServerHandler2:Message:InBound");
+ expMessages.add("PostServerHandler1:Message:InBound");
+ expMessages.add("ServerHandler3:Message:InBound");
+ expMessages.add("ServerHandler2:Message:InBound");
+ expMessages.add("ServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler2:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:InBound");
+ expMessages.add("PreServerHandler1:Message:OutBound");
+ expMessages.add("PreServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler1:Message:OutBound");
+ expMessages.add("ServerHandler2:Message:OutBound");
+ expMessages.add("ServerHandler3:Message:OutBound");
+ expMessages.add("PostServerHandler1:Message:OutBound");
+ expMessages.add("PostServerHandler2:Message:OutBound");
+ expMessages.add("PreServerHandler1:Close");
+ expMessages.add("PreServerHandler2:Close");
+ expMessages.add("ServerHandler1:Close");
+ expMessages.add("ServerHandler2:Close");
+ expMessages.add("ServerHandler3:Close");
+ expMessages.add("PostServerHandler1:Close");
+ expMessages.add("PostServerHandler2:Close");
+ assertEquals(expMessages.toString(), trackerMessages);
+
+ assertEquals("ErrorInClientHandler2", testResponse);
+ }
+
+ public void testPropertyScoping() throws Exception
+ {
+ Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
+ Map<String, Object> resContext = ((BindingProvider)port).getResponseContext();
+ reqContext.put("client-req-prop", Boolean.TRUE);
+
+ String retStr = port.runTest(getName());
+ assertEquals(getName() + "Response", retStr);
+
+ assertNull(resContext.get("client-handler-prop"));
+ assertEquals(Boolean.TRUE, resContext.get("client-res-prop"));
+ }
}
Deleted: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleServletTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleServletTestCase.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleServletTestCase.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
-
-// $Id$
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import junit.framework.Test;
-
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.JBossWSTestSetup;
-
-/**
- * Test JAXWS handler lifecycle
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-MAr-2007
- */
-public class HandlerLifecycleServletTestCase extends JBossWSTest
-{
- public static Test suite()
- {
- return JBossWSTestSetup.newTestSetup(HandlerLifecycleServletTestCase.class, "jaxws-handlerlifecycle.war, jaxws-handlerlifecycle-client.war");
- }
-
- public void testClientAccess() throws Exception
- {
- invokeServletClient(getName());
- }
-
- public void testTrackerMessages() throws Exception
- {
- invokeServletClient(getName());
- }
-
- public void testClearTrackerData() throws Exception
- {
- invokeServletClient(getName());
- }
-
- private void invokeServletClient(String testMethod) throws MalformedURLException, IOException
- {
- URL servletURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle-client?method=" + testMethod);
- InputStream is = servletURL.openStream();
- InputStreamReader isr = new InputStreamReader(is);
- BufferedReader br = new BufferedReader(isr);
- String line = br.readLine();
- assertEquals("pass", line);
- }
-}
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerTracker.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerTracker.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerTracker.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -44,41 +44,48 @@
public static void reportHandlePostConstruct(Handler handler)
{
String msg = handler + ":PostConstruct";
- log.info(msg + " to vector: " + System.identityHashCode(messages));
+ log.debug(msg + " to vector: " + System.identityHashCode(messages));
messages.add(msg);
}
public static void reportHandlePreDestroy(Handler handler)
{
String msg = handler + ":PreDestroy";
- log.info(msg + " to vector " + System.identityHashCode(messages));
+ log.debug(msg + " to vector " + System.identityHashCode(messages));
messages.add(msg);
}
public static void reportHandleMessage(Handler handler, String direction)
{
- String msg = handler + ":" + direction;
- log.info(msg + " to vector: " + System.identityHashCode(messages));
+ String msg = handler + ":Message:" + direction;
+ log.debug(msg + " to vector: " + System.identityHashCode(messages));
messages.add(msg);
}
+ public static void reportHandleFault(Handler handler, String direction)
+ {
+ String msg = handler + ":Fault:" + direction;
+ log.debug(msg + " to vector: " + System.identityHashCode(messages));
+ messages.add(msg);
+ }
+
public static void reportHandleClose(Handler handler)
{
String msg = handler + ":Close";
- log.info(msg + " to vector: " + System.identityHashCode(messages));
+ log.debug(msg + " to vector: " + System.identityHashCode(messages));
messages.add(msg);
}
public static String getListMessages()
{
- log.info("getListMessages from vector: " + System.identityHashCode(messages));
- log.info(messages.toString());
+ log.debug("getListMessages from vector: " + System.identityHashCode(messages));
+ log.debug(messages.toString());
return messages.toString();
}
public static void clearListMessages()
{
- log.info("clearListMessages from vector: " + System.identityHashCode(messages));
+ log.debug("clearListMessages from vector: " + System.identityHashCode(messages));
messages.clear();
}
}
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -21,36 +21,33 @@
*/
package org.jboss.test.ws.jaxws.handlerlifecycle;
+import java.util.HashSet;
+import java.util.Set;
+
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
-public abstract class LifecycleHandler extends GenericSOAPHandler
+public abstract class LifecycleHandler implements SOAPHandler
{
private static Logger log = Logger.getLogger(LifecycleHandler.class);
public LifecycleHandler()
{
- log.info("new LifecycleHandler");
+ log.debug("new " + this);
}
- @Override
- public boolean handleOutbound(MessageContext msgContext)
+ public Set getHeaders()
{
- HandlerTracker.reportHandleMessage(this, "OutBound");
- return true;
+ return new HashSet();
}
- @Override
- public boolean handleInbound(MessageContext msgContext)
- {
- HandlerTracker.reportHandleMessage(this, "InBound");
- return true;
- }
-
@PostConstruct
public void postConstruct()
{
@@ -63,8 +60,159 @@
HandlerTracker.reportHandlePreDestroy(this);
}
+ public boolean handleMessage(MessageContext msgContext)
+ {
+ boolean doNext = isOutbound(msgContext) ? handleOutboundMessageInternal(msgContext) : handleInboundMessageInternal(msgContext);
+ return doNext;
+ }
+
+ private boolean handleOutboundMessageInternal(MessageContext msgContext)
+ {
+ String trackerMessage = "OutBound";
+
+ boolean doNext;
+ try
+ {
+ doNext = handleOutboundMessage(msgContext);
+ if (doNext == false)
+ trackerMessage += ":false";
+
+ HandlerTracker.reportHandleMessage(this, trackerMessage);
+ }
+ catch (RuntimeException rte)
+ {
+ HandlerTracker.reportHandleMessage(this, trackerMessage + ":" + rte.getMessage());
+ throw rte;
+ }
+ return doNext;
+ }
+
+ private boolean handleInboundMessageInternal(MessageContext msgContext)
+ {
+ String trackerMessage = "InBound";
+
+ boolean doNext;
+ try
+ {
+ doNext = handleInboundMessage(msgContext);
+ if (doNext == false)
+ trackerMessage += ":false";
+
+ HandlerTracker.reportHandleMessage(this, trackerMessage);
+ }
+ catch (RuntimeException rte)
+ {
+ HandlerTracker.reportHandleMessage(this, trackerMessage + ":" + rte.getMessage());
+ throw rte;
+ }
+ return doNext;
+ }
+
+ protected boolean handleOutboundMessage(MessageContext msgContext)
+ {
+ return true;
+ }
+
+ protected boolean handleInboundMessage(MessageContext msgContext)
+ {
+ return true;
+ }
+
+ public boolean handleFault(MessageContext msgContext)
+ {
+ boolean doNext = isOutbound(msgContext) ? handleOutboundFaultInternal(msgContext) : handleInboundFaultInternal(msgContext);
+ return doNext;
+ }
+
+ private boolean handleOutboundFaultInternal(MessageContext msgContext)
+ {
+ String trackerMessage = "OutBound";
+
+ boolean doNext;
+ try
+ {
+ doNext = handleOutboundFault(msgContext);
+ if (doNext == false)
+ trackerMessage += ":false";
+
+ HandlerTracker.reportHandleFault(this, trackerMessage);
+ }
+ catch (RuntimeException rte)
+ {
+ HandlerTracker.reportHandleFault(this, trackerMessage + ":" + rte.getMessage());
+ throw rte;
+ }
+ return doNext;
+ }
+
+ private boolean handleInboundFaultInternal(MessageContext msgContext)
+ {
+ String trackerMessage = "InBound";
+
+ boolean doNext;
+ try
+ {
+ doNext = handleInboundFault(msgContext);
+ if (doNext == false)
+ trackerMessage += ":false";
+
+ HandlerTracker.reportHandleFault(this, trackerMessage);
+ }
+ catch (RuntimeException rte)
+ {
+ HandlerTracker.reportHandleFault(this, trackerMessage + ":" + rte.getMessage());
+ throw rte;
+ }
+ return doNext;
+ }
+
+ protected boolean handleOutboundFault(MessageContext msgContext)
+ {
+ return true;
+ }
+
+ protected boolean handleInboundFault(MessageContext msgContext)
+ {
+ return true;
+ }
+
public void close(MessageContext messageContext)
{
HandlerTracker.reportHandleClose(this);
}
+
+ protected String getTestMethod(MessageContext msgContext)
+ {
+ String testMethod;
+ try
+ {
+ SOAPElement soapElement = (SOAPElement)((SOAPMessageContext)msgContext).getMessage().getSOAPBody().getChildElements().next();
+ soapElement = (SOAPElement)soapElement.getChildElements().next();
+ testMethod = soapElement.getValue();
+ }
+ catch (SOAPException e)
+ {
+ throw new IllegalStateException("Cannot obtain test method");
+ }
+
+ if (testMethod.startsWith("test") == false)
+ throw new IllegalStateException("Cannot find test method: " + testMethod);
+
+ return testMethod;
+ }
+
+ protected Boolean isOutbound(MessageContext msgContext)
+ {
+ Boolean outbound = (Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+ if (outbound == null)
+ throw new IllegalStateException("Cannot find property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
+ return outbound;
+ }
+
+ public String toString()
+ {
+ String handlerName = getClass().getName();
+ return handlerName.substring(handlerName.lastIndexOf(".") + 1);
+ }
}
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostClientHandler1.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostClientHandler1.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostClientHandler1.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+
+public class PostClientHandler1 extends LifecycleHandler
+{
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostClientHandler1.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostClientHandler2.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostClientHandler2.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostClientHandler2.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+
+public class PostClientHandler2 extends LifecycleHandler
+{
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostClientHandler2.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostServerHandler1.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostServerHandler1.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostServerHandler1.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+
+public class PostServerHandler1 extends LifecycleHandler
+{
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostServerHandler1.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostServerHandler2.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostServerHandler2.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostServerHandler2.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+
+public class PostServerHandler2 extends LifecycleHandler
+{
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PostServerHandler2.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreClientHandler1.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreClientHandler1.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreClientHandler1.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+
+public class PreClientHandler1 extends LifecycleHandler
+{
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreClientHandler1.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreClientHandler2.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreClientHandler2.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreClientHandler2.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+
+public class PreClientHandler2 extends LifecycleHandler
+{
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreClientHandler2.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreServerHandler1.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreServerHandler1.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreServerHandler1.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+
+public class PreServerHandler1 extends LifecycleHandler
+{
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreServerHandler1.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreServerHandler2.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreServerHandler2.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreServerHandler2.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+
+public class PreServerHandler2 extends LifecycleHandler
+{
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/PreServerHandler2.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpoint.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpoint.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpoint.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -27,10 +27,13 @@
import javax.jws.WebMethod;
import javax.jws.WebService;
+import org.jboss.ws.annotation.EndpointConfig;
+
@WebService
@HandlerChain(file = "jaxws-client-handlers.xml")
+@EndpointConfig(configName = "Custom Client Config", configFile = "META-INF/jaxws-client-config.xml")
public interface SOAPEndpoint
{
@WebMethod
- public String echo(String msg);
+ public String runTest(String testName);
}
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -23,6 +23,9 @@
// $Id$
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
import javax.annotation.Resource;
import javax.jws.HandlerChain;
import javax.jws.WebMethod;
@@ -33,10 +36,13 @@
import javax.xml.ws.handler.MessageContext;
import org.jboss.logging.Logger;
+import org.jboss.ws.annotation.EndpointConfig;
@WebService(name = "SOAPEndpoint", targetNamespace = "http://org.jboss.ws/jaxws/handlerlifecycle")
@HandlerChain(file = "jaxws-server-handlers.xml")
@SOAPBinding(style = Style.RPC)
+
+@EndpointConfig(configName = "Custom Server Config", configFile = "WEB-INF/jaxws-endpoint-config.xml")
public class SOAPEndpointBean
{
private static Logger log = Logger.getLogger(SOAPEndpointBean.class);
@@ -45,17 +51,38 @@
public WebServiceContext wsContext;
@WebMethod
- public String echo(String msg)
+ public String runTest(String testName)
{
- log.info("echo: " + msg);
+ log.info("runTest: " + testName);
+ try
+ {
+ Method method = getClass().getDeclaredMethod(testName, new Class[]{});
+ method.invoke(this, new Object[]{});
+ }
+ catch (NoSuchMethodException ex)
+ {
+ // ignore this
+ }
+ catch (InvocationTargetException ex)
+ {
+ throw new IllegalStateException("Cannot invoke test method: " + testName, ex.getTargetException());
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Cannot test method: " + testName);
+ }
+
+ return testName + "Response";
+ }
+
+ public void testPropertyScoping()
+ {
MessageContext msgContext = wsContext.getMessageContext();
if (msgContext.get("server-handler-prop") != null)
throw new IllegalStateException("Found server-handler-prop");
if (msgContext.get("server-app-prop") != Boolean.TRUE)
throw new IllegalStateException("Cannot find server-app-prop");
-
- return msg;
}
}
Deleted: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
-
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.MessageContext.Scope;
-
-public class ServerHandler extends LifecycleHandler
-{
- @Override
- public boolean handleInbound(MessageContext msgContext)
- {
- // set a handler prop
- msgContext.put("server-handler-prop", Boolean.TRUE);
-
- // set a app prop
- msgContext.put("server-app-prop", Boolean.TRUE);
- msgContext.setScope("server-app-prop", Scope.APPLICATION);
-
- return super.handleInbound(msgContext);
- }
-
- @Override
- public boolean handleOutbound(MessageContext msgContext)
- {
- if (msgContext.get("server-handler-prop") != Boolean.TRUE)
- throw new IllegalStateException("Cannot find server-handler-prop");
-
- if (msgContext.get("server-app-prop") != Boolean.TRUE)
- throw new IllegalStateException("Cannot find server-app-prop");
-
- return super.handleOutbound(msgContext);
- }
-}
Copied: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler1.java (from rev 2628, trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java)
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler1.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler1.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
+
+public class ServerHandler1 extends LifecycleHandler
+{
+ protected boolean handleOutboundMessage(MessageContext msgContext)
+ {
+ boolean doNext = true;
+ if (doNext && getTestMethod(msgContext).startsWith("testPropertyScoping"))
+ {
+ if (msgContext.get("server-handler-prop") != Boolean.TRUE)
+ throw new IllegalStateException("Cannot find server-handler-prop");
+
+ if (msgContext.get("server-app-prop") != Boolean.TRUE)
+ throw new IllegalStateException("Cannot find server-app-prop");
+ }
+ return doNext;
+ }
+
+ protected boolean handleInboundMessage(MessageContext msgContext)
+ {
+ boolean doNext = true;
+ if (doNext && getTestMethod(msgContext).startsWith("testPropertyScoping"))
+ {
+ // set a handler prop
+ msgContext.put("server-handler-prop", Boolean.TRUE);
+
+ // set a app prop
+ msgContext.put("server-app-prop", Boolean.TRUE);
+ msgContext.setScope("server-app-prop", Scope.APPLICATION);
+ }
+ return doNext;
+ }
+}
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler2.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler2.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler2.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+public class ServerHandler2 extends LifecycleHandler
+{
+ protected boolean handleInboundMessage(MessageContext msgContext)
+ {
+ boolean doNext = true;
+ if (getTestMethod(msgContext).startsWith("testServerInboundHandleMessageFalse"))
+ {
+ String resEnv =
+ "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ "<env:Body>" +
+ " <ns1:runTestResponse xmlns:ns1='http://org.jboss.ws/jaxws/handlerlifecycle'>" +
+ " <return xmlns=''>testServerHandler2Response</return>" +
+ " </ns1:runTestResponse>" +
+ " </env:Body>" +
+ "</env:Envelope>";
+
+ try
+ {
+ MessageFactory factory = MessageFactory.newInstance();
+ SOAPMessage resMessage = factory.createMessage(null, new ByteArrayInputStream(resEnv.getBytes()));
+ SOAPMessageContext soapContext = (SOAPMessageContext)msgContext;
+ soapContext.setMessage(resMessage);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Cannot attach response message");
+ }
+
+ doNext = false;
+ }
+ else if (getTestMethod(msgContext).startsWith("testServerInboundHandleMessageThrowsRuntimeException"))
+ {
+ throw new WebServiceException("ErrorIn" + this);
+ }
+ return doNext;
+ }
+
+ protected boolean handleOutboundMessage(MessageContext msgContext)
+ {
+ boolean doNext = true;
+ if (getTestMethod(msgContext).startsWith("testServerOutboundHandleMessageFalse"))
+ {
+ doNext = false;
+ }
+ else if (getTestMethod(msgContext).startsWith("testServerOutboundHandleMessageThrowsRuntimeException"))
+ {
+ throw new WebServiceException("ErrorIn" + this);
+ }
+ return doNext;
+ }
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler2.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler3.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler3.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler3.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
+
+
+
+public class ServerHandler3 extends LifecycleHandler
+{
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.java 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.java 2007-03-16 19:18:35 UTC (rev 2631)
@@ -1,117 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.handlerlifecycle;
-
-// $Id$
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Map;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.WebServiceRef;
-
-import org.jboss.logging.Logger;
-
-public class ServletClient extends HttpServlet
-{
- private static Logger log = Logger.getLogger(ServletClient.class);
-
- @WebServiceRef(wsdlLocation = "http://localhost:8080/jaxws-handlerlifecycle/soap?wsdl")
- public static SOAPEndpoint port;
-
- @WebServiceRef(wsdlLocation = "http://localhost:8080/jaxws-handlerlifecycle/tracker?wsdl")
- private TrackerEndpoint trackerPort;
-
- protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
- {
- String message;
- try
- {
- String methodName = req.getParameter("method");
- Method method = getClass().getMethod(methodName, new Class[] {});
- method.invoke(this, new Object[] {});
- message = "pass";
- }
- catch (InvocationTargetException ex)
- {
- log.error(ex.getTargetException());
- message = ex.getTargetException().toString();
- }
- catch (Exception ex)
- {
- log.error(ex);
- message = ex.toString();
- }
-
- res.getWriter().println(message);
- }
-
- public void testClientAccess() throws Exception
- {
- Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
- Map<String, Object> resContext = ((BindingProvider)port).getResponseContext();
- reqContext.put("client-req-prop", Boolean.TRUE);
-
- String retStr = port.echo("hello");
- assertEquals("hello", retStr);
-
- assertNull(resContext.get("client-handler-prop"));
- assertEquals(Boolean.TRUE, resContext.get("client-res-prop"));
- }
-
- public void testTrackerMessages() throws Exception
- {
- String retStr = HandlerTracker.getListMessages();
- assertEquals("[ClientHandler:PostConstruct, ClientHandler:OutBound, ClientHandler:InBound, ClientHandler:Close]", retStr);
-
- retStr = trackerPort.getListMessages();
- assertEquals("[ServerHandler:PostConstruct, ServerHandler:InBound, ServerHandler:OutBound, ServerHandler:Close]", retStr);
-
- }
-
- public void testClearTrackerData() throws Exception
- {
- HandlerTracker.clearListMessages();
- trackerPort.clearListMessages();
-
- assertEquals("[]", HandlerTracker.getListMessages());
- assertEquals("[]", trackerPort.getListMessages());
- }
-
- private void assertEquals(Object exp, Object was)
- {
- if (exp.equals(was) == false)
- throw new RuntimeException("Expected <" + exp + "> but was <" + was + ">");
- }
-
- private void assertNull(Object object)
- {
- if (object != null)
- throw new RuntimeException("Expected null");
- }
-}
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-client-handlers.xml
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-client-handlers.xml 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-client-handlers.xml 2007-03-16 19:18:35 UTC (rev 2631)
@@ -7,9 +7,17 @@
<handler-chain>
<handler>
- <handler-name> ClientHandler </handler-name>
- <handler-class> org.jboss.test.ws.jaxws.handlerlifecycle.ClientHandler </handler-class>
+ <handler-name> ClientHandler1 </handler-name>
+ <handler-class> org.jboss.test.ws.jaxws.handlerlifecycle.ClientHandler1 </handler-class>
</handler>
+ <handler>
+ <handler-name> ClientHandler2 </handler-name>
+ <handler-class> org.jboss.test.ws.jaxws.handlerlifecycle.ClientHandler2 </handler-class>
+ </handler>
+ <handler>
+ <handler-name> ClientHandler3 </handler-name>
+ <handler-class> org.jboss.test.ws.jaxws.handlerlifecycle.ClientHandler3 </handler-class>
+ </handler>
</handler-chain>
</handler-chains>
\ No newline at end of file
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-server-handlers.xml
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-server-handlers.xml 2007-03-16 15:12:06 UTC (rev 2630)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-server-handlers.xml 2007-03-16 19:18:35 UTC (rev 2631)
@@ -7,9 +7,17 @@
<handler-chain>
<handler>
- <handler-name> ServerHandler </handler-name>
- <handler-class> org.jboss.test.ws.jaxws.handlerlifecycle.ServerHandler </handler-class>
+ <handler-name> ServerHandler1 </handler-name>
+ <handler-class> org.jboss.test.ws.jaxws.handlerlifecycle.ServerHandler1 </handler-class>
</handler>
+ <handler>
+ <handler-name> ServerHandler2 </handler-name>
+ <handler-class> org.jboss.test.ws.jaxws.handlerlifecycle.ServerHandler2 </handler-class>
+ </handler>
+ <handler>
+ <handler-name> ServerHandler3 </handler-name>
+ <handler-class> org.jboss.test.ws.jaxws.handlerlifecycle.ServerHandler3 </handler-class>
+ </handler>
</handler-chain>
</handler-chains>
\ No newline at end of file
Added: trunk/jbossws-tests/src/resources/jaxws/handlerlifecycle/META-INF/jaxws-client-config.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxws/handlerlifecycle/META-INF/jaxws-client-config.xml (rev 0)
+++ trunk/jbossws-tests/src/resources/jaxws/handlerlifecycle/META-INF/jaxws-client-config.xml 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id$ -->
+
+<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
+
+ <client-config>
+ <config-name> Custom Client Config </config-name>
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name> PreClientHandler1 </javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.handlerlifecycle.PreClientHandler1</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name> PreClientHandler2 </javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.handlerlifecycle.PreClientHandler2</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name> PostClientHandler1 </javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.handlerlifecycle.PostClientHandler1</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name> PostClientHandler2 </javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.handlerlifecycle.PostClientHandler2</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </client-config>
+
+</jaxws-config>
\ No newline at end of file
Property changes on: trunk/jbossws-tests/src/resources/jaxws/handlerlifecycle/META-INF/jaxws-client-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/resources/jaxws/handlerlifecycle/WEB-INF/jaxws-endpoint-config.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxws/handlerlifecycle/WEB-INF/jaxws-endpoint-config.xml (rev 0)
+++ trunk/jbossws-tests/src/resources/jaxws/handlerlifecycle/WEB-INF/jaxws-endpoint-config.xml 2007-03-16 19:18:35 UTC (rev 2631)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id$ -->
+
+<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
+
+ <client-config>
+ <config-name> Custom Server Config </config-name>
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name> PreServerHandler1 </javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.handlerlifecycle.PreServerHandler1</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name> PreServerHandler2 </javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.handlerlifecycle.PreServerHandler2</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name> PostServerHandler1 </javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.handlerlifecycle.PostServerHandler1</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name> PostServerHandler2 </javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.handlerlifecycle.PostServerHandler2</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </client-config>
+
+</jaxws-config>
\ No newline at end of file
Property changes on: trunk/jbossws-tests/src/resources/jaxws/handlerlifecycle/WEB-INF/jaxws-endpoint-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 9 months
JBossWS SVN: r2630 - trunk/jbossws-core/src/java/org/jboss/ws/core.
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-03-16 11:12:06 -0400 (Fri, 16 Mar 2007)
New Revision: 2630
Added:
trunk/jbossws-core/src/java/org/jboss/ws/core/HeaderSource.java
trunk/jbossws-core/src/java/org/jboss/ws/core/RoleSource.java
Log:
Add missing classes
Added: trunk/jbossws-core/src/java/org/jboss/ws/core/HeaderSource.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/HeaderSource.java (rev 0)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/HeaderSource.java 2007-03-16 15:12:06 UTC (rev 2630)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.core;
+
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+/**
+ * HeaderSource provides header information to the binding layer.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public interface HeaderSource
+{
+ /**
+ * Get the set of known headers for this source.
+ *
+ * @return set of known herars
+ */
+ Set<QName> getHeaders();
+}
Property changes on: trunk/jbossws-core/src/java/org/jboss/ws/core/HeaderSource.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-core/src/java/org/jboss/ws/core/RoleSource.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/RoleSource.java (rev 0)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/RoleSource.java 2007-03-16 15:12:06 UTC (rev 2630)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.core;
+
+import java.util.Set;
+
+/**
+ * RoleSource provides role information to the binding layer.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public interface RoleSource
+{
+ /**
+ * Get the set of roles associate with this source.
+ *
+ * @return the set of roles
+ */
+ Set<String> getRoles();
+}
Property changes on: trunk/jbossws-core/src/java/org/jboss/ws/core/RoleSource.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 9 months