JBossWS SVN: r2589 - in trunk/jbossws-tests: src/java/org/jboss/test/ws/jaxrpc and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-10 15:37:25 -0500 (Sat, 10 Mar 2007)
New Revision: 2589
Added:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/JBWS723TestCase.java
trunk/jbossws-tests/src/resources/jaxrpc/jbws723/
trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/jaxrpc-mapping.xml
trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/wsdl/
trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/wsdl/OrganizationService.wsdl
Removed:
trunk/jbossws-tests/src/resources/jaxrpc/jbws723/wstools-config.xml
Modified:
trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/OrganizationHome.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/OrganizationImpl.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/OrganizationRemote.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/OrganizationService.java
trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/ejb-jar.xml
trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/jboss.xml
trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/webservices.xml
Log:
[JBWS-723] Protect access to WSDL
Modified: trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2007-03-10 19:45:46 UTC (rev 2588)
+++ trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2007-03-10 20:37:25 UTC (rev 2589)
@@ -1689,6 +1689,36 @@
</metainf>
</jar>
+ <!-- jaxrpc-jbws723 -->
+ <jar jarfile="${tests.output.dir}/libs/jaxrpc-jbws723.jar">
+ <fileset dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxrpc/jbws723/OrganizationService.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws723/OrganizationHome.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws723/OrganizationRemote.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws723/OrganizationImpl.class"/>
+ </fileset>
+ <metainf dir="${tests.output.dir}/resources/jaxrpc/jbws723/META-INF">
+ <include name="jaxrpc-mapping.xml"/>
+ <include name="webservices.xml"/>
+ <include name="ejb-jar.xml"/>
+ <include name="jboss.xml"/>
+ <include name="wsdl/**"/>
+ </metainf>
+ </jar>
+ <jar jarfile="${tests.output.dir}/libs/jaxrpc-jbws723-client.jar">
+ <fileset dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxrpc/jbws723/OrganizationService.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws723/OrganizationHome.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws723/OrganizationRemote.class"/>
+ </fileset>
+ <metainf dir="${tests.output.dir}/resources/jaxrpc/jbws723/META-INF">
+ <include name="application-client.xml"/>
+ <include name="jboss-client.xml"/>
+ <include name="jaxrpc-mapping.xml"/>
+ <include name="wsdl/**"/>
+ </metainf>
+ </jar>
+
<!-- jaxrpc-jbws732 -->
<war warfile="${tests.output.dir}/libs/jaxrpc-jbws732.war" webxml="${tests.output.dir}/resources/jaxrpc/jbws732/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Copied: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723 (from rev 2583, trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/secureejb)
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/JBWS723TestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/JBWS723TestCase.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/JBWS723TestCase.java 2007-03-10 20:37:25 UTC (rev 2589)
@@ -0,0 +1,219 @@
+/*
+ * 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.jaxrpc.jbws723;
+
+import java.net.URL;
+import java.rmi.RemoteException;
+
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.Stub;
+
+import junit.framework.Test;
+
+import org.jboss.security.SecurityAssociation;
+import org.jboss.security.SimplePrincipal;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLException;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+
+
+/**
+ * Protect access to WSDL
+ *
+ * http://jira.jboss.org/jira/browse/JBWS-723
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Mar-2007
+ */
+public class JBWS723TestCase extends JBossWSTest
+{
+ public static final String USERNAME = "kermit";
+ public static final String PASSWORD = "thefrog";
+
+ public static Test suite() throws Exception
+ {
+ return JBossWSTestSetup.newTestSetup(JBWS723TestCase.class, "jaxrpc-jbws723.jar, jaxrpc-jbws723-client.jar");
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ SecurityAssociation.setPrincipal(null);
+ SecurityAssociation.setCredential(null);
+ }
+
+ /** Test required principal/credential for this bean
+ */
+ public void testRoleSecuredSLSB() throws Exception
+ {
+ InitialContext iniCtx = getInitialContext();
+ OrganizationHome home = (OrganizationHome)iniCtx.lookup("ejb/RoleSecuredSLSB");
+
+ OrganizationRemote bean = null;
+ try
+ {
+ bean = home.create();
+ fail("Security exception expected");
+ }
+ catch (Exception e)
+ {
+ // all cool, now try again with valid credentials
+ SecurityAssociation.setPrincipal(new SimplePrincipal(USERNAME));
+ SecurityAssociation.setCredential(PASSWORD);
+ bean = home.create();
+ }
+
+ String info = bean.getContactInfo("mafia");
+ assertEquals("The 'mafia' boss is currently out of office, please call again.", info);
+ }
+
+ public void testRoleSecuredWSDLAccess() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws723/RoleSecured?wsdl");
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdl = factory.parse(wsdlURL);
+ assertNotNull("Expect unsecured wsdl access by default for jaxrpc", wsdl);
+ }
+
+ public void testRoleSecuredServiceAccess() throws Exception
+ {
+ InitialContext iniCtx = getInitialContext();
+ Service service = (Service)iniCtx.lookup("java:comp/env/service/RoleSecured");
+ QName portName = new QName("http://org.jboss.ws/jbws723", "RoleSecuredPort");
+ OrganizationService port = (OrganizationService)service.getPort(portName, OrganizationService.class);
+
+ try
+ {
+ port.getContactInfo("mafia");
+ fail("Security exception expected");
+ }
+ catch (RemoteException ignore)
+ {
+ // ignore expected exception
+ }
+
+ Stub stub = (Stub)port;
+ stub._setProperty(Stub.USERNAME_PROPERTY, USERNAME);
+ stub._setProperty(Stub.PASSWORD_PROPERTY, PASSWORD);
+
+ String info = port.getContactInfo("mafia");
+ assertEquals("The 'mafia' boss is currently out of office, please call again.", info);
+ }
+
+ /** Test that the remote access to this bean is unchecked
+ */
+ public void testBasicSecuredSLSB() throws Exception
+ {
+ InitialContext iniCtx = getInitialContext();
+ OrganizationHome home = (OrganizationHome)iniCtx.lookup("ejb/BasicSecuredSLSB");
+
+ OrganizationRemote bean = home.create();
+ String info = bean.getContactInfo("mafia");
+ assertEquals("The 'mafia' boss is currently out of office, please call again.", info);
+ }
+
+ public void testBasicSecuredWSDLAccess() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws723/BasicSecured?wsdl");
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ try
+ {
+ factory.parse(wsdlURL);
+ fail("Expect secured wsdl access");
+ }
+ catch (WSDLException ex)
+ {
+ String cause = ex.getCause().getMessage();
+ assertTrue("Server returned HTTP response code: 401", cause.startsWith("Server returned HTTP response code: 401"));
+ }
+ }
+
+ public void testBasicSecuredServiceAccess() throws Exception
+ {
+ InitialContext iniCtx = getInitialContext();
+ Service service = (Service)iniCtx.lookup("java:comp/env/service/BasicSecured");
+ QName portName = new QName("http://org.jboss.ws/jbws723", "BasicSecuredPort");
+ OrganizationService port = (OrganizationService)service.getPort(portName, OrganizationService.class);
+
+ try
+ {
+ port.getContactInfo("mafia");
+ fail("Security exception expected");
+ }
+ catch (RemoteException ignore)
+ {
+ // ignore expected exception
+ }
+
+ Stub stub = (Stub)port;
+ stub._setProperty(Stub.USERNAME_PROPERTY, USERNAME);
+ stub._setProperty(Stub.PASSWORD_PROPERTY, PASSWORD);
+
+ String info = port.getContactInfo("mafia");
+ assertEquals("The 'mafia' boss is currently out of office, please call again.", info);
+ }
+
+ public void testConfidentialSecuredWSDLAccess() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws723/ConfidentialSecured?wsdl");
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdl = factory.parse(wsdlURL);
+ assertNotNull("Expect unsecured wsdl access", wsdl);
+ }
+
+ public void testConfidentialServiceAccess() throws Exception
+ {
+ InitialContext iniCtx = getInitialContext();
+ Service service = (Service)iniCtx.lookup("java:comp/env/service/ConfidentialSecured");
+ QName portName = new QName("http://org.jboss.ws/jbws723", "ConfidentialPort");
+ OrganizationService port = (OrganizationService)service.getPort(portName, OrganizationService.class);
+
+ Stub stub = (Stub)port;
+ String address = (String)stub._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY);
+ assertEquals("https://" + getServerHost() + ":8443/jaxrpc-jbws723/ConfidentialSecured", address);
+
+ // test non-confidential access
+ try
+ {
+ stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxrpc-jbws723/ConfidentialSecured");
+ port.getContactInfo("mafia");
+
+ if (isTargetJBoss50())
+ System.out.println("FIXME: [JBAS-3595] - Tomcat allows http access with transport guarantie CONFIDENTIAL");
+ else
+ fail("Security exception expected");
+ }
+ catch (RemoteException ignore)
+ {
+ // ignore expected exception
+ }
+
+ // test confidential access
+ //stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "https://" + getServerHost() + ":8443/jaxrpc-jbws723/ConfidentialSecured");
+ //String info = port.getContactInfo("mafia");
+ //assertEquals("The 'mafia' boss is currently out of office, please call again.", info);
+ }
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/JBWS723TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/OrganizationHome.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/secureejb/OrganizationHome.java 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/OrganizationHome.java 2007-03-10 20:37:25 UTC (rev 2589)
@@ -19,7 +19,7 @@
* 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.jaxrpc.samples.secureejb;
+package org.jboss.test.ws.jaxrpc.jbws723;
import java.rmi.RemoteException;
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/OrganizationImpl.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/secureejb/OrganizationImpl.java 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/OrganizationImpl.java 2007-03-10 20:37:25 UTC (rev 2589)
@@ -19,7 +19,7 @@
* 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.jaxrpc.samples.secureejb;
+package org.jboss.test.ws.jaxrpc.jbws723;
import java.rmi.RemoteException;
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/OrganizationRemote.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/secureejb/OrganizationRemote.java 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/OrganizationRemote.java 2007-03-10 20:37:25 UTC (rev 2589)
@@ -19,7 +19,7 @@
* 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.jaxrpc.samples.secureejb;
+package org.jboss.test.ws.jaxrpc.jbws723;
import java.rmi.RemoteException;
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/OrganizationService.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/secureejb/OrganizationService.java 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws723/OrganizationService.java 2007-03-10 20:37:25 UTC (rev 2589)
@@ -19,7 +19,7 @@
* 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.jaxrpc.samples.secureejb;
+package org.jboss.test.ws.jaxrpc.jbws723;
import java.rmi.Remote;
import java.rmi.RemoteException;
Copied: trunk/jbossws-tests/src/resources/jaxrpc/jbws723 (from rev 2583, trunk/jbossws-tests/src/resources/jaxrpc/samples/secureejb)
Modified: trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/ejb-jar.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/samples/secureejb/META-INF/ejb-jar.xml 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/ejb-jar.xml 2007-03-10 20:37:25 UTC (rev 2589)
@@ -8,10 +8,10 @@
<enterprise-beans>
<session>
<ejb-name>RoleSecuredSLSB</ejb-name>
- <remote>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationRemote</remote>
- <home>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationHome</home>
- <service-endpoint>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationService</service-endpoint>
- <ejb-class>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationImpl</ejb-class>
+ <remote>org.jboss.test.ws.jaxrpc.jbws723.OrganizationRemote</remote>
+ <home>org.jboss.test.ws.jaxrpc.jbws723.OrganizationHome</home>
+ <service-endpoint>org.jboss.test.ws.jaxrpc.jbws723.OrganizationService</service-endpoint>
+ <ejb-class>org.jboss.test.ws.jaxrpc.jbws723.OrganizationImpl</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<security-role-ref>
@@ -20,19 +20,19 @@
</session>
<session>
<ejb-name>BasicSecuredSLSB</ejb-name>
- <remote>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationRemote</remote>
- <home>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationHome</home>
- <service-endpoint>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationService</service-endpoint>
- <ejb-class>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationImpl</ejb-class>
+ <remote>org.jboss.test.ws.jaxrpc.jbws723.OrganizationRemote</remote>
+ <home>org.jboss.test.ws.jaxrpc.jbws723.OrganizationHome</home>
+ <service-endpoint>org.jboss.test.ws.jaxrpc.jbws723.OrganizationService</service-endpoint>
+ <ejb-class>org.jboss.test.ws.jaxrpc.jbws723.OrganizationImpl</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
<session>
<ejb-name>ConfidentialSLSB</ejb-name>
- <remote>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationRemote</remote>
- <home>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationHome</home>
- <service-endpoint>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationService</service-endpoint>
- <ejb-class>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationImpl</ejb-class>
+ <remote>org.jboss.test.ws.jaxrpc.jbws723.OrganizationRemote</remote>
+ <home>org.jboss.test.ws.jaxrpc.jbws723.OrganizationHome</home>
+ <service-endpoint>org.jboss.test.ws.jaxrpc.jbws723.OrganizationService</service-endpoint>
+ <ejb-class>org.jboss.test.ws.jaxrpc.jbws723.OrganizationImpl</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
Added: trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/jaxrpc-mapping.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/jaxrpc-mapping.xml (rev 0)
+++ trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/jaxrpc-mapping.xml 2007-03-10 20:37:25 UTC (rev 2589)
@@ -0,0 +1,37 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' 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://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jaxrpc.jbws723</package-type>
+ <namespaceURI>http://org.jboss.ws/jbws723/types</namespaceURI>
+ </package-mapping>
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.jaxrpc.jbws723.OrganizationService</service-interface>
+ <wsdl-service-name xmlns:serviceNS='http://org.jboss.ws/jbws723'>serviceNS:OrganizationService</wsdl-service-name>
+ <port-mapping>
+ <port-name>OrganizationServicePort</port-name>
+ <java-port-name>OrganizationServicePort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws723.OrganizationService</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS='http://org.jboss.ws/jbws723'>portTypeNS:OrganizationService</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS='http://org.jboss.ws/jbws723'>bindingNS:OrganizationServiceBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>getContactInfo</java-method-name>
+ <wsdl-operation>getContactInfo</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>java.lang.String</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.ws/jbws723'>wsdlMsgNS:OrganizationService_getContactInfo</wsdl-message>
+ <wsdl-message-part-name>String_1</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+ <method-return-value>java.lang.String</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.ws/jbws723'>wsdlMsgNS:OrganizationService_getContactInfoResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Property changes on: trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/jaxrpc-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/jboss.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/samples/secureejb/META-INF/jboss.xml 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/jboss.xml 2007-03-10 20:37:25 UTC (rev 2589)
@@ -12,7 +12,7 @@
<jndi-name>ejb/RoleSecuredSLSB</jndi-name>
<port-component>
<port-component-name>RoleSecured</port-component-name>
- <port-component-uri>/jaxrpc-samples-ejb/RoleSecured</port-component-uri>
+ <port-component-uri>/jaxrpc-jbws723/RoleSecured</port-component-uri>
<auth-method>BASIC</auth-method>
<transport-guarantee>NONE</transport-guarantee>
<!-- default secure-wsdl-access (false for jaxrpc) -->
@@ -23,7 +23,7 @@
<jndi-name>ejb/BasicSecuredSLSB</jndi-name>
<port-component>
<port-component-name>BasicSecured</port-component-name>
- <port-component-uri>/jaxrpc-samples-ejb/BasicSecured</port-component-uri>
+ <port-component-uri>/jaxrpc-jbws723/BasicSecured</port-component-uri>
<auth-method>BASIC</auth-method>
<transport-guarantee>NONE</transport-guarantee>
<secure-wsdl-access>true</secure-wsdl-access>
@@ -34,7 +34,7 @@
<jndi-name>ejb/ConfidentialSLSB</jndi-name>
<port-component>
<port-component-name>ConfidentialSecured</port-component-name>
- <port-component-uri>/jaxrpc-samples-ejb/ConfidentialSecured</port-component-uri>
+ <port-component-uri>/jaxrpc-jbws723/ConfidentialSecured</port-component-uri>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
<secure-wsdl-access>false</secure-wsdl-access>
</port-component>
Modified: trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/webservices.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/samples/secureejb/META-INF/webservices.xml 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/webservices.xml 2007-03-10 20:37:25 UTC (rev 2589)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<webservices xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:impl="http://org.jboss.ws/samples/secureejb"
+ xmlns:impl="http://org.jboss.ws/jbws723"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
version="1.1">
@@ -13,7 +13,7 @@
<port-component>
<port-component-name>RoleSecured</port-component-name>
<wsdl-port>impl:RoleSecuredPort</wsdl-port>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationService</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws723.OrganizationService</service-endpoint-interface>
<service-impl-bean>
<ejb-link>RoleSecuredSLSB</ejb-link>
</service-impl-bean>
@@ -21,7 +21,7 @@
<port-component>
<port-component-name>BasicSecured</port-component-name>
<wsdl-port>impl:BasicSecuredPort</wsdl-port>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationService</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws723.OrganizationService</service-endpoint-interface>
<service-impl-bean>
<ejb-link>BasicSecuredSLSB</ejb-link>
</service-impl-bean>
@@ -29,7 +29,7 @@
<port-component>
<port-component-name>ConfidentialSecured</port-component-name>
<wsdl-port>impl:ConfidentialPort</wsdl-port>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationService</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws723.OrganizationService</service-endpoint-interface>
<service-impl-bean>
<ejb-link>ConfidentialSLSB</ejb-link>
</service-impl-bean>
Added: trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/wsdl/OrganizationService.wsdl
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/wsdl/OrganizationService.wsdl (rev 0)
+++ trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/wsdl/OrganizationService.wsdl 2007-03-10 20:37:25 UTC (rev 2589)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='OrganizationService' targetNamespace='http://org.jboss.ws/jbws723' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/jbws723' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types/>
+ <message name='OrganizationService_getContactInfo'>
+ <part name='String_1' type='xsd:string'/>
+ </message>
+ <message name='OrganizationService_getContactInfoResponse'>
+ <part name='result' type='xsd:string'/>
+ </message>
+ <portType name='OrganizationService'>
+ <operation name='getContactInfo' parameterOrder='String_1'>
+ <input message='tns:OrganizationService_getContactInfo'/>
+ <output message='tns:OrganizationService_getContactInfoResponse'/>
+ </operation>
+ </portType>
+ <binding name='OrganizationServiceBinding' type='tns:OrganizationService'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='getContactInfo'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.ws/jbws723' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.ws/jbws723' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name="OrganizationService">
+ <port name="BasicSecuredPort" binding="tns:OrganizationServiceBinding">
+ <soap:address location="http://@jbosstest.host.name@:8080/jaxrpc-jbws723/BasicSecured"/>
+ </port>
+ <port name="RoleSecuredPort" binding="tns:OrganizationServiceBinding">
+ <soap:address location="http://@jbosstest.host.name@:8080/jaxrpc-jbws723/RoleSecured"/>
+ </port>
+ <port name="ConfidentialPort" binding="tns:OrganizationServiceBinding">
+ <soap:address location="https://@jbosstest.host.name@:8443/jaxrpc-jbws723/ConfidentialSecured"/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/wsdl/OrganizationService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/jbossws-tests/src/resources/jaxrpc/jbws723/wstools-config.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/samples/secureejb/wstools-config.xml 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/jbossws-tests/src/resources/jaxrpc/jbws723/wstools-config.xml 2007-03-10 20:37:25 UTC (rev 2589)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- wstools -cp ../../../output/classes -config wstools-config.xml
--->
-
-<configuration xmlns="http://www.jboss.org/jbossws-tools"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
-
- <java-wsdl>
- <service name="OrganizationService" style="rpc" endpoint="org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationService"/>
- <namespaces target-namespace="http://org.jboss.ws/samples/secureejb" type-namespace="http://org.jboss.ws/samples/secureejb/types"/>
- <mapping file="jaxrpc-mapping.xml"/>
- </java-wsdl>
-
-</configuration>
-
-<!--
- <service name="OrganizationService">
- <port name="BasicSecuredPort" binding="tns:OrganizationServiceBinding">
- <soap:address location="http://@jbosstest.host.name@:8080/jaxrpc-samples-ejb/BasicSecured"/>
- </port>
- <port name="RoleSecuredPort" binding="tns:OrganizationServiceBinding">
- <soap:address location="http://@jbosstest.host.name@:8080/jaxrpc-samples-ejb/RoleSecured"/>
- </port>
- </service>
--->
\ No newline at end of file
17 years, 9 months
JBossWS SVN: r2588 - in branches/jbossws-1.2.0/build/hudson/hudson-home/jobs: AS-4.0-jdk14 and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-10 14:45:46 -0500 (Sat, 10 Mar 2007)
New Revision: 2588
Modified:
branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml
branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0/config.xml
branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.2/config.xml
branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-5.0/config.xml
Log:
Use 'echo' instead of 'warn'
Modified: branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0/config.xml
===================================================================
--- branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0/config.xml 2007-03-10 19:41:15 UTC (rev 2587)
+++ branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0/config.xml 2007-03-10 19:45:46 UTC (rev 2588)
@@ -29,7 +29,7 @@
# Verify build
#
if [ ! -d ./build/output/@hudson.jboss40.build(a)-ejb3 ]; then
- warn "Cannot find expected build: @hudson.jboss40.build@-ejb3"
+ echo "Cannot find expected build: @hudson.jboss40.build@-ejb3"
exit 1
fi
Modified: branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml
===================================================================
--- branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml 2007-03-10 19:41:15 UTC (rev 2587)
+++ branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml 2007-03-10 19:45:46 UTC (rev 2588)
@@ -31,7 +31,7 @@
# Verify build
#
if [ ! -d ./build/output/(a)hudson.jboss40.build@ ]; then
- warn "Cannot find expected build: @hudson.jboss40.build@"
+ echo "Cannot find expected build: @hudson.jboss40.build@"
exit 1
fi
Modified: branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.2/config.xml
===================================================================
--- branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.2/config.xml 2007-03-10 19:41:15 UTC (rev 2587)
+++ branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.2/config.xml 2007-03-10 19:45:46 UTC (rev 2588)
@@ -29,7 +29,7 @@
# Verify build
#
if [ ! -d ./build/output/(a)hudson.jboss42.build@ ]; then
- warn "Cannot find expected build: @hudson.jboss42.build@"
+ echo "Cannot find expected build: @hudson.jboss42.build@"
exit 1
fi
Modified: branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-5.0/config.xml
===================================================================
--- branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-5.0/config.xml 2007-03-10 19:41:15 UTC (rev 2587)
+++ branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-5.0/config.xml 2007-03-10 19:45:46 UTC (rev 2588)
@@ -29,7 +29,7 @@
# Verify build
#
if [ ! -d ./build/output/(a)hudson.jboss50.build@ ]; then
- warn "Cannot find expected build: @hudson.jboss50.build@"
+ echo "Cannot find expected build: @hudson.jboss50.build@"
exit 1
fi
17 years, 9 months
JBossWS SVN: r2587 - in trunk/build/hudson/hudson-home/jobs: AS-4.0-jdk14 and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-10 14:41:15 -0500 (Sat, 10 Mar 2007)
New Revision: 2587
Modified:
trunk/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml
trunk/build/hudson/hudson-home/jobs/AS-4.0/config.xml
trunk/build/hudson/hudson-home/jobs/AS-4.2/config.xml
trunk/build/hudson/hudson-home/jobs/AS-5.0/config.xml
Log:
Use 'echo' instead of 'warn'
Modified: trunk/build/hudson/hudson-home/jobs/AS-4.0/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/AS-4.0/config.xml 2007-03-10 19:31:10 UTC (rev 2586)
+++ trunk/build/hudson/hudson-home/jobs/AS-4.0/config.xml 2007-03-10 19:41:15 UTC (rev 2587)
@@ -29,7 +29,7 @@
# Verify build
#
if [ ! -d ./build/output/@hudson.jboss40.build(a)-ejb3 ]; then
- warn "Cannot find expected build: @hudson.jboss40.build@-ejb3"
+ echo "Cannot find expected build: @hudson.jboss40.build@-ejb3"
exit 1
fi
Modified: trunk/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml 2007-03-10 19:31:10 UTC (rev 2586)
+++ trunk/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml 2007-03-10 19:41:15 UTC (rev 2587)
@@ -31,7 +31,7 @@
# Verify build
#
if [ ! -d ./build/output/(a)hudson.jboss40.build@ ]; then
- warn "Cannot find expected build: @hudson.jboss40.build@"
+ echo "Cannot find expected build: @hudson.jboss40.build@"
exit 1
fi
Modified: trunk/build/hudson/hudson-home/jobs/AS-4.2/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/AS-4.2/config.xml 2007-03-10 19:31:10 UTC (rev 2586)
+++ trunk/build/hudson/hudson-home/jobs/AS-4.2/config.xml 2007-03-10 19:41:15 UTC (rev 2587)
@@ -29,7 +29,7 @@
# Verify build
#
if [ ! -d ./build/output/(a)hudson.jboss42.build@ ]; then
- warn "Cannot find expected build: @hudson.jboss42.build@"
+ echo "Cannot find expected build: @hudson.jboss42.build@"
exit 1
fi
Modified: trunk/build/hudson/hudson-home/jobs/AS-5.0/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/AS-5.0/config.xml 2007-03-10 19:31:10 UTC (rev 2586)
+++ trunk/build/hudson/hudson-home/jobs/AS-5.0/config.xml 2007-03-10 19:41:15 UTC (rev 2587)
@@ -29,7 +29,7 @@
# Verify build
#
if [ ! -d ./build/output/(a)hudson.jboss50.build@ ]; then
- warn "Cannot find expected build: @hudson.jboss50.build@"
+ echo "Cannot find expected build: @hudson.jboss50.build@"
exit 1
fi
17 years, 9 months
JBossWS SVN: r2586 - in branches/jbossws-1.2.0/build/hudson/hudson-home/jobs: AS-4.0-jdk14 and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-10 14:31:10 -0500 (Sat, 10 Mar 2007)
New Revision: 2586
Modified:
branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml
branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0/config.xml
branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.2/config.xml
branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-5.0/config.xml
Log:
verify jbossas build name
Modified: branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0/config.xml
===================================================================
--- branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0/config.xml 2007-03-10 19:25:50 UTC (rev 2585)
+++ branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0/config.xml 2007-03-10 19:31:10 UTC (rev 2586)
@@ -24,8 +24,16 @@
cd $SVNBASE
rm -f thirdparty/libraries.ent
./build/build.sh clean main
-
+
#
+# Verify build
+#
+if [ ! -d ./build/output/@hudson.jboss40.build(a)-ejb3 ]; then
+ warn "Cannot find expected build: @hudson.jboss40.build@-ejb3"
+ exit 1
+fi
+
+#
# build the testsuite
#
cd testsuite
Modified: branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml
===================================================================
--- branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml 2007-03-10 19:25:50 UTC (rev 2585)
+++ branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml 2007-03-10 19:31:10 UTC (rev 2586)
@@ -28,6 +28,14 @@
./build/build.sh clean main
#
+# Verify build
+#
+if [ ! -d ./build/output/(a)hudson.jboss40.build@ ]; then
+ warn "Cannot find expected build: @hudson.jboss40.build@"
+ exit 1
+fi
+
+#
# build the testsuite
#
cd testsuite
Modified: branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.2/config.xml
===================================================================
--- branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.2/config.xml 2007-03-10 19:25:50 UTC (rev 2585)
+++ branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-4.2/config.xml 2007-03-10 19:31:10 UTC (rev 2586)
@@ -26,6 +26,14 @@
./build/build.sh clean main
#
+# Verify build
+#
+if [ ! -d ./build/output/(a)hudson.jboss42.build@ ]; then
+ warn "Cannot find expected build: @hudson.jboss42.build@"
+ exit 1
+fi
+
+#
# build the testsuite
#
cd testsuite
Modified: branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-5.0/config.xml
===================================================================
--- branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-5.0/config.xml 2007-03-10 19:25:50 UTC (rev 2585)
+++ branches/jbossws-1.2.0/build/hudson/hudson-home/jobs/AS-5.0/config.xml 2007-03-10 19:31:10 UTC (rev 2586)
@@ -26,6 +26,14 @@
./build/build.sh clean main
#
+# Verify build
+#
+if [ ! -d ./build/output/(a)hudson.jboss50.build@ ]; then
+ warn "Cannot find expected build: @hudson.jboss50.build@"
+ exit 1
+fi
+
+#
# build the testsuite
#
cd testsuite
17 years, 9 months
JBossWS SVN: r2585 - trunk/build.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-10 14:25:50 -0500 (Sat, 10 Mar 2007)
New Revision: 2585
Modified:
trunk/build/version.properties
Log:
2.0.0.DEV
Modified: trunk/build/version.properties
===================================================================
--- trunk/build/version.properties 2007-03-10 19:22:31 UTC (rev 2584)
+++ trunk/build/version.properties 2007-03-10 19:25:50 UTC (rev 2585)
@@ -5,8 +5,8 @@
specification.vendor=JBoss (http://www.jboss.org)
specification.version=jbossws-1.2
-version.id=2.0.0.CR5
-repository.id=2.0.0.CR5
+version.id=2.0.0.DEV
+repository.id=snapshot
implementation.title=JBoss Web Services (JBossWS)
implementation.url=http://www.jboss.org/products/jbossws
17 years, 9 months
JBossWS SVN: r2584 - in trunk/build: hudson/hudson-home and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-10 14:22:31 -0500 (Sat, 10 Mar 2007)
New Revision: 2584
Modified:
trunk/build/ant-import/build-hudson.xml
trunk/build/hudson/hudson-home/config.xml
trunk/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml
trunk/build/hudson/hudson-home/jobs/AS-4.0/config.xml
trunk/build/hudson/hudson-home/jobs/AS-4.2/config.xml
trunk/build/hudson/hudson-home/jobs/AS-5.0/config.xml
Log:
verify jboss build name
Modified: trunk/build/ant-import/build-hudson.xml
===================================================================
--- trunk/build/ant-import/build-hudson.xml 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/build/ant-import/build-hudson.xml 2007-03-10 19:22:31 UTC (rev 2584)
@@ -83,8 +83,24 @@
<fileset dir="${build.dir}/hudson/hudson-home">
<include name="jobs/AS-5.0/**"/>
<include name="jobs/AS-4.2/**"/>
+ <include name="jobs/AS-4.0/**"/>
+ <include name="jobs/AS-4.0.5/**"/>
+ <include name="jobs/TC-5.5/**"/>
+ <include name="jobs/JBWS-Samples-AS-5.0/**"/>
+ <include name="jobs/JBWS-Samples-AS-4.2/**"/>
+ <include name="jobs/JBWS-Samples-AS-4.0/**"/>
+ <include name="jobs/JBWS-Samples-AS-4.0.5/**"/>
+ <include name="jobs/JBWS-Samples-TC-5.5/**"/>
<include name="jobs/JBWS-Tests-AS-5.0/**"/>
<include name="jobs/JBWS-Tests-AS-4.2/**"/>
+ <include name="jobs/JBWS-Tests-AS-4.0/**"/>
+ <include name="jobs/JBWS-Tests-AS-4.0.5/**"/>
+ <include name="jobs/JBWS-Tests-TC-5.5/**"/>
+ <include name="jobs/JBAS-Tests-AS-5.0/**"/>
+ <include name="jobs/JBAS-Tests-AS-4.2/**"/>
+ <include name="jobs/JBAS-Tests-AS-4.0/**"/>
+ <include name="jobs/Release-Matrix-Step1/**"/>
+ <include name="jobs/Release-Matrix-Step2/**"/>
<include name="users/**"/>
<include name="*.xml"/>
</fileset>
Modified: trunk/build/hudson/hudson-home/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/config.xml 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/build/hudson/hudson-home/config.xml 2007-03-10 19:22:31 UTC (rev 2584)
@@ -34,7 +34,7 @@
<jobNames class="tree-set">
<no-comparator/>
<string>JBAS-Tests-AS-4.0</string>
- <string>JBAS-Tests-AS-4.0-jdk14</string>
+ <!--string>JBAS-Tests-AS-4.0-jdk14</string-->
<string>JBAS-Tests-AS-4.2</string>
<string>JBAS-Tests-AS-5.0</string>
</jobNames>
@@ -48,7 +48,7 @@
</description>
</view>
- <!-- JBossWS Local Testsuite -->
+ <!-- JBossWS Local Testsuite
<view>
<owner reference="../../.."/>
<jobNames class="tree-set">
@@ -67,6 +67,7 @@
]]>
</description>
</view>
+ -->
<!-- JBossWS Testsuite -->
<view>
@@ -74,9 +75,9 @@
<jobNames class="tree-set">
<no-comparator/>
<string>JBWS-Tests-AS-4.0.5</string>
- <string>JBWS-Tests-AS-4.0.5-jdk14</string>
+ <!--string>JBWS-Tests-AS-4.0.5-jdk14</string-->
<string>JBWS-Tests-AS-4.0</string>
- <string>JBWS-Tests-AS-4.0-jdk14</string>
+ <!--string>JBWS-Tests-AS-4.0-jdk14</string-->
<string>JBWS-Tests-AS-4.2</string>
<string>JBWS-Tests-AS-5.0</string>
<string>JBWS-Tests-TC-5.5</string>
@@ -147,9 +148,9 @@
<string>AS-5.0</string>
<string>AS-4.2</string>
<string>AS-4.0</string>
- <string>AS-4.0-jdk14</string>
+ <!--string>AS-4.0-jdk14</string-->
<string>AS-4.0.5</string>
- <string>AS-4.0.5-jdk14</string>
+ <!--string>AS-4.0.5-jdk14</string-->
<string>TC-5.5</string>
</jobNames>
<name>Target Container</name>
Modified: trunk/build/hudson/hudson-home/jobs/AS-4.0/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/AS-4.0/config.xml 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/build/hudson/hudson-home/jobs/AS-4.0/config.xml 2007-03-10 19:22:31 UTC (rev 2584)
@@ -24,8 +24,16 @@
cd $SVNBASE
rm -f thirdparty/libraries.ent
./build/build.sh clean main
-
+
#
+# Verify build
+#
+if [ ! -d ./build/output/@hudson.jboss40.build(a)-ejb3 ]; then
+ warn "Cannot find expected build: @hudson.jboss40.build@-ejb3"
+ exit 1
+fi
+
+#
# build the testsuite
#
cd testsuite
Modified: trunk/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/build/hudson/hudson-home/jobs/AS-4.0-jdk14/config.xml 2007-03-10 19:22:31 UTC (rev 2584)
@@ -28,6 +28,14 @@
./build/build.sh clean main
#
+# Verify build
+#
+if [ ! -d ./build/output/(a)hudson.jboss40.build@ ]; then
+ warn "Cannot find expected build: @hudson.jboss40.build@"
+ exit 1
+fi
+
+#
# build the testsuite
#
cd testsuite
Modified: trunk/build/hudson/hudson-home/jobs/AS-4.2/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/AS-4.2/config.xml 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/build/hudson/hudson-home/jobs/AS-4.2/config.xml 2007-03-10 19:22:31 UTC (rev 2584)
@@ -26,6 +26,14 @@
./build/build.sh clean main
#
+# Verify build
+#
+if [ ! -d ./build/output/(a)hudson.jboss42.build@ ]; then
+ warn "Cannot find expected build: @hudson.jboss42.build@"
+ exit 1
+fi
+
+#
# build the testsuite
#
cd testsuite
Modified: trunk/build/hudson/hudson-home/jobs/AS-5.0/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/AS-5.0/config.xml 2007-03-10 17:17:10 UTC (rev 2583)
+++ trunk/build/hudson/hudson-home/jobs/AS-5.0/config.xml 2007-03-10 19:22:31 UTC (rev 2584)
@@ -26,6 +26,14 @@
./build/build.sh clean main
#
+# Verify build
+#
+if [ ! -d ./build/output/(a)hudson.jboss50.build@ ]; then
+ warn "Cannot find expected build: @hudson.jboss50.build@"
+ exit 1
+fi
+
+#
# build the testsuite
#
cd testsuite
17 years, 9 months
JBossWS SVN: r2583 - trunk/jbossws-tests/src/java/org/jboss/test/ws/common/binding.
by jbossws-commits@lists.jboss.org
Author: alex.guizar(a)jboss.com
Date: 2007-03-10 12:17:10 -0500 (Sat, 10 Mar 2007)
New Revision: 2583
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
Log:
JBCTS-442 fixed discrepancy between envelope namespace and fault subelements syntax
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2007-03-10 17:15:29 UTC (rev 2582)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2007-03-10 17:17:10 UTC (rev 2583)
@@ -132,8 +132,12 @@
" <env:Header/>" +
" <env:Body>" +
" <env:Fault>" +
- " <faultcode>env:Client</faultcode>" +
- " <faultstring>Some fault message</faultstring>" +
+ " <env:Code>" +
+ " <env:Value>env:Sender</env:Value>" +
+ " </env:Code>" +
+ " <env:Reason>" +
+ " <env:Text xml:lang='en'>Some fault message</env:Text>" +
+ " </env:Reason>" +
" </env:Fault>" +
" </env:Body>" +
"</env:Envelope>";
@@ -432,7 +436,7 @@
}
catch (SOAPFaultException faultEx)
{
- assertEquals("Client", faultEx.getFaultCode().getLocalPart());
+ assertEquals("Sender", faultEx.getFaultCode().getLocalPart());
assertEquals("Some fault message", faultEx.getFaultString());
}
}
17 years, 9 months
JBossWS SVN: r2582 - in trunk/jbossws-core/src/java: org/jboss/ws and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: alex.guizar(a)jboss.com
Date: 2007-03-10 12:15:29 -0500 (Sat, 10 Mar 2007)
New Revision: 2582
Modified:
trunk/jbossws-core/src/java/javax/xml/soap/SOAPConstants.java
trunk/jbossws-core/src/java/org/jboss/ws/Constants.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/DetailImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/FaultMetaData.java
Log:
JBCTS-442 implemented SAAJ 1.3 behavior, moved detail element
population code from EnvelopeBuilderDOM to Detail itself
Modified: trunk/jbossws-core/src/java/javax/xml/soap/SOAPConstants.java
===================================================================
--- trunk/jbossws-core/src/java/javax/xml/soap/SOAPConstants.java 2007-03-10 17:09:00 UTC (rev 2581)
+++ trunk/jbossws-core/src/java/javax/xml/soap/SOAPConstants.java 2007-03-10 17:15:29 UTC (rev 2582)
@@ -63,13 +63,13 @@
/** The URI identifying the next application processing a SOAP request as the intended actor for a SOAP 1.1 header entry (see section 4.2.2 of the SOAP 1.1 specification). */
String URI_SOAP_ACTOR_NEXT = "http://schemas.xmlsoap.org/soap/actor/next";
/** SOAP 1.2 VersionMismatch Fault */
- QName SOAP_VERSIONMISMATCH_FAULT = new QName("http://www.w3.org/2003/05/soap-envelope", "VersionMismatch");
+ QName SOAP_VERSIONMISMATCH_FAULT = new QName(URI_NS_SOAP_1_2_ENVELOPE, "VersionMismatch", SOAP_ENV_PREFIX);
/** SOAP 1.2 MustUnderstand Fault */
- QName SOAP_MUSTUNDERSTAND_FAULT = new QName("http://www.w3.org/2003/05/soap-envelope", "MustUnderstand");
+ QName SOAP_MUSTUNDERSTAND_FAULT = new QName(URI_NS_SOAP_1_2_ENVELOPE, "MustUnderstand", SOAP_ENV_PREFIX);
/** SOAP 1.2 DataEncodingUnknown Fault */
- QName SOAP_DATAENCODINGUNKNOWN_FAULT = new QName("http://www.w3.org/2003/05/soap-envelope", "DataEncodingUnknown");
+ QName SOAP_DATAENCODINGUNKNOWN_FAULT = new QName(URI_NS_SOAP_1_2_ENVELOPE, "DataEncodingUnknown", SOAP_ENV_PREFIX);
/** SOAP 1.2 Sender Fault */
- QName SOAP_SENDER_FAULT = new QName("http://www.w3.org/2003/05/soap-envelope", "Sender");
+ QName SOAP_SENDER_FAULT = new QName(URI_NS_SOAP_1_2_ENVELOPE, "Sender", SOAP_ENV_PREFIX);
/** SOAP 1.2 Receiver Fault */
- QName SOAP_RECEIVER_FAULT = new QName("http://www.w3.org/2003/05/soap-envelope", "Receiver");
+ QName SOAP_RECEIVER_FAULT = new QName(URI_NS_SOAP_1_2_ENVELOPE, "Receiver", SOAP_ENV_PREFIX);
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/Constants.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/Constants.java 2007-03-10 17:09:00 UTC (rev 2581)
+++ trunk/jbossws-core/src/java/org/jboss/ws/Constants.java 2007-03-10 17:15:29 UTC (rev 2582)
@@ -48,6 +48,8 @@
static final String NS_JBOSSWS_URI = "http://www.jboss.org/jbossws";
/** XML Namespace */
static final String NS_XML = "http://www.w3.org/XML/1998/namespace";
+ /** XML namespace declaration namespace */
+ static final String NS_XMLNS = "http://www.w3.org/2000/xmlns/";
/** XMLSchema namespace http://www.w3.org/2001/XMLSchema */
static final String NS_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema";
/** XMLSchema instance namespace http://www.w3.org/2001/XMLSchema-instance */
@@ -61,7 +63,7 @@
/** HTTP binding namespace http://schemas.xmlsoap.org/wsdl/http/ */
static final String NS_HTTP = "http://schemas.xmlsoap.org/wsdl/http/";
/** SOAP-1.2 envelope namespace http://www.w3.org/2003/05/soap-envelope */
- static final String NS_SOAP12_ENV = "http://www.w3.org/2003/05/soap-envelope";
+ static final String NS_SOAP12_ENV = SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE;
/** The namespace for the SwA mime type */
static final String NS_SWA_MIME = "http://schemas.xmlsoap.org/wsdl/mime/";
/** Default namespace for WSDL-1.1 http://schemas.xmlsoap.org/wsdl/ */
@@ -148,8 +150,21 @@
static final Name SOAP11_HEADER = new NameImpl("Header", PREFIX_ENV, NS_SOAP11_ENV);
static final Name SOAP11_BODY = new NameImpl("Body", PREFIX_ENV, NS_SOAP11_ENV);
static final Name SOAP11_FAULT = new NameImpl("Fault", PREFIX_ENV, NS_SOAP11_ENV);
- static final Name SOAP12_FAULT = new NameImpl("Fault", PREFIX_ENV, NS_SOAP12_ENV);
+ static final QName SOAP11_FAULTCODE = new QName("faultcode");
+ static final QName SOAP11_FAULTSTRING = new QName("faultstring");
+ static final QName SOAP11_FAULTACTOR = new QName("faultactor");
+ static final QName SOAP11_DETAIL = new QName("detail");
+ /**SOAP-1.2 elements */
+ static final QName SOAP12_CODE = new QName(NS_SOAP12_ENV, "Code", PREFIX_ENV);
+ static final QName SOAP12_VALUE = new QName(NS_SOAP12_ENV, "Value", PREFIX_ENV);
+ static final QName SOAP12_SUBCODE = new QName(NS_SOAP12_ENV, "Subcode", PREFIX_ENV);
+ static final QName SOAP12_REASON = new QName(NS_SOAP12_ENV, "Reason", PREFIX_ENV);
+ static final QName SOAP12_TEXT = new QName(NS_SOAP12_ENV, "Text", PREFIX_ENV);
+ static final QName SOAP12_ROLE = new QName(NS_SOAP12_ENV, "Role", PREFIX_ENV);
+ static final QName SOAP12_NODE = new QName(NS_SOAP12_ENV, "Node", PREFIX_ENV);
+ static final QName SOAP12_DETAIL = new QName(NS_SOAP12_ENV, "Detail", PREFIX_ENV);
+
/** The default RPC return parameter name */
static final String DEFAULT_RPC_RETURN_NAME = "result"; // FIXME: According to JSR-181 this should be 'return'
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-10 17:09:00 UTC (rev 2581)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2007-03-10 17:15:29 UTC (rev 2582)
@@ -68,11 +68,12 @@
public static SOAPFaultException getSOAPFaultException(SOAPFault soapFault)
{
SOAPFaultException faultEx = new SOAPFaultException(soapFault);
- Detail detail = soapFault.getDetail();
+ Detail detail = soapFault.getDetail();
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
if (detail != null && msgContext != null)
{
+ log.debug("Processing detail");
SerializationContext serContext = msgContext.getSerializationContext();
TypeMapping typeMapping = serContext.getTypeMapping();
@@ -80,13 +81,14 @@
while (it.hasNext())
{
DetailEntry deElement = (DetailEntry)it.next();
- QName xmlName = new QName(deElement.getNamespaceURI(), deElement.getLocalName());
+ QName xmlName = deElement.getElementQName();
+ log.debug("Processing detail entry: " + xmlName);
OperationMetaData opMetaData = msgContext.getOperationMetaData();
FaultMetaData faultMetaData = opMetaData.getFault(xmlName);
if (faultMetaData != null)
{
- if(log.isDebugEnabled()) log.debug("Deserialize fault: " + faultMetaData);
+ log.debug("Deserialize fault: " + faultMetaData);
QName xmlType = faultMetaData.getXmlType();
Class<?> faultBeanClass = faultMetaData.getFaultBean();
@@ -101,8 +103,7 @@
if (prefix != null && prefix.length() > 0)
{
String nsURI = deElement.getNamespaceURI();
- String attrValue = deElement.getAttribute("xmlns:" + prefix);
- if (nsURI.length() > 0 && attrValue.length() == 0)
+ if (nsURI.length() > 0 && deElement.getAttributeNS(Constants.NS_XMLNS, prefix).length() == 0)
{
try
{
@@ -134,9 +135,7 @@
}
}
else
- {
- if(log.isDebugEnabled()) log.debug("Cannot find fault meta data for: " + xmlName);
- }
+ log.debug("Cannot find fault meta data for: " + xmlName);
}
}
@@ -274,9 +273,7 @@
detail.addChildElement(detailEntry);
}
else
- {
- if(log.isDebugEnabled()) log.debug("Cannot obtain fault meta data for: " + exClass);
- }
+ log.debug("Cannot obtain fault meta data for: " + exClass);
return soapMessage;
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/DetailImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/DetailImpl.java 2007-03-10 17:09:00 UTC (rev 2581)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/DetailImpl.java 2007-03-10 17:15:29 UTC (rev 2582)
@@ -21,14 +21,24 @@
*/
package org.jboss.ws.core.soap;
+import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.soap.Detail;
import javax.xml.soap.DetailEntry;
import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
/**
* A container for DetailEntry objects. DetailEntry objects give detailed error information that is application-specific
* and related to the SOAPBody object that contains it.
@@ -42,11 +52,47 @@
*/
public class DetailImpl extends SOAPFaultElementImpl implements Detail
{
+ // provide logging
+ private static Logger log = Logger.getLogger(DetailImpl.class);
+
+ /** Creates a SOAP 1.1 detail element. */
public DetailImpl()
{
super("detail");
}
+ /** Creates a SOAP 1.2 prefix:Detail element. */
+ public DetailImpl(String prefix, String namespace)
+ {
+ super("Detail", prefix, namespace);
+ }
+
+ /** Converts the given element to a Detail. */
+ DetailImpl(SOAPElementImpl element)
+ {
+ super(element.getElementName());
+
+ // altough detail schema does not define attributes, copy them for completeness
+ DOMUtils.copyAttributes(this, element);
+
+ try
+ {
+ NodeList nodeList = element.getChildNodes();
+ for (int i = 0; i < nodeList.getLength(); i++)
+ {
+ Node node = nodeList.item(i);
+ if (node instanceof SOAPElement)
+ addChildElement((SOAPElement)node);
+ else
+ appendChild(node);
+ }
+ }
+ catch (SOAPException e)
+ {
+ throw new WSException("Unable to create fault detail", e);
+ }
+ }
+
public DetailEntry addDetailEntry(Name name) throws SOAPException
{
DetailEntryImpl detailEntry = new DetailEntryImpl(name);
@@ -63,6 +109,42 @@
public Iterator getDetailEntries()
{
- return getChildElements();
+ List<DetailEntry> list = new ArrayList<DetailEntry>();
+
+ NodeList nodeList = getChildNodes();
+ for (int i = 0; i < nodeList.getLength(); i++)
+ {
+ org.w3c.dom.Node node = nodeList.item(i);
+ if (node instanceof DetailEntry)
+ list.add((DetailEntry)node);
+ }
+
+ return list.iterator();
}
+
+ @Override
+ public Node appendChild(Node newChild) throws DOMException
+ {
+ if (newChild instanceof SOAPElementImpl && !(newChild instanceof DetailEntry))
+ newChild = convertToDetailEntry((SOAPElementImpl) newChild);
+
+ return super.appendChild(newChild);
+ }
+
+ @Override
+ public SOAPElement addChildElement(SOAPElement child) throws SOAPException
+ {
+ if (!(child instanceof DetailEntry))
+ child = convertToDetailEntry((SOAPElementImpl)child);
+
+ return super.addChildElement(child);
+ }
+
+ private static DetailEntry convertToDetailEntry(SOAPElementImpl element)
+ {
+ element.detachNode();
+ DetailEntryImpl detailEntry = new DetailEntryImpl(element);
+ log.trace("convertToDetailEntry : " + detailEntry);
+ return detailEntry;
+ }
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-03-10 17:09:00 UTC (rev 2581)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-03-10 17:15:29 UTC (rev 2582)
@@ -23,21 +23,6 @@
//$Id$
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Detail;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.dom.DOMSource;
-
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
@@ -45,6 +30,13 @@
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
+import javax.xml.namespace.QName;
+import javax.xml.soap.*;
+import javax.xml.transform.dom.DOMSource;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
+
/**
* A SOAPEnvelope builder for JAXRPC based on DOM
*
@@ -144,40 +136,9 @@
DOMUtils.copyAttributes(soapFault, domBodyElement);
- Element domFaultCode = DOMUtils.getFirstChildElement(domBodyElement, new QName("faultcode"));
- if (domFaultCode == null)
- throw new SOAPException("SOAPFault does not contain a <faultcode> element");
-
- Element domFaultString = DOMUtils.getFirstChildElement(domBodyElement, new QName("faultstring"));
- if (domFaultString == null)
- throw new SOAPException("SOAPFault does not contain a <faultstring> element");
-
- String faultCode = DOMUtils.getTextContent(domFaultCode);
- soapFault.setFaultCode(faultCode);
-
- String faultString = DOMUtils.getTextContent(domFaultString);
- soapFault.setFaultString(faultString);
-
- Element domFaultActor = DOMUtils.getFirstChildElement(domBodyElement, new QName("faultactor"));
- if (domFaultActor != null)
- {
- String faultActor = DOMUtils.getTextContent(domFaultActor);
- soapFault.setFaultActor(faultActor);
- }
-
- // Add the fault detail
- Element domFaultDetail = DOMUtils.getFirstChildElement(domBodyElement, "detail");
- if (domFaultDetail != null)
- {
- Detail detail = soapFault.addDetail();
- Iterator it = DOMUtils.getChildElements(domFaultDetail);
- while (it.hasNext())
- {
- Element domElement = (Element)it.next();
- SOAPElement detailEntry = new DetailEntryImpl(soapFactory.createElement(domElement));
- detailEntry = detail.addChildElement(detailEntry);
- }
- }
+ // copy everything and let soapFault discover child elements itself
+ XMLFragment xmlFragment = new XMLFragment(new DOMSource(domBodyElement));
+ soapFault.setXMLFragment(xmlFragment);
}
// Process and RPC or DOCUMENT style message
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-10 17:09:00 UTC (rev 2581)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-10 17:15:29 UTC (rev 2582)
@@ -48,7 +48,6 @@
import javax.xml.transform.stream.StreamSource;
import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.utils.DOMUtils;
@@ -154,7 +153,10 @@
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
- return addFault(new NameImpl(Constants.SOAP11_FAULT_CODE_SERVER), "Generic server fault");
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(getPrefix(), getNamespaceURI());
+ soapFault = (SOAPFaultImpl)addChildElement(soapFault);
+ soapFault.setFaultCode(soapFault.getDefaultFaultCode());
+ return soapFault;
}
public SOAPFault addFault(Name faultCode, String faultString) throws SOAPException
@@ -217,7 +219,7 @@
{
log.trace("getFault");
expandToDOM();
- Iterator it = getFaultIterator();
+ Iterator it = faultIterator();
return it.hasNext() ? (SOAPFault)it.next() : null;
}
@@ -225,14 +227,12 @@
{
log.trace("hasFault");
expandToDOM();
- return getFaultIterator().hasNext();
+ return faultIterator().hasNext();
}
- private Iterator getFaultIterator()
+ private Iterator faultIterator()
{
- Name faultName = Constants.NS_SOAP11_ENV.equals(getNamespaceURI()) ?
- Constants.SOAP11_FAULT : Constants.SOAP12_FAULT;
- return getChildElements(faultName);
+ return getChildElements(new QName(getNamespaceURI(), "Fault"));
}
public Node appendChild(Node newChild) throws DOMException
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2007-03-10 17:09:00 UTC (rev 2581)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2007-03-10 17:15:29 UTC (rev 2582)
@@ -487,6 +487,11 @@
*/
public Iterator getChildElements(Name name)
{
+ return getChildElements(((NameImpl)name).toQName());
+ }
+
+ public Iterator getChildElements(QName qname)
+ {
List<SOAPElement> list = new ArrayList<SOAPElement>();
Iterator it = getChildElements();
while (it.hasNext())
@@ -495,18 +500,13 @@
if (elementOrTextNode instanceof SOAPElement)
{
SOAPElement el = (SOAPElement)elementOrTextNode;
- if (el.getElementName().equals(name))
+ if (el.getElementQName().equals(qname))
list.add(el);
}
}
return list.iterator();
}
- public Iterator getChildElements(QName qname)
- {
- return getChildElements(new NameImpl(qname));
- }
-
/**
* Returns the name of this SOAPElement object.
*
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java 2007-03-10 17:09:00 UTC (rev 2581)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java 2007-03-10 17:15:29 UTC (rev 2582)
@@ -40,4 +40,9 @@
{
super(name);
}
+
+ public SOAPFaultElementImpl(SOAPElementImpl element)
+ {
+ super(element);
+ }
}
\ No newline at end of file
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFaultImpl.java 2007-03-10 17:09:00 UTC (rev 2581)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFaultImpl.java 2007-03-10 17:15:29 UTC (rev 2582)
@@ -22,6 +22,8 @@
package org.jboss.ws.core.soap;
import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.Iterator;
import java.util.Locale;
@@ -32,15 +34,13 @@
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFault;
+import javax.xml.soap.SOAPFaultElement;
import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.xb.QNameBuilder;
-import org.w3c.dom.Element;
+import org.w3c.dom.Attr;
/**
* An element in the SOAPBody object that contains error and/or status information.
@@ -64,275 +64,725 @@
private static Logger log = Logger.getLogger(SOAPFaultImpl.class);
private SOAPElement faultcode;
+ // also represents Reason
private SOAPElement faultstring;
+ // also represents Role
private SOAPElement faultactor;
- private Locale faultStringLocale;
+ private SOAPElement faultnode;
+ private Detail detail;
- private String faultRole;
-
public SOAPFaultImpl() throws SOAPException
{
- this(SOAPConstants.SOAP_ENV_PREFIX, SOAPConstants.URI_NS_SOAP_ENVELOPE);
+ this(Constants.PREFIX_ENV, Constants.NS_SOAP11_ENV);
}
-
+
public SOAPFaultImpl(String prefix, String namespace) throws SOAPException
{
super(new NameImpl("Fault", prefix, namespace));
- SOAPFactoryImpl factory = new SOAPFactoryImpl();
- addChildElement(faultcode = factory.createElement("faultcode"));
- addChildElement(faultstring = factory.createElement("faultstring"));
}
- /** Creates an optional Detail object and sets it as the Detail object for this SOAPFault object.
+ /** Gets the fault code for this SOAPFault object.
*/
- public Detail addDetail() throws SOAPException
+ public String getFaultCode()
{
- Detail detail = getDetail();
- if (detail != null)
- throw new SOAPException("SOAPFault already contains a detail node");
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ {
+ if (faultcode == null)
+ findFaultCodeElement();
- SOAPFactoryImpl factory = new SOAPFactoryImpl();
- detail = (Detail)addChildElement(factory.createDetail());
- return detail;
+ return faultcode.getValue();
+ }
+ else
+ {
+ if (faultcode == null)
+ findCodeElement();
+
+ return getChildValueElement(faultcode).getValue();
+ }
}
- /** Returns the optional detail element for this SOAPFault object.
+ /**
+ * Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name object.
*/
- public Detail getDetail()
+ public Name getFaultCodeAsName()
{
- Detail detail = null;
- Iterator it = getChildElements(new NameImpl("detail"));
- while (it.hasNext())
+ return new NameImpl(getFaultCodeAsQName());
+ }
+
+ public QName getFaultCodeAsQName()
+ {
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
{
- Object obj = it.next();
- if (obj instanceof Detail)
+ if (faultcode == null)
+ findFaultCodeElement();
+
+ return QNameBuilder.buildQName(faultcode, faultcode.getValue());
+ }
+ else
+ {
+ if (faultcode == null)
+ findCodeElement();
+
+ SOAPElement valueElement = getChildValueElement(faultcode);
+ return QNameBuilder.buildQName(valueElement, valueElement.getValue());
+ }
+ }
+
+ private void findFaultCodeElement()
+ {
+ faultcode = getChildElement(this, Constants.SOAP11_FAULTCODE);
+ log.trace("findFaultCodeElement : " + faultcode);
+ }
+
+ private void findCodeElement()
+ {
+ faultcode = getChildElement(this, Constants.SOAP12_CODE);
+ log.trace("findCodeElement : " + faultcode);
+ }
+
+ private static SOAPElement getChildValueElement(SOAPElement codeElement)
+ {
+ return getChildElement(codeElement, Constants.SOAP12_VALUE);
+ }
+
+ /** Sets this SOAPFault object with the give fault code.
+ */
+ public void setFaultCode(String faultCode) throws SOAPException
+ {
+ // Must be of the form "prefix:localName" where the prefix has been defined in a namespace declaration.
+ QName qname = QNameBuilder.buildQName(this, faultCode);
+ setFaultCode(qname);
+ }
+
+ /** Sets this SOAPFault object with the given fault code.
+ */
+ public void setFaultCode(Name faultCode) throws SOAPException
+ {
+ setFaultCode(((NameImpl)faultCode).toQName());
+ }
+
+ public void setFaultCode(QName faultCode) throws SOAPException
+ {
+ String nsURI = faultCode.getNamespaceURI();
+ if (nsURI.length() == 0)
+ throw new SOAPException("code must be namespace qualified: " + faultCode);
+
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ {
+ if (faultcode == null)
{
- detail = (Detail)obj;
+ findFaultCodeElement();
+ if (faultcode == null)
+ faultcode = addUnqualifiedFaultElement("faultcode");
}
- else if (obj instanceof SOAPElementImpl)
+ setCode(faultcode, faultCode);
+ }
+ else
+ {
+ if (!(SOAPConstants.SOAP_DATAENCODINGUNKNOWN_FAULT.equals(faultCode) ||
+ SOAPConstants.SOAP_MUSTUNDERSTAND_FAULT.equals(faultCode) ||
+ SOAPConstants.SOAP_RECEIVER_FAULT.equals(faultCode) ||
+ SOAPConstants.SOAP_SENDER_FAULT.equals(faultCode) ||
+ SOAPConstants.SOAP_VERSIONMISMATCH_FAULT.equals(faultCode)))
+ throw new SOAPException(faultCode + " is not a standard SOAP 1.2 Code value");
+
+ if (faultcode == null)
{
- try
+ findCodeElement();
+ if (faultcode == null)
{
- SOAPElementImpl soapEl = (SOAPElementImpl)obj;
- SOAPFactoryImpl factory = new SOAPFactoryImpl();
- detail = (Detail)addChildElement(factory.createDetail());
-
- Iterator childIt = DOMUtils.getChildElements(soapEl);
- while (childIt.hasNext())
- {
- Element domElement = (Element)childIt.next();
- SOAPElement detailEntry = new DetailEntryImpl(factory.createElement(domElement));
- detail.addChildElement(detailEntry);
- }
+ faultcode = addQualifiedFaultElement("Code");
+ addChildValueElement(faultcode);
}
- catch (SOAPException e)
- {
- throw new WSException("Unable to create fault detail: " + e.getMessage());
- }
+ }
+ setCode(getChildValueElement(faultcode), faultCode);
+ }
+ }
+ private static void setCode(SOAPElement codeElement, QName code) throws SOAPException
+ {
+ String nsURI = code.getNamespaceURI();
+ String prefix = code.getPrefix();
+ if (prefix.length() == 0)
+ {
+ // no given prefix, find prefix currently associated to given URI
+ prefix = getNamespacePrefix(codeElement, nsURI);
+ if (prefix == null)
+ {
+ // no prefix currently associated to given URI, declare namespace locally
+ prefix = "codeNS";
+ codeElement.addNamespaceDeclaration(prefix, nsURI);
}
}
+ // verify given prefix is associated to given URI
+ else if (!nsURI.equals(codeElement.getNamespaceURI(prefix)))
+ {
+ // prefix is associated with other/no URI, declare namespace locally
+ codeElement.addNamespaceDeclaration(prefix, nsURI);
+ }
- return detail;
+ codeElement.setValue(prefix + ":" + code.getLocalPart());
}
- /** Gets the fault actor for this SOAPFault object.
+ /**
+ * Returns the prefix of the namespace that has the given URI.
+ * @param nsURI the URI of the namespace to search for
+ * @return the prefix of the namespace or <code>null</code> if not found
*/
- public String getFaultActor()
+ private static String getNamespacePrefix(SOAPElement element, String nsURI)
{
- return (faultactor != null ? faultactor.getValue() : null);
+ Iterator it = element.getVisibleNamespacePrefixes();
+ while (it.hasNext())
+ {
+ String prefix = (String)it.next();
+ if (nsURI.equals(element.getNamespaceURI(prefix)))
+ return prefix;
+ }
+ return null;
}
- /** Gets the fault code for this SOAPFault object.
- */
- public String getFaultCode()
+ private static SOAPElement addChildValueElement(SOAPElement codeElement) throws SOAPException
{
- String value = faultcode.getValue();
- return value;
+ return codeElement.addChildElement("Value", codeElement.getPrefix(), codeElement.getNamespaceURI());
}
- /**
- * Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name object.
- */
- public Name getFaultCodeAsName()
+ public Iterator getFaultSubcodes()
{
- QName qname = QNameBuilder.buildQName(this, faultcode.getValue());
- return new NameImpl(qname);
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ throw new UnsupportedOperationException("SOAP 1.1 Fault does not support the concept of Subcode");
+
+ ArrayList<QName> subcodes = new ArrayList<QName>();
+
+ SOAPElement baseCodeElement = faultcode;
+ SOAPElement subcodeElement;
+ for (subcodeElement = getChildSubcodeElement(baseCodeElement); subcodeElement != null; subcodeElement = getChildSubcodeElement(baseCodeElement))
+ {
+ SOAPElement valueElement = getChildValueElement(subcodeElement);
+ QName subcode = QNameBuilder.buildQName(valueElement, valueElement.getValue());
+ subcodes.add(subcode);
+
+ baseCodeElement = subcodeElement;
+ }
+
+ // this iterator should not support the remove method
+ return Collections.unmodifiableList(subcodes).iterator();
}
+ private static SOAPElement getChildSubcodeElement(SOAPElement element)
+ {
+ return getChildElement(element, Constants.SOAP12_SUBCODE);
+ }
+
+ public void appendFaultSubcode(QName subcode) throws SOAPException
+ {
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ throw new UnsupportedOperationException("SOAP 1.1 Fault does not support the concept of Subcode");
+
+ String nsURI = subcode.getNamespaceURI();
+ if (nsURI.length() == 0)
+ throw new SOAPException("subcode must be namespace qualified: " + subcode);
+
+ if (faultcode == null)
+ findCodeElement();
+
+ // find innermost subcode element
+ SOAPElement baseCodeElement = faultcode;
+ for (SOAPElement subcodeElement = getChildSubcodeElement(baseCodeElement); subcodeElement != null; subcodeElement = getChildSubcodeElement(baseCodeElement))
+ baseCodeElement = subcodeElement;
+
+ SOAPElement subcodeElement = baseCodeElement.addChildElement("Subcode", baseCodeElement.getPrefix(), baseCodeElement.getNamespaceURI());
+ SOAPElement valueElement = addChildValueElement(subcodeElement);
+
+ setCode(valueElement, subcode);
+ }
+
+ public void removeAllFaultSubcodes()
+ {
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ throw new UnsupportedOperationException("SOAP 1.1 Fault does not support the concept of Subcode");
+
+ if (faultcode == null)
+ findFaultCodeElement();
+
+ SOAPElement subcodeElement = getChildSubcodeElement(faultcode);
+ if (subcodeElement != null)
+ subcodeElement.detachNode();
+ }
+
/** Gets the fault string for this SOAPFault object.
*/
public String getFaultString()
{
- String value = faultstring.getValue();
- return value;
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ {
+ if (faultstring == null)
+ {
+ findFaultStringElement();
+ if (faultstring == null)
+ return null;
+ }
+ return faultstring.getValue();
+ }
+ else
+ {
+ try
+ {
+ return (String)getFaultReasonTexts().next();
+ }
+ catch (SOAPException e)
+ {
+ return null;
+ }
+ }
}
/** Gets the locale of the fault string for this SOAPFault object.
*/
public Locale getFaultStringLocale()
{
- return faultStringLocale;
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ {
+ if (faultstring == null)
+ {
+ findFaultStringElement();
+ if (faultstring == null)
+ return null;
+ }
+ return getLocale(faultstring);
+ }
+ else
+ {
+ try
+ {
+ return (Locale)getFaultReasonLocales().next();
+ }
+ catch (SOAPException e)
+ {
+ return null;
+ }
+ }
}
- /** Sets this SOAPFault object with the given fault actor.
+ private void findFaultStringElement()
+ {
+ faultstring = getChildElement(this, Constants.SOAP11_FAULTSTRING);
+ log.trace("findFaultStringElement : " + faultstring);
+ }
+
+ private static Locale getLocale(SOAPElement element)
+ {
+ Attr xmlLang = element.getAttributeNodeNS(Constants.NS_XML, "lang");
+ return xmlLang != null ? toLocale(xmlLang.getValue()) : null;
+ }
+
+ /** Converts a language tag as defined in <a
+ * href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC 3066</a> to a
+ * {@link Locale}.
*/
- public void setFaultActor(String faultActor) throws SOAPException
+ private static Locale toLocale(String languageTag)
{
- if (faultactor == null)
+ String[] subtags = languageTag.split("-");
+ // ignore subtags beyond the second
+ return subtags.length == 1 ? new Locale(subtags[0]) : new Locale(subtags[0], subtags[1]);
+ }
+
+ /** Sets the fault string for this SOAPFault object to the given string.
+ */
+ public void setFaultString(String faultString) throws SOAPException
+ {
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
{
- SOAPFactoryImpl factory = new SOAPFactoryImpl();
- addChildElement(faultactor = factory.createElement("faultactor"));
+ setFaultStringInternal(faultString);
+ faultstring.removeAttributeNS(Constants.NS_XML, "lang");
}
-
- faultactor.setValue(faultActor);
+ else addFaultReasonText(faultString, Locale.getDefault());
}
- /** Sets this SOAPFault object with the give fault code.
+ /** Sets the fault string for this SOAPFault object to the given string and localized to the given locale.
*/
- public void setFaultCode(String faultCode) throws SOAPException
+ public void setFaultString(String faultString, Locale locale) throws SOAPException
{
- // Must be of the form "prefix:localName" where the prefix has been defined in a namespace declaration.
- if (faultCode == null || faultCode.indexOf(":") < 1)
- throw new IllegalArgumentException("Invalid faultCode: " + faultCode);
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ {
+ setFaultStringInternal(faultString);
+ setLocale(faultstring, locale);
+ }
+ else addFaultReasonText(faultString, locale);
+ }
- QName qname = QNameBuilder.buildQName(this, faultCode);
- setFaultCode(new NameImpl(qname));
+ private void setFaultStringInternal(String faultString) throws SOAPException
+ {
+ if (faultstring == null)
+ {
+ findFaultStringElement();
+ if (faultstring == null)
+ faultstring = addUnqualifiedFaultElement("faultstring");
+ }
+ faultstring.setValue(faultString);
}
- /** Sets this SOAPFault object with the given fault code.
+ private static void setLocale(SOAPElement element, Locale locale)
+ {
+ element.setAttributeNS(Constants.NS_XML, "xml:lang", toLanguageTag(locale));
+ }
+
+ /** Converts a {@link Locale} to a language tag as defined in <a
+ * href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC 3066</a>.
*/
- public void setFaultCode(Name faultName) throws SOAPException
+ private static String toLanguageTag(Locale locale)
{
- String nsURI = faultName.getURI();
- String prefix = faultName.getPrefix();
- String localName = faultName.getLocalName();
+ String languageTag = locale.getLanguage();
- // For lazy folkes like the CTS that don't bother to give
- // a namesapce URI, assume they use a standard code
- if ("".equals(nsURI))
+ String country = locale.getCountry();
+ if (country.length() != 0)
+ languageTag += "-" + country;
+
+ return languageTag;
+ }
+
+ public Iterator getFaultReasonTexts() throws SOAPException
+ {
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ throw new UnsupportedOperationException("SOAP 1.1 Fault does not support the concept of Reason");
+
+ if (faultstring == null)
{
- log.warn("Empty namespace URI with fault code '" + faultName + "', assuming: " + Constants.NS_SOAP11_ENV);
- nsURI = Constants.NS_SOAP11_ENV;
- prefix = getPrefix();
+ findReasonElement();
+ if (faultstring == null)
+ return Collections.EMPTY_LIST.iterator();
}
- if (nsURI.length() > 0 && prefix.length() == 0)
- prefix = "codeNS";
-
- String prevNS = getNamespaceURI(prefix);
- if (prevNS == null)
- addNamespaceDeclaration(prefix, nsURI);
+ ArrayList<String> texts = new ArrayList<String>();
+ Iterator it = faultstring.getChildElements(Constants.SOAP12_TEXT);
+ while (it.hasNext())
+ {
+ SOAPElement textElement = (SOAPElement)it.next();
+ texts.add(textElement.getValue());
+ }
- String faultCode = prefix + ":" + localName;
- faultcode.setValue(faultCode);
+ if (texts.isEmpty())
+ throw new SOAPException("no Text elements found inside Reason");
+
+ return texts.iterator();
}
- public void setFaultCode(QName faultCode) throws SOAPException
+ public Iterator getFaultReasonLocales() throws SOAPException
{
- setFaultCode(new NameImpl(faultCode));
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ throw new UnsupportedOperationException("SOAP 1.1 Fault does not support the concept of Reason");
+
+ if (faultstring == null)
+ {
+ findReasonElement();
+ if (faultstring == null)
+ return Collections.EMPTY_LIST.iterator();
+ }
+
+ ArrayList<Locale> locales = new ArrayList<Locale>();
+ Iterator it = faultstring.getChildElements(Constants.SOAP12_TEXT);
+ while (it.hasNext())
+ {
+ SOAPElement textElement = (SOAPElement)it.next();
+ Locale locale = getLocale(textElement);
+ if (locale == null)
+ throw new SOAPException("lang attribute not present on Text element");
+ locales.add(locale);
+ }
+
+ if (locales.isEmpty())
+ throw new SOAPException("no Text elements found inside Reason");
+
+ return locales.iterator();
}
-
- /** Sets the fault string for this SOAPFault object to the given string.
- */
- public void setFaultString(String faultString) throws SOAPException
+
+ public String getFaultReasonText(Locale locale) throws SOAPException
{
- faultstring.setValue(faultString);
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ throw new UnsupportedOperationException("SOAP 1.1 Fault does not support the concept of Reason");
+
+ if (locale == null)
+ return null;
+
+ if (faultstring == null)
+ {
+ findReasonElement();
+ if (faultstring == null)
+ return null;
+ }
+
+ SOAPElement textElement = getTextElement(locale);
+ return textElement != null ? textElement.getValue() : null;
}
- /** Sets the fault string for this SOAPFault object to the given string and localized to the given locale.
- */
- public void setFaultString(String faultString, Locale locale) throws SOAPException
+ private void findReasonElement()
{
- setFaultString(faultString);
- this.faultStringLocale = locale;
+ faultstring = getChildElement(this, Constants.SOAP12_REASON);
+ log.trace("findReasonElement: " + faultstring);
}
- public void writeElement(Writer writer)
+ private SOAPElement getTextElement(Locale locale)
{
- new DOMWriter(writer).print(this);
+ log.trace("getTextElement(" + locale + ")");
+ SOAPElement textElement = null;
+
+ Iterator it = faultstring.getChildElements(Constants.SOAP12_TEXT);
+ while (it.hasNext())
+ {
+ SOAPElement element = (SOAPElement)it.next();
+ if (locale.equals(getLocale(element)))
+ {
+ textElement = element;
+ break;
+ }
+ }
+
+ log.trace("getTextElement : " + textElement);
+ return textElement;
}
public void addFaultReasonText(String text, Locale locale) throws SOAPException
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ throw new UnsupportedOperationException("SOAP 1.1 Fault does not support the concept of Reason");
+
+ if (locale == null)
+ throw new SOAPException("locale passed is null");
+
+ if (faultstring == null)
+ {
+ findReasonElement();
+ if (faultstring == null)
+ faultstring = addQualifiedFaultElement("Reason");
+ }
+
+ SOAPElement textElement = getTextElement(locale);
+ if (textElement == null)
+ {
+ textElement = faultstring.addChildElement("Text", getPrefix(), getNamespaceURI());
+ setLocale(textElement, locale);
+ }
+ textElement.setValue(text);
}
- public void appendFaultSubcode(QName subcode) throws SOAPException
+ /** Gets the fault actor for this SOAPFault object.
+ */
+ public String getFaultActor()
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ {
+ if (faultactor == null)
+ {
+ findFaultActorElement();
+ if (faultactor == null)
+ return null;
+ }
+ return faultactor.getValue();
+ }
+ else return getFaultRole();
}
- public QName getFaultCodeAsQName()
+ private void findFaultActorElement()
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ faultactor = getChildElement(this, Constants.SOAP11_FAULTACTOR);
+ log.trace("findFaultActorElement : " + faultactor);
}
- public String getFaultNode()
+ /** Sets this SOAPFault object with the given fault actor.
+ */
+ public void setFaultActor(String faultActor) throws SOAPException
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ {
+ if (faultactor == null)
+ {
+ findFaultActorElement();
+ if (faultactor == null)
+ faultactor = addUnqualifiedFaultElement("faultactor");
+ }
+ faultactor.setValue(faultActor);
+ }
+ else setFaultRole(faultActor);
}
- public Iterator getFaultReasonLocales() throws SOAPException
+ public String getFaultRole()
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ throw new UnsupportedOperationException("SOAP 1.1 Fault does not support the concept of Role");
+
+ if (faultactor == null)
+ {
+ findRoleElement();
+ if (faultactor == null)
+ return null;
+ }
+ return faultactor.getValue();
}
- public String getFaultReasonText(Locale locale) throws SOAPException
+ private void findRoleElement()
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ faultactor = getChildElement(this, Constants.SOAP12_ROLE);
+ log.trace("findRoleElement : " + faultactor);
}
- public Iterator getFaultReasonTexts() throws SOAPException
+ public void setFaultRole(String uri) throws SOAPException
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ throw new UnsupportedOperationException("SOAP 1.1 Fault does not support the concept of Role");
+
+ if (faultactor == null)
+ {
+ findRoleElement();
+ if (faultactor == null)
+ faultactor = addQualifiedFaultElement("Role");
+ }
+ faultactor.setValue(uri);
}
- public String getFaultRole()
+ public String getFaultNode()
{
- return this.faultRole;
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ throw new UnsupportedOperationException("SOAP 1.1 Fault does not support the concept of Node");
+
+ if (faultnode == null)
+ {
+ findNodeElement();
+ if (faultnode == null)
+ return null;
+ }
+ return faultnode.getValue();
}
- public Iterator getFaultSubcodes()
+ private void findNodeElement()
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ faultnode = getChildElement(this, Constants.SOAP12_NODE);
+ log.trace("findNodeElement : " + faultnode);
}
+ public void setFaultNode(String uri) throws SOAPException
+ {
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ throw new UnsupportedOperationException("SOAP 1.1 Fault does not support the concept of Node");
+
+ if (faultnode == null)
+ {
+ findNodeElement();
+ if (faultnode == null)
+ faultnode = addQualifiedFaultElement("Node");
+ }
+ faultnode.setValue(uri);
+ }
+
public boolean hasDetail()
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ return getDetail() != null;
}
- public void removeAllFaultSubcodes()
+ /** Returns the optional detail element for this SOAPFault object.
+ */
+ public Detail getDetail()
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ if (detail == null)
+ {
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ findSoap11DetailElement();
+ else
+ findSoap12DetailElement();
+ }
+ return detail;
}
- public void setFaultNode(String uri) throws SOAPException
+ /** Creates an optional Detail object and sets it as the Detail object for this SOAPFault object.
+ */
+ public Detail addDetail() throws SOAPException
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
+ {
+ if (detail == null)
+ findSoap11DetailElement();
+
+ if (detail != null)
+ throw new SOAPException("this fault already contains a detail element");
+
+ detail = new DetailImpl();
+ }
+ else
+ {
+ if (detail == null)
+ findSoap12DetailElement();
+
+ if (detail != null)
+ throw new SOAPException("this fault already contains a detail element");
+
+ detail = new DetailImpl(getPrefix(), getNamespaceURI());
+ }
+
+ detail = (Detail)addChildElement(detail);
+ return detail;
}
- public void setFaultRole(String uri) throws SOAPException
+ private void findSoap11DetailElement()
{
- assertSOAPBinding();
- this.faultRole = uri;
+ detail = (Detail)getChildElement(this, Constants.SOAP11_DETAIL);
+ log.trace("findSoap11DetailElement : " + detail);
}
- private void assertSOAPBinding()
+ private void findSoap12DetailElement()
{
- if(getNamespaceURI().equals(Constants.NS_SOAP11_ENV))
- throw new UnsupportedOperationException();
+ detail = (Detail)getChildElement(this, Constants.SOAP12_DETAIL);
+ log.trace("findSoap12DetailElement : " + detail);
}
+
+ @Override
+ public SOAPElement addChildElement(SOAPElement child) throws SOAPException
+ {
+ if (!(child instanceof SOAPFaultElement))
+ child = convertToFaultElement((SOAPElementImpl)child);
+
+ return super.addChildElement(child);
+ }
+
+ private SOAPFaultElement convertToFaultElement(SOAPElementImpl element)
+ {
+ element.detachNode();
+
+ QName elementName = element.getElementQName();
+ SOAPFaultElement faultElement;
+ if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()) ?
+ Constants.SOAP11_DETAIL.equals(elementName) :
+ Constants.SOAP12_DETAIL.equals(elementName))
+ faultElement = new DetailImpl(element);
+ else
+ faultElement = new SOAPFaultElementImpl(element);
+
+ log.trace("convertToFaultElement : " + faultElement);
+ return faultElement;
+ }
+
+ QName getDefaultFaultCode()
+ {
+ return Constants.NS_SOAP11_ENV.equals(getNamespaceURI()) ? Constants.SOAP11_FAULT_CODE_SERVER : SOAPConstants.SOAP_RECEIVER_FAULT;
+ }
+
+ public void writeElement(Writer writer)
+ {
+ new DOMWriter(writer).print(this);
+ }
+
+ private static SOAPElement getChildElement(SOAPElement element, QName name)
+ {
+ Iterator it = element.getChildElements(name);
+ return it.hasNext() ? (SOAPElement)it.next() : null;
+ }
+
+ private SOAPElement addUnqualifiedFaultElement(String localName) throws SOAPException
+ {
+ log.trace("addUnqualifiedFaultElement(" + localName + ")");
+ return addChildElement(new SOAPFaultElementImpl(localName));
+ }
+
+ private SOAPElement addQualifiedFaultElement(String localName) throws SOAPException
+ {
+ log.trace("addQualifiedFaultElement(" + localName + ")");
+ return addChildElement(new SOAPFaultElementImpl(localName, getPrefix(), getNamespaceURI()));
+ }
}
\ No newline at end of file
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/FaultMetaData.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/FaultMetaData.java 2007-03-10 17:09:00 UTC (rev 2581)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/FaultMetaData.java 2007-03-10 17:15:29 UTC (rev 2582)
@@ -63,8 +63,8 @@
private QName xmlType;
private String javaTypeName;
private String faultBeanName;
- private Class javaType;
- private Class faultBean;
+ private Class<? extends Exception> javaType;
+ private Class<?> faultBean;
private Method faultInfoMethod;
private Constructor<? extends Exception> serviceExceptionConstructor;
@@ -123,28 +123,31 @@
/** Load the java type.
* It should only be cached during eager initialization.
*/
- public Class<?> getJavaType()
+ public Class<? extends Exception> getJavaType()
{
- Class<?> tmpJavaType = javaType;
- if (tmpJavaType == null && javaTypeName != null)
+ if (javaType != null)
+ return javaType;
+
+ if (javaTypeName == null)
+ return null;
+
+ try
{
- try
- {
- ClassLoader loader = opMetaData.getEndpointMetaData().getClassLoader();
- tmpJavaType = JavaUtils.loadJavaType(javaTypeName, loader);
+ ClassLoader loader = opMetaData.getEndpointMetaData().getClassLoader();
+ Class<?> genericType = JavaUtils.loadJavaType(javaTypeName, loader);
+ Class<? extends Exception> exceptionType = genericType.asSubclass(Exception.class);
- if (opMetaData.getEndpointMetaData().getServiceMetaData().getUnifiedMetaData().isEagerInitialized())
- {
- log.warn("Loading java type after eager initialization");
- javaType = tmpJavaType.asSubclass(Exception.class);
- }
- }
- catch (ClassNotFoundException ex)
+ if (opMetaData.getEndpointMetaData().getServiceMetaData().getUnifiedMetaData().isEagerInitialized())
{
- throw new WSException("Cannot load java type: " + javaTypeName, ex);
+ log.warn("Loading java type after eager initialization");
+ javaType = exceptionType;
}
+ return exceptionType;
}
- return tmpJavaType;
+ catch (ClassNotFoundException ex)
+ {
+ throw new WSException("Cannot load java type: " + javaTypeName, ex);
+ }
}
public String getFaultBeanName()
@@ -283,8 +286,8 @@
try
{
/* use PropertyDescriptor(String, Class, String, String) instead
- * of PropertyDescriptor(String, Class) because the latter fails
- * with an IntrospectionException: Method not found: setXXX */
+ * of PropertyDescriptor(String, Class) because the latter requires
+ * the setter method to be present */
PropertyDescriptor propertyDescriptor = new PropertyDescriptor(propertyName, javaType, "is" + JavaUtils.capitalize(propertyName), null);
serviceExceptionGetters[i] = propertyDescriptor.getReadMethod();
}
@@ -391,7 +394,7 @@
for (int i = 0; i < propertyCount; i++)
propertyValues[i] = faultBeanProperties[i].accessor().get(faultBean);
- if(log.isDebugEnabled()) log.debug("constructing " + javaType.getSimpleName() + ": " + Arrays.toString(propertyValues));
+ log.debug("constructing " + javaType.getSimpleName() + ": " + Arrays.toString(propertyValues));
serviceException = serviceExceptionConstructor.newInstance(propertyValues);
}
}
17 years, 9 months
JBossWS SVN: r2581 - trunk/jbossws-core/src/java/org/jboss/ws/core/soap.
by jbossws-commits@lists.jboss.org
Author: alex.guizar(a)jboss.com
Date: 2007-03-10 12:09:00 -0500 (Sat, 10 Mar 2007)
New Revision: 2581
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
Log:
JBCTS-441 implemented createFault and createDetail;
filled in DYNAMIC_PROTOCOL behavior
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2007-03-10 16:37:05 UTC (rev 2580)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2007-03-10 17:09:00 UTC (rev 2581)
@@ -47,10 +47,11 @@
{
// provide logging
private static Logger log = Logger.getLogger(SOAPFactoryImpl.class);
-
- // The envelope namespace used by the MessageFactory
+
+ // The envelope namespace used by the SOAPFactoryImpl
+ // JBCTS-441 null means the specified protocol was DYNAMIC_SOAP_PROTOCOL
private String envNamespace;
-
+
public SOAPFactoryImpl()
{
envNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
@@ -60,10 +61,14 @@
{
if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol))
envNamespace = SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE;
- else if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol) || SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol))
+ else if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol))
envNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
+ else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol))
+ envNamespace = null;
+ // JBCTS-441 #newInstanceTest4 passes "BOGUS" as the protocol and
+ // expects us to throw SOAPException
else
- throw new SOAPException("Unsupported protocol: " + protocol);
+ throw new SOAPException("Unknown protocol: " + protocol);
}
@Override
@@ -71,7 +76,7 @@
{
return new SOAPElementImpl(name);
}
-
+
@Override
public SOAPElement createElement(QName qname) throws SOAPException
{
@@ -95,7 +100,7 @@
{
return createElement(domElement, true);
}
-
+
/**
* Create a SOAPElement from a DOM Element.
* This method is not part of the javax.xml.soap.SOAPFactory interface.
@@ -107,7 +112,7 @@
if (domElement instanceof SOAPElement)
return (SOAPElement)domElement;
-
+
String localName = domElement.getLocalName();
String prefix = domElement.getPrefix() != null ? domElement.getPrefix() : "";
String nsURI = domElement.getNamespaceURI() != null ? domElement.getNamespaceURI() : "";
@@ -154,7 +159,11 @@
@Override
public Detail createDetail() throws SOAPException
{
- return new DetailImpl();
+ if (envNamespace == null)
+ throw new UnsupportedOperationException("the specified protocol was DYNAMIC_SOAP_PROTOCOL");
+
+ return SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(envNamespace) ? new DetailImpl() :
+ new DetailImpl(SOAPConstants.SOAP_ENV_PREFIX, envNamespace);
}
@Override
@@ -172,8 +181,11 @@
@Override
public SOAPFault createFault(String reasonText, QName faultCode) throws SOAPException
{
+ if (envNamespace == null)
+ throw new UnsupportedOperationException("the specified protocol was DYNAMIC_SOAP_PROTOCOL");
+
SOAPFaultImpl soapFault = new SOAPFaultImpl(SOAPConstants.SOAP_ENV_PREFIX, envNamespace);
- soapFault.setFaultCode(new NameImpl(faultCode));
+ soapFault.setFaultCode(faultCode);
soapFault.setFaultString(reasonText);
return soapFault;
}
@@ -181,6 +193,11 @@
@Override
public SOAPFault createFault() throws SOAPException
{
- return new SOAPFaultImpl(SOAPConstants.SOAP_ENV_PREFIX, envNamespace);
+ if (envNamespace == null)
+ throw new UnsupportedOperationException("the specified protocol was DYNAMIC_SOAP_PROTOCOL");
+
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(SOAPConstants.SOAP_ENV_PREFIX, envNamespace);
+ soapFault.setFaultCode(soapFault.getDefaultFaultCode());
+ return soapFault;
}
}
17 years, 9 months