JBossWS SVN: r3197 - in trunk/jbossws-core: src/test/java/org/jboss/test/ws/jaxws/metadata and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-22 16:32:33 -0400 (Tue, 22 May 2007)
New Revision: 3197
Removed:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/Echo.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EchoResponse.java
trunk/jbossws-core/src/test/resources/jaxws/metadata/WEB-INF/wsdl/
Modified:
trunk/jbossws-core/ant-import-tests/build-jars-jaxws.xml
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EndpointBean.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EndpointInterface.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/JAXWSBuilderTestCase.java
Log:
Fix JAXWSBuilderTestCase
Modified: trunk/jbossws-core/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- trunk/jbossws-core/ant-import-tests/build-jars-jaxws.xml 2007-05-22 19:45:49 UTC (rev 3196)
+++ trunk/jbossws-core/ant-import-tests/build-jars-jaxws.xml 2007-05-22 20:32:33 UTC (rev 3197)
@@ -233,7 +233,8 @@
<!-- jaxws metadata -->
<war warfile="${tests.output.dir}/libs/jaxws-metadata.war" webxml="${tests.output.dir}/resources/jaxws/metadata/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
- <include name="org/jboss/test/ws/jaxws/metadata/*.class"/>
+ <include name="org/jboss/test/ws/jaxws/metadata/EndpointBean.class"/>
+ <include name="org/jboss/test/ws/jaxws/metadata/EndpointInterface.class"/>
</classes>
<webinf dir="${tests.output.dir}/resources/jaxws/metadata/WEB-INF">
<include name="jboss-web.xml"/>
Deleted: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/Echo.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/Echo.java 2007-05-22 19:45:49 UTC (rev 3196)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/Echo.java 2007-05-22 20:32:33 UTC (rev 3197)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.metadata;
-
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * @author Heiko.Braun(a)jboss.org
- * @version $Id$
- * @since 23.01.2007
- */
-@XmlType(name="Echo", namespace = "http://example.org/sei")
-public class Echo {
- private String message;
-
- public Echo() {
- }
-
- public Echo(String message) {
- this.message = message;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
-}
Deleted: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EchoResponse.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EchoResponse.java 2007-05-22 19:45:49 UTC (rev 3196)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EchoResponse.java 2007-05-22 20:32:33 UTC (rev 3197)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.metadata;
-
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * @author Heiko.Braun(a)jboss.org
- * @version $Id$
- * @since 23.01.2007
- */
-@XmlType(name="EchoResponse", namespace = "http://example.org/sei")
-public class EchoResponse {
- private String message;
-
- public EchoResponse() {
- }
-
- public EchoResponse(String message) {
- this.message = message;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
-}
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EndpointBean.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EndpointBean.java 2007-05-22 19:45:49 UTC (rev 3196)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EndpointBean.java 2007-05-22 20:32:33 UTC (rev 3197)
@@ -21,32 +21,20 @@
*/
package org.jboss.test.ws.jaxws.metadata;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
import javax.jws.WebService;
/**
- * Tes namespace differences at service and portType levels
+ * Test namespace differences at service and portType levels
*
* @author Thomas.Diesler(a)jboss.org
* @since 29-Apr-2005
*/
-@WebService(
- endpointInterface = "org.jboss.test.ws.jaxws.metadata.EndpointInterface",
- targetNamespace = "http://example.org/impl",
- serviceName = "TestService",
- portName = "EndpointInterfacePort",
- wsdlLocation = "/WEB-INF/wsdl/TestService.wsdl"
-)
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.metadata.EndpointInterface", targetNamespace = "http://example.org/impl")
public class EndpointBean implements EndpointInterface
{
- @WebMethod
- @WebResult(name = "EchoResponse", targetNamespace = "http://example.org/sei")
- public EchoResponse echo(@WebParam(name="EchoMessage", targetNamespace = "http://example.org/sei") Echo request)
+ public String echo(String message)
{
- String message = request.getMessage();
System.out.println(message);
- return new EchoResponse(message);
+ return message;
}
}
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EndpointInterface.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EndpointInterface.java 2007-05-22 19:45:49 UTC (rev 3196)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EndpointInterface.java 2007-05-22 20:32:33 UTC (rev 3197)
@@ -28,17 +28,16 @@
import javax.jws.soap.SOAPBinding;
/**
- * Test the JSR-181 annotation: javax.jws.WebService
- * This interface is only used in the client deployment.
+ * This interface is only uses a namespace different from the impl bean.
*
* @author Thomas.Diesler(a)jboss.org
* @since 29-Apr-2005
*/
@WebService(targetNamespace = "http://example.org/sei")
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface EndpointInterface
{
@WebMethod
- @WebResult(name = "EchoResponse", targetNamespace = "http://example.org/sei")
- EchoResponse echo(@WebParam(name="EchoMessage", targetNamespace = "http://example.org/sei") Echo request);
+ @WebResult(name = "return")
+ String echo(@WebParam(name = "message") String message);
}
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/JAXWSBuilderTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/JAXWSBuilderTestCase.java 2007-05-22 19:45:49 UTC (rev 3196)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/JAXWSBuilderTestCase.java 2007-05-22 20:32:33 UTC (rev 3197)
@@ -23,7 +23,6 @@
// $Id: $
-import java.io.File;
import java.net.URL;
import javax.xml.namespace.QName;
@@ -49,36 +48,25 @@
}
/**
- * If the @WebService.targetNamespace
- * annotation is on a service implementation
- * bean that does NOT reference a service
- * endpoint interface (through the
- * endpointInterface annotation element),
- * the targetNamespace is used for both the
- * wsdl:portType and the wsdl:service (and
- * associated XML elements).
+ * If the @WebService.targetNamespace annotation is on a service implementation bean that does NOT reference a service
+ * endpoint interface (through the endpointInterface annotation element), the targetNamespace is used for both the
+ * wsdl:portType and the wsdl:service (and associated XML elements).
*
- * If the @WebService.targetNamespace
- * annotation is on a service implementation
- * bean that does reference a service endpoint
- * interface (through the endpointInterface
- * annotation element), the targetNamespace is
- * used for only the wsdl:service (and
+ * If the @WebService.targetNamespace annotation is on a service implementation bean that does reference a service endpoint
+ * interface (through the endpointInterface annotation element), the targetNamespace is used for only the wsdl:service (and
* associated XML elements).
- *
- * @throws Exception
*/
public void testSEIDerivedNamespaces() throws Exception
{
// Create the port
- URL wsdlURL = new File("resources/jaxws/metadata/WEB-INF/wsdl/TestService.wsdl").toURL();
- QName qname = new QName("http://example.org/impl", "TestService");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-metadata?wsdl");
+ QName qname = new QName("http://example.org/impl", "EndpointBeanService");
Service service = Service.create(wsdlURL, qname);
EndpointInterface port = service.getPort(EndpointInterface.class);
String helloWorld = "Hello world!";
- EchoResponse response = port.echo(new Echo(helloWorld));
- assertEquals(helloWorld, response.getMessage());
+ String response = port.echo(helloWorld);
+ assertEquals(helloWorld, response);
}
}
18 years, 11 months
JBossWS SVN: r3196 - trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-22 15:45:49 -0400 (Tue, 22 May 2007)
New Revision: 3196
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppGeneratorDeployer.java
Log:
Fix EJB3 security
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppGeneratorDeployer.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppGeneratorDeployer.java 2007-05-22 19:32:06 UTC (rev 3195)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppGeneratorDeployer.java 2007-05-22 19:45:49 UTC (rev 3196)
@@ -165,6 +165,16 @@
String beanAuthMethod = null;
WebContext anWebContext = (WebContext)ep.getTargetBeanClass().getAnnotation(WebContext.class);
+ if(anWebContext != null)
+ {
+ if (anWebContext.authMethod().length() > 0)
+ beanAuthMethod = anWebContext.authMethod();
+ if (anWebContext.transportGuarantee().length() > 0)
+ transportGuarantee = anWebContext.transportGuarantee();
+ if (anWebContext.secureWSDLAccess())
+ secureWSDLAccess = anWebContext.secureWSDLAccess();
+ }
+
UnifiedApplicationMetaData appMetaData = dep.getContext().getAttachment(UnifiedApplicationMetaData.class);
if (appMetaData != null && appMetaData.getBeanByEjbName(ejbName) != null)
{
@@ -177,15 +187,6 @@
secureWSDLAccess = pc.getSecureWSDLAccess();
}
}
- else if(anWebContext != null)
- {
- if (anWebContext.authMethod().length() > 0)
- beanAuthMethod = anWebContext.authMethod();
- if (anWebContext.transportGuarantee().length() > 0)
- transportGuarantee = anWebContext.transportGuarantee();
- if (anWebContext.secureWSDLAccess())
- secureWSDLAccess = anWebContext.secureWSDLAccess();
- }
if (beanAuthMethod != null || transportGuarantee != null)
{
18 years, 11 months
JBossWS SVN: r3195 - in trunk: integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services and 11 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-22 15:32:06 -0400 (Tue, 22 May 2007)
New Revision: 3195
Added:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/SecurityAdaptorImpl.java
trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/SecurityAdaptorImpl.java
trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptor.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/utils/FactoryLoader.java
Removed:
trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.extensions.security.SecurityAssociationAdaptorFactory
trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.integration.invocation.SecurityAssociationAdaptor
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAssociationAdaptor.java
trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java
trunk/integration/jbws/ant-import/build-deploy.xml
trunk/integration/jbws/build.xml
trunk/jbossws-core/ant-import-tests/build-testsuite.xml
trunk/jbossws-core/src/main/java/javax/xml/soap/MessageFactory.java
trunk/jbossws-core/src/main/java/javax/xml/soap/SAAJMetaFactory.java
trunk/jbossws-core/src/main/java/javax/xml/soap/SOAPFactory.java
trunk/jbossws-core/src/main/java/javax/xml/ws/spi/Provider.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/HttpServer.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
Log:
Fix jaxrpc wsse regression
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -40,12 +40,13 @@
import org.jboss.invocation.PayloadKey;
import org.jboss.logging.Logger;
import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.security.SecurityAssociation;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
import org.jboss.wsf.spi.invocation.AbstractInvocationHandler;
import org.jboss.wsf.spi.invocation.HandlerCallback;
import org.jboss.wsf.spi.invocation.Invocation;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.wsf.spi.utils.ObjectNameFactory;
@@ -126,9 +127,9 @@
{
log.debug("Invoke: " + inv.getJavaMethod().getName());
- // these are provided by the ServerLoginHandler
- Principal principal = SecurityAssociation.getPrincipal();
- Object credential = SecurityAssociation.getCredential();
+ SecurityAdaptor securityAdaptor = SecurityAdaptorFactory.getSecurityAdaptor();
+ Principal principal = securityAdaptor.getPrincipal();
+ Object credential = securityAdaptor.getCredential();
// invoke on the container
try
Added: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/SecurityAdaptorImpl.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/SecurityAdaptorImpl.java (rev 0)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/SecurityAdaptorImpl.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -0,0 +1,58 @@
+/*
+ * 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.wsf.container.jboss42;
+
+// $Id$
+
+import java.security.Principal;
+
+import org.jboss.security.SecurityAssociation;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+
+/**
+ * A JBoss specific SecurityAssociationAdaptor
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class SecurityAdaptorImpl implements SecurityAdaptor
+{
+ public Principal getPrincipal()
+ {
+ return SecurityAssociation.getPrincipal();
+ }
+
+ public void setPrincipal(Principal pricipal)
+ {
+ SecurityAssociation.setPrincipal(pricipal);
+ }
+
+ public Object getCredential()
+ {
+ return SecurityAssociation.getCredential();
+ }
+
+ public void setCredential(Object credential)
+ {
+ SecurityAssociation.setCredential(credential);
+ }
+}
Property changes on: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/SecurityAdaptorImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.extensions.security.SecurityAssociationAdaptorFactory
===================================================================
--- trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.extensions.security.SecurityAssociationAdaptorFactory 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.extensions.security.SecurityAssociationAdaptorFactory 2007-05-22 19:32:06 UTC (rev 3195)
@@ -1 +0,0 @@
-org.jboss.ws.integration.jboss42.jbossws.SecurityAssociationAdaptorFactoryImpl
\ No newline at end of file
Added: trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor
===================================================================
--- trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor (rev 0)
+++ trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor 2007-05-22 19:32:06 UTC (rev 3195)
@@ -0,0 +1 @@
+org.jboss.wsf.container.jboss42.SecurityAdaptorImpl
\ No newline at end of file
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -41,13 +41,14 @@
import org.jboss.logging.Logger;
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.security.SecurityContext;
-import org.jboss.security.SecurityContextUtil;
import org.jboss.security.plugins.SecurityContextAssociation;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
import org.jboss.wsf.spi.invocation.AbstractInvocationHandler;
import org.jboss.wsf.spi.invocation.HandlerCallback;
import org.jboss.wsf.spi.invocation.Invocation;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.wsf.spi.utils.ObjectNameFactory;
@@ -128,17 +129,17 @@
{
log.debug("Invoke: " + inv.getJavaMethod().getName());
- Principal principal = null;
- Object credential = null;
+ SecurityAdaptor securityAdaptor = SecurityAdaptorFactory.getSecurityAdaptor();
+ SecurityContext sc = SecurityContextAssociation.getSecurityContext();
+ Principal principal = securityAdaptor.getPrincipal();
+ Object credential = securityAdaptor.getCredential();
- SecurityContext securityContext = SecurityContextAssociation.getSecurityContext();
- if (securityContext != null)
- {
- SecurityContextUtil util = securityContext.getUtil();
- principal = util.getUserPrincipal();
- credential = util.getCredential();
- }
+ if (principal == null && sc != null)
+ principal = sc.getUtil().getUserPrincipal();
+ if (credential == null && sc != null)
+ credential = sc.getUtil().getCredential();
+
// invoke on the container
try
{
Added: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/SecurityAdaptorImpl.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/SecurityAdaptorImpl.java (rev 0)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/SecurityAdaptorImpl.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -0,0 +1,58 @@
+/*
+ * 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.wsf.container.jboss50;
+
+// $Id$
+
+import java.security.Principal;
+
+import org.jboss.security.SecurityAssociation;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+
+/**
+ * A JBoss specific SecurityAssociationAdaptor
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class SecurityAdaptorImpl implements SecurityAdaptor
+{
+ public Principal getPrincipal()
+ {
+ return SecurityAssociation.getPrincipal();
+ }
+
+ public void setPrincipal(Principal pricipal)
+ {
+ SecurityAssociation.setPrincipal(pricipal);
+ }
+
+ public Object getCredential()
+ {
+ return SecurityAssociation.getCredential();
+ }
+
+ public void setCredential(Object credential)
+ {
+ SecurityAssociation.setCredential(credential);
+ }
+}
Property changes on: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/SecurityAdaptorImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.integration.invocation.SecurityAssociationAdaptor
===================================================================
--- trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.integration.invocation.SecurityAssociationAdaptor 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.integration.invocation.SecurityAssociationAdaptor 2007-05-22 19:32:06 UTC (rev 3195)
@@ -1 +0,0 @@
-org.jboss.ws.integration.jboss50.SecurityAssociationAdaptorFactoryImpl
\ No newline at end of file
Added: trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor
===================================================================
--- trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor (rev 0)
+++ trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor 2007-05-22 19:32:06 UTC (rev 3195)
@@ -0,0 +1 @@
+org.jboss.wsf.container.jboss50.SecurityAdaptorImpl
\ No newline at end of file
Modified: trunk/integration/jbws/ant-import/build-deploy.xml
===================================================================
--- trunk/integration/jbws/ant-import/build-deploy.xml 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/integration/jbws/ant-import/build-deploy.xml 2007-05-22 19:32:06 UTC (rev 3195)
@@ -45,6 +45,9 @@
<fileset dir="${spi.dir}/output/lib">
<include name="jbossws-spi.jar"/>
</fileset>
+ <fileset dir="${int.jboss50.dir}/output/lib">
+ <include name="jbossws-jboss50.jar"/>
+ </fileset>
<fileset dir="${core.dir}/output/lib">
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
@@ -79,6 +82,7 @@
<include name="jbossws-wsconsume-impl.jar"/>
</fileset>
<fileset dir="${jboss50.home}/server/${jboss.server.instance}/lib">
+ <include name="jbossws-jboss50.jar"/>
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
@@ -117,6 +121,9 @@
</fileset>
</copy>
<copy todir="${jboss42.home}/server/${jboss.server.instance}/lib" overwrite="true">
+ <fileset dir="${int.jboss42.dir}/output/lib">
+ <include name="jbossws-jboss42.jar"/>
+ </fileset>
<fileset dir="${core.dir}/output/lib">
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
@@ -149,6 +156,7 @@
<include name="jbossws-spi.jar"/>
</fileset>
<fileset dir="${jboss42.home}/server/${jboss.server.instance}/lib">
+ <include name="jbossws-jboss42.jar"/>
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
Modified: trunk/integration/jbws/build.xml
===================================================================
--- trunk/integration/jbws/build.xml 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/integration/jbws/build.xml 2007-05-22 19:32:06 UTC (rev 3195)
@@ -135,9 +135,6 @@
<!-- Build jbossws-jbws50.deployer -->
<zip zipfile="${jbws.output.lib.dir}/jbossws-jbws50-deployer.zip">
- <fileset dir="${int.jboss50.dir}/output/lib">
- <include name="jbossws-jboss50.jar"/>
- </fileset>
<fileset dir="${jbws.resources.dir}/jbossws-jboss50.deployer">
<include name="META-INF/jbossws-deployer-beans.xml"/>
</fileset>
@@ -156,9 +153,6 @@
<!-- Build jbossws-jbws42.sar -->
<jar jarfile="${jbws.output.lib.dir}/jbossws-jbws42.sar" manifest="${jbws.output.etc.dir}/default.mf">
- <fileset dir="${int.jboss42.dir}/output/lib">
- <include name="jbossws-jboss42.jar"/>
- </fileset>
<fileset dir="${jbws.output.lib.dir}">
<include name="jbossws-context.war"/>
</fileset>
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptor.java (from rev 3187, trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAssociationAdaptor.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptor.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptor.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -0,0 +1,41 @@
+/*
+* 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.wsf.spi.invocation;
+
+// $Id$
+
+import java.security.Principal;
+
+/**
+ * A container idependent security adaptor
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2005
+ */
+public interface SecurityAdaptor
+{
+ Principal getPrincipal();
+ void setPrincipal(Principal pricipal);
+
+ Object getCredential();
+ void setCredential(Object credential);
+}
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -0,0 +1,44 @@
+/*
+ * 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.wsf.spi.invocation;
+
+// $Id$
+
+import org.jboss.wsf.spi.utils.FactoryLoader;
+
+/**
+ * A container idependent SecurityAdaptorFactory
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2005
+ */
+public final class SecurityAdaptorFactory
+{
+ public static SecurityAdaptor getSecurityAdaptor()
+ {
+ SecurityAdaptor securityAdaptor = (SecurityAdaptor)FactoryLoader.loadFactory(SecurityAdaptor.class.getName(), null);
+ if (securityAdaptor == null)
+ throw new IllegalStateException("Cannot load SecurityAdaptor");
+
+ return securityAdaptor;
+ }
+}
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAssociationAdaptor.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAssociationAdaptor.java 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAssociationAdaptor.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -1,38 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.wsf.spi.invocation;
-
-// $Id$
-
-import java.security.Principal;
-
-/**
- * A container idependent security adaptor
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-May-2005
- */
-public interface SecurityAssociationAdaptor
-{
- void setPrincipal(Principal pricipal);
- void setCredential(Object credential);
-}
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/utils/FactoryLoader.java (from rev 3187, trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/utils/FactoryLoader.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/utils/FactoryLoader.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -0,0 +1,197 @@
+/*
+ * 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.wsf.spi.utils;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Properties;
+
+import org.jboss.logging.Logger;
+
+// $Id$
+
+/**
+ * Load a factory using the factory lookup procedure
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 14-Dec-2006
+ */
+public class FactoryLoader
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(FactoryLoader.class);
+
+ private FactoryLoader()
+ {
+ }
+
+ /**
+ * Load a factory using this ordered lookup procedure
+ *
+ * 1. Use the system property
+ * 2. Use the properties file "lib/jaxm.properties" in the JRE directory
+ * 3. Use the Services API (as detailed in the JAR specification), if available, to determine the classname
+ * 4. Use the default factory implementation class
+ *
+ * @return the factory impl, or null
+ */
+ public static Object loadFactory(String propertyName, String defaultFactory)
+ {
+ Object factory = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ // Use the system property
+ PrivilegedAction action = new PropertyAccessAction(propertyName);
+ String factoryName = (String)AccessController.doPrivileged(action);
+ if (factoryName != null)
+ {
+ try
+ {
+ if(log.isDebugEnabled()) log.debug("Load from system property: " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+
+ // Use the properties file "lib/jaxm.properties" in the JRE directory.
+ // This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
+ if (factory == null)
+ {
+ action = new PropertyAccessAction("java.home");
+ String javaHome = (String)AccessController.doPrivileged(action);
+ File jaxmFile = new File(javaHome + "/lib/jaxm.properties");
+ if (jaxmFile.exists())
+ {
+ try
+ {
+ action = new PropertyFileAccessAction(jaxmFile.getCanonicalPath());
+ Properties jaxmProperties = (Properties)AccessController.doPrivileged(action);
+ factoryName = jaxmProperties.getProperty(propertyName);
+ if (factoryName != null)
+ {
+ if(log.isDebugEnabled()) log.debug("Load from " + jaxmFile + ": " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+ }
+
+ // Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
+ if (factory == null)
+ {
+ String filename = "META-INF/services/" + propertyName;
+ InputStream inStream = loader.getResourceAsStream(filename);
+ if (inStream != null)
+ {
+ try
+ {
+ BufferedReader br = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
+ factoryName = br.readLine();
+ br.close();
+ if (factoryName != null)
+ {
+ if(log.isTraceEnabled()) log.trace("Load from Service API " + filename + ": " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+ }
+
+ // Use the default factory implementation class.
+ if (factory == null && defaultFactory != null)
+ {
+ try
+ {
+ factoryName = defaultFactory;
+ if(log.isDebugEnabled()) log.debug("Load from default: " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+
+ return factory;
+ }
+
+ private static class PropertyAccessAction implements PrivilegedAction
+ {
+ private String name;
+
+ PropertyAccessAction(String name)
+ {
+ this.name = name;
+ }
+
+ public Object run()
+ {
+ return System.getProperty(name);
+ }
+ }
+
+ private static class PropertyFileAccessAction implements PrivilegedAction
+ {
+ private String filename;
+
+ PropertyFileAccessAction(String filename)
+ {
+ this.filename = filename;
+ }
+
+ public Object run()
+ {
+ try
+ {
+ InputStream inStream = new FileInputStream(filename);
+ Properties props = new Properties();
+ props.load(inStream);
+ return props;
+ }
+ catch (IOException ex)
+ {
+ throw new SecurityException("Cannot load properties: " + filename, ex);
+ }
+ }
+ }
+}
Modified: trunk/jbossws-core/ant-import-tests/build-testsuite.xml
===================================================================
--- trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-22 19:32:06 UTC (rev 3195)
@@ -34,7 +34,6 @@
<pathelement location="${core.dir}/output/lib/jboss-saaj.jar"/>
<pathelement location="${core.dir}/output/lib/jbossws-core.jar"/>
<pathelement location="${core.dir}/output/lib/jbossws-client.jar"/>
- <pathelement location="${core.dir}/../jbws-${jbossws.integration.target}/output/lib/jbossws-${jbossws.integration.target}.jar"/>
</path>
<!-- The combined compile classpath -->
@@ -64,6 +63,7 @@
<pathelement location="${jboss.server.lib}/hibernate3.jar"/>
<pathelement location="${jboss.server.lib}/jboss.jar"/>
<pathelement location="${jboss.server.lib}/jbosssx.jar"/>
+ <pathelement location="${jboss.server.lib}/jbossws-${jbossws.integration.target}.jar"/>
<pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi.jar"/>
<pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi-saaj.jar"/>
<pathelement location="${jboss.server.deploy}/juddi-service.sar/scout.jar"/>
Deleted: trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -1,197 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.soap;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Properties;
-
-import org.jboss.logging.Logger;
-
-// $Id$
-
-/**
- * Load a factory using the factory lookup procedure
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 14-Dec-2006
- */
-public class FactoryLoader
-{
- // provide logging
- private static Logger log = Logger.getLogger(FactoryLoader.class);
-
- private FactoryLoader()
- {
- }
-
- /**
- * Load a factory using this ordered lookup procedure
- *
- * 1. Use the system property
- * 2. Use the properties file "lib/jaxm.properties" in the JRE directory
- * 3. Use the Services API (as detailed in the JAR specification), if available, to determine the classname
- * 4. Use the default factory implementation class
- *
- * @return the factory impl, or null
- */
- public static Object loadFactory(String propertyName, String defaultFactory)
- {
- Object factory = null;
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
-
- // Use the system property
- PrivilegedAction action = new PropertyAccessAction(propertyName);
- String factoryName = (String)AccessController.doPrivileged(action);
- if (factoryName != null)
- {
- try
- {
- if(log.isDebugEnabled()) log.debug("Load from system property: " + factoryName);
- Class factoryClass = loader.loadClass(factoryName);
- factory = factoryClass.newInstance();
- }
- catch (Throwable t)
- {
- throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
- }
- }
-
- // Use the properties file "lib/jaxm.properties" in the JRE directory.
- // This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
- if (factory == null)
- {
- action = new PropertyAccessAction("java.home");
- String javaHome = (String)AccessController.doPrivileged(action);
- File jaxmFile = new File(javaHome + "/lib/jaxm.properties");
- if (jaxmFile.exists())
- {
- try
- {
- action = new PropertyFileAccessAction(jaxmFile.getCanonicalPath());
- Properties jaxmProperties = (Properties)AccessController.doPrivileged(action);
- factoryName = jaxmProperties.getProperty(propertyName);
- if (factoryName != null)
- {
- if(log.isDebugEnabled()) log.debug("Load from " + jaxmFile + ": " + factoryName);
- Class factoryClass = loader.loadClass(factoryName);
- factory = factoryClass.newInstance();
- }
- }
- catch (Throwable t)
- {
- throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
- }
- }
- }
-
- // Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
- if (factory == null)
- {
- String filename = "META-INF/services/" + propertyName;
- InputStream inStream = loader.getResourceAsStream(filename);
- if (inStream != null)
- {
- try
- {
- BufferedReader br = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
- factoryName = br.readLine();
- br.close();
- if (factoryName != null)
- {
- if(log.isTraceEnabled()) log.trace("Load from Service API " + filename + ": " + factoryName);
- Class factoryClass = loader.loadClass(factoryName);
- factory = factoryClass.newInstance();
- }
- }
- catch (Throwable t)
- {
- throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
- }
- }
- }
-
- // Use the default factory implementation class.
- if (factory == null && defaultFactory != null)
- {
- try
- {
- factoryName = defaultFactory;
- if(log.isDebugEnabled()) log.debug("Load from default: " + factoryName);
- Class factoryClass = loader.loadClass(factoryName);
- factory = factoryClass.newInstance();
- }
- catch (Throwable t)
- {
- throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
- }
- }
-
- return factory;
- }
-
- private static class PropertyAccessAction implements PrivilegedAction
- {
- private String name;
-
- PropertyAccessAction(String name)
- {
- this.name = name;
- }
-
- public Object run()
- {
- return System.getProperty(name);
- }
- }
-
- private static class PropertyFileAccessAction implements PrivilegedAction
- {
- private String filename;
-
- PropertyFileAccessAction(String filename)
- {
- this.filename = filename;
- }
-
- public Object run()
- {
- try
- {
- InputStream inStream = new FileInputStream(filename);
- Properties props = new Properties();
- props.load(inStream);
- return props;
- }
- catch (IOException ex)
- {
- throw new SecurityException("Cannot load properties: " + filename, ex);
- }
- }
- }
-}
Modified: trunk/jbossws-core/src/main/java/javax/xml/soap/MessageFactory.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/soap/MessageFactory.java 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/jbossws-core/src/main/java/javax/xml/soap/MessageFactory.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -24,6 +24,8 @@
import java.io.IOException;
import java.io.InputStream;
+import org.jboss.wsf.spi.utils.FactoryLoader;
+
/**
A factory for creating SOAPMessage objects.
Modified: trunk/jbossws-core/src/main/java/javax/xml/soap/SAAJMetaFactory.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/soap/SAAJMetaFactory.java 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/jbossws-core/src/main/java/javax/xml/soap/SAAJMetaFactory.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -21,7 +21,9 @@
*/
package javax.xml.soap;
+import org.jboss.wsf.spi.utils.FactoryLoader;
+
// $Id$
/**
Modified: trunk/jbossws-core/src/main/java/javax/xml/soap/SOAPFactory.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/soap/SOAPFactory.java 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/jbossws-core/src/main/java/javax/xml/soap/SOAPFactory.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -25,6 +25,7 @@
import javax.xml.namespace.QName;
+import org.jboss.wsf.spi.utils.FactoryLoader;
import org.w3c.dom.Element;
/** SOAPFactory is a factory for creating various objects that exist in the SOAP XML tree.
Modified: trunk/jbossws-core/src/main/java/javax/xml/ws/spi/Provider.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/ws/spi/Provider.java 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/jbossws-core/src/main/java/javax/xml/ws/spi/Provider.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -26,7 +26,6 @@
import java.util.List;
import javax.xml.namespace.QName;
-import javax.xml.soap.FactoryLoader;
import javax.xml.transform.Source;
import javax.xml.ws.Endpoint;
import javax.xml.ws.EndpointReference;
@@ -34,6 +33,7 @@
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import org.jboss.wsf.spi.utils.FactoryLoader;
import org.w3c.dom.Element;
/**
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/HttpServer.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/HttpServer.java 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/HttpServer.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -26,9 +26,10 @@
import java.util.HashMap;
import java.util.Map;
-import javax.xml.soap.FactoryLoader;
import javax.xml.ws.Endpoint;
+import org.jboss.wsf.spi.utils.FactoryLoader;
+
/**
* An abstract HTTP Server
*
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java 2007-05-22 19:32:06 UTC (rev 3195)
@@ -23,12 +23,11 @@
// $Id$
-import javax.xml.soap.FactoryLoader;
-
import org.jboss.ws.extensions.security.element.SecurityHeader;
import org.jboss.ws.extensions.security.element.Token;
import org.jboss.ws.extensions.security.element.UsernameToken;
-import org.jboss.wsf.spi.invocation.SecurityAssociationAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
import org.w3c.dom.Document;
public class ReceiveUsernameOperation implements TokenOperation
@@ -45,12 +44,7 @@
public void process(Document message, Token token) throws WSSecurityException
{
UsernameToken user = (UsernameToken)token;
- String propName = SecurityAssociationAdaptor.class.getName();
-
- SecurityAssociationAdaptor securityAdaptor = (SecurityAssociationAdaptor)FactoryLoader.loadFactory(propName, null);
- if (securityAdaptor == null)
- throw new WSSecurityException("Cannot load: " + propName);
-
+ SecurityAdaptor securityAdaptor = SecurityAdaptorFactory.getSecurityAdaptor();
securityAdaptor.setPrincipal(new SimplePrincipal(user.getUsername()));
securityAdaptor.setCredential(user.getPassword());
}
18 years, 11 months
JBossWS SVN: r3194 - in branches/jbossws-2.0/jbossws-tests: src/java/org/jboss/test/ws/jaxws/samples and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-22 15:17:16 -0400 (Tue, 22 May 2007)
New Revision: 3194
Added:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocLitEndpoint.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocLitEndpointImpl.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayload.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
Modified:
branches/jbossws-2.0/jbossws-tests/ant-import/build-samples-jaxws.xml
Log:
JAX-WS SwaRef examples, first cut
Modified: branches/jbossws-2.0/jbossws-tests/ant-import/build-samples-jaxws.xml
===================================================================
--- branches/jbossws-2.0/jbossws-tests/ant-import/build-samples-jaxws.xml 2007-05-22 19:16:54 UTC (rev 3193)
+++ branches/jbossws-2.0/jbossws-tests/ant-import/build-samples-jaxws.xml 2007-05-22 19:17:16 UTC (rev 3194)
@@ -175,7 +175,14 @@
<include name="org/jboss/test/ws/jaxws/samples/oneway/PingEndpointImpl.class"/>
</classes>
</war>
-
+
+ <!-- jaxws-samples-swaref -->
+ <jar jarfile="${tests.output.dir}/libs/jaxws-samples-swaref.jar">
+ <fileset dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/samples/swaref/Doc*.class"/>
+ </fileset>
+ </jar>
+
<!-- jaxws-samples-provider -->
<war warfile="${tests.output.dir}/libs/jaxws-samples-provider-jaxb.war" webxml="${tests.output.dir}/resources/jaxws/samples/provider/jaxb/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Added: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocLitEndpoint.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocLitEndpoint.java (rev 0)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocLitEndpoint.java 2007-05-22 19:17:16 UTC (rev 3194)
@@ -0,0 +1,18 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+import javax.jws.soap.SOAPBinding;
+import javax.ejb.Remote;
+
+@WebService(name="DocLitEndpoint")
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
+@Remote
+public interface DocLitEndpoint
+{
+ @WebMethod
+ void submitAttachment(DocumentPayload payload);
+
+ @WebMethod
+ DocumentPayload retrieveAttachment();
+}
Property changes on: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocLitEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocLitEndpointImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocLitEndpointImpl.java (rev 0)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocLitEndpointImpl.java 2007-05-22 19:17:16 UTC (rev 3194)
@@ -0,0 +1,22 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import javax.jws.WebService;
+import javax.ejb.Stateless;
+import javax.activation.DataHandler;
+
+@Stateless
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.swaref.DocLitEndpoint")
+public class DocLitEndpointImpl implements DocLitEndpoint
+{
+
+ public void submitAttachment(DocumentPayload payload)
+ {
+ System.out.println("Retrieved " + payload.getData().getContentType());
+ }
+
+ public DocumentPayload retrieveAttachment()
+ {
+ DataHandler data = new DataHandler("Plain text attachment", "text/plain");
+ return new DocumentPayload(data);
+ }
+}
Property changes on: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocLitEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayload.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayload.java (rev 0)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayload.java 2007-05-22 19:17:16 UTC (rev 3194)
@@ -0,0 +1,33 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class DocumentPayload
+{
+ private DataHandler data;
+
+ public DocumentPayload()
+ {
+ }
+
+ public DocumentPayload(DataHandler data)
+ {
+ this.data = data;
+ }
+
+ @XmlElement
+ @XmlAttachmentRef
+ public DataHandler getData()
+ {
+ return data;
+ }
+
+ public void setData(DataHandler data)
+ {
+ this.data = data;
+ }
+}
Property changes on: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayload.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java (rev 0)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2007-05-22 19:17:16 UTC (rev 3194)
@@ -0,0 +1,50 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import junit.framework.Test;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.StubExt;
+
+import javax.xml.ws.Service;
+import javax.xml.ws.BindingProvider;
+import javax.xml.namespace.QName;
+import javax.activation.DataHandler;
+import java.net.URL;
+
+/**
+ * TODO: same test with doclit wrapped, currently the scanner fails on generated wrapper
+ */
+public class SWARefTestCase extends JBossWSTest
+{
+ private String endpointURL = "http://" + getServerHost() + ":9090/DocLitEndpointImplService/DocLitEndpointImpl";
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(SWARefTestCase.class, "jaxws-samples-swaref.jar");
+ }
+
+ public void testSubmitAttachment() throws Exception {
+ DataHandler data = new DataHandler("Client data", "text/plain");
+
+ System.out.println(endpointURL);
+
+ Service service = Service.create(new URL(endpointURL+"?wsdl"), new QName("http://swaref.samples.jaxws.ws.test.jboss.org/","DocLitEndpointImplService"));
+ DocLitEndpoint port = service.getPort(DocLitEndpoint.class);
+
+ // tweak endpoint URL
+ BindingProvider provider = (BindingProvider)port;
+ provider.getRequestContext().put(
+ BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+ endpointURL
+ );
+
+ // disable chunked encoding
+ ((StubExt)port).setConfigName("HTTP 1.0 Client");
+
+ port.submitAttachment(new DocumentPayload(data));
+ }
+
+ public void testRetrieveAttachment() throws Exception {
+ // TODO: implement
+ }
+}
Property changes on: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
18 years, 11 months
JBossWS SVN: r3193 - branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/extensions/xop/jaxws.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-22 15:16:54 -0400 (Tue, 22 May 2007)
New Revision: 3193
Modified:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java
Log:
Scanner did miss swaref method annotations
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java 2007-05-22 19:16:19 UTC (rev 3192)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java 2007-05-22 19:16:54 UTC (rev 3193)
@@ -21,20 +21,18 @@
*/
package org.jboss.ws.extensions.xop.jaxws;
-import java.awt.Image;
+import org.jboss.ws.core.utils.JavaUtils;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.transform.Source;
+import java.awt.*;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
-import javax.activation.DataHandler;
-import javax.xml.bind.annotation.XmlMimeType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlAttachmentRef;
-import javax.xml.transform.Source;
-
-import org.jboss.ws.core.utils.JavaUtils;
-
/**
* Scans data types for MTOM and swaRef declarations.
* It basically searches for
@@ -75,7 +73,7 @@
*/
public AttachmentScanResult scan(Class xmlRoot)
{
- if( isJDKType(xmlRoot) )
+ if( isJDKType(xmlRoot) ) // TODO: this fails with wrapper beans
return null;
AttachmentScanResult result = null;
@@ -106,9 +104,7 @@
if(null == result) // try getter methods
{
- String mimeType = scanGetterAnnotation(xmlRoot, field);
- if(mimeType!=null)
- result = new AttachmentScanResult(mimeType, AttachmentScanResult.Type.XOP);
+ result = scanGetterAnnotation(xmlRoot, field);
}
// avoid recursive loops
@@ -158,17 +154,24 @@
return clazz.getPackage()!= null ? clazz.getPackage().getName().startsWith("java") : true;
}
- private static String scanGetterAnnotation(Class owner, Field field)
+ private static AttachmentScanResult scanGetterAnnotation(Class owner, Field field)
{
String getterMethodName = "get"+field.getName();
for(Method method : owner.getDeclaredMethods())
{
- if(method.getName().equalsIgnoreCase(getterMethodName)
- && method.isAnnotationPresent(XmlMimeType.class))
+ if(method.getName().equalsIgnoreCase(getterMethodName))
{
- XmlMimeType mimeTypeDecl = method.getAnnotation(XmlMimeType.class);
- return mimeTypeDecl.value();
+ if(method.isAnnotationPresent(XmlMimeType.class))
+ {
+ XmlMimeType mimeTypeDecl = method.getAnnotation(XmlMimeType.class);
+ return new AttachmentScanResult(mimeTypeDecl.value(), AttachmentScanResult.Type.XOP);
+ }
+ else if(method.isAnnotationPresent(XmlAttachmentRef.class))
+ {
+ return new AttachmentScanResult("application/octet-stream", AttachmentScanResult.Type.SWA_REF);
+ }
}
+
}
return null;
18 years, 11 months
JBossWS SVN: r3192 - branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-22 15:16:19 -0400 (Tue, 22 May 2007)
New Revision: 3192
Modified:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java
Log:
log package mime type
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java 2007-05-22 19:15:59 UTC (rev 3191)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java 2007-05-22 19:16:19 UTC (rev 3192)
@@ -106,7 +106,7 @@
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
- log.debug("doPost: " + req.getRequestURI());
+ log.debug("doPost: " + req.getRequestURI() + ", content-type=" + req.getContentType());
try
{
18 years, 11 months
JBossWS SVN: r3191 - in branches/jbossws-2.0/jbossws-core/src: java/org/jboss/ws/metadata/umdm and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-22 15:15:59 -0400 (Tue, 22 May 2007)
New Revision: 3191
Modified:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
branches/jbossws-2.0/jbossws-core/src/resources/jbossws.sar/META-INF/standard-jaxws-client-config.xml
Log:
Simple override for endpoint properties
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-05-22 18:27:12 UTC (rev 3190)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-05-22 19:15:59 UTC (rev 3191)
@@ -53,7 +53,7 @@
* Per default HTTP 1.1 chunked encoding is used.
* This may be ovverriden through {@link org.jboss.ws.metadata.config.EndpointProperty#CHUNKED_ENCODING_SIZE}.
* A chunksize value of zero disables chunked encoding.
- *
+ *
* @author Thomas.Diesler(a)jboss.org
* @author <a href="mailto:jason@stacksmash.com">Jason T. Greene</a>
*
@@ -116,9 +116,9 @@
this.closed = closed;
}
- /**
+ /**
* Sends the given message to the specified endpoint.
- *
+ *
* A null reqMessage signifies a HTTP GET request.
*/
public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException
@@ -143,7 +143,7 @@
{
timeout = callProps.get(StubExt.PROPERTY_CLIENT_TIMEOUT);
targetAddress = addURLParameter(targetAddress, "timeout", timeout.toString());
- }
+ }
}
else if (endpoint instanceof EndpointReference)
{
@@ -155,18 +155,18 @@
targetAddress = endpoint.toString();
}
- // setup remoting client
+ // remoting props may come from client config as well
+ mergeConfigContribution();
+
+ // setup remoting client
Map<String, Object> metadata = createRemotingMetaData(reqMessage, callProps);
Client client = createRemotingClient(endpoint, targetAddress, oneway);
- // remoting props may come from client config as well
- mergeConfigContribution();
-
try
{
if (log.isDebugEnabled())
log.debug("Remoting metadata: " + metadata);
-
+
// debug the outgoing message
MessageTrace.traceMessage("Outgoing Request Message", reqMessage);
@@ -196,7 +196,7 @@
{
if(timeout!=null && (th.getCause() instanceof SocketTimeoutException))
{
- throw new WSTimeoutException("Timeout after: " + timeout + "ms", new Long(timeout.toString()));
+ throw new WSTimeoutException("Timeout after: " + timeout + "ms", new Long(timeout.toString()));
}
IOException io = new IOException("Could not transmit message");
@@ -212,15 +212,15 @@
if(msgContext!=null)
{
Properties epmdProps = msgContext.getEndpointMetaData().getProperties();
- if(epmdProps.containsKey(EndpointProperty.CHUNKED_ENCODING_SIZE))
- {
- String chunkSizeValue = epmdProps.getProperty(EndpointProperty.CHUNKED_ENCODING_SIZE);
- int chunkSize = Integer.valueOf(chunkSizeValue);
- if(chunkSize>0)
- clientConfig.put(EndpointProperty.CHUNKED_ENCODING_SIZE, chunkSizeValue);
- else
- clientConfig.remove(EndpointProperty.CHUNKED_ENCODING_SIZE);
- }
+
+ // chunksize settings
+ String chunkSizeValue = epmdProps.getProperty(EndpointProperty.CHUNKED_ENCODING_SIZE);
+ int chunkSize = chunkSizeValue!=null ? Integer.valueOf(chunkSizeValue) : -1;
+ if(chunkSize>0)
+ clientConfig.put(EndpointProperty.CHUNKED_ENCODING_SIZE, chunkSizeValue);
+ else
+ clientConfig.remove("chunkedLength");
+
}
}
@@ -344,7 +344,7 @@
protected void populateHeaders(MessageAbstraction reqMessage, Map<String, Object> metadata)
{
MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
-
+
Properties props = new Properties();
metadata.put("HEADER", props);
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-05-22 18:27:12 UTC (rev 3190)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-05-22 19:15:59 UTC (rev 3191)
@@ -683,6 +683,7 @@
config = factory.getConfig(getRootFile(), getConfigName(), getConfigFile());
// arbitrary endpoint properties
+ getProperties().clear();
for(EndpointProperty p: config.getProperties())
{
getProperties().put(p.name.toString(), p.value);
Modified: branches/jbossws-2.0/jbossws-core/src/resources/jbossws.sar/META-INF/standard-jaxws-client-config.xml
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/resources/jbossws.sar/META-INF/standard-jaxws-client-config.xml 2007-05-22 18:27:12 UTC (rev 3190)
+++ branches/jbossws-2.0/jbossws-core/src/resources/jbossws.sar/META-INF/standard-jaxws-client-config.xml 2007-05-22 19:15:59 UTC (rev 3191)
@@ -2,7 +2,8 @@
<!-- $Id$ -->
-<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
<client-config>
@@ -15,6 +16,11 @@
</client-config>
<client-config>
+ <config-name>HTTP 1.0 Client</config-name>
+ <feature>http://org.jboss.ws/dispatch/validate</feature>
+ </client-config>
+
+ <client-config>
<config-name>Standard WSAddressing Client</config-name>
<post-handler-chains>
<javaee:handler-chain>
18 years, 11 months
JBossWS SVN: r3190 - trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-22 14:27:12 -0400 (Tue, 22 May 2007)
New Revision: 3190
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppGeneratorDeployer.java
Log:
Fix ejb21 secureWSDLAccess
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppGeneratorDeployer.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppGeneratorDeployer.java 2007-05-22 18:09:46 UTC (rev 3189)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppGeneratorDeployer.java 2007-05-22 18:27:12 UTC (rev 3190)
@@ -160,7 +160,7 @@
{
String ejbName = ep.getShortName();
- boolean secureWSDLAccess = false;
+ Boolean secureWSDLAccess = null;
String transportGuarantee = null;
String beanAuthMethod = null;
@@ -174,6 +174,7 @@
{
beanAuthMethod = pc.getAuthMethod();
transportGuarantee = pc.getTransportGuarantee();
+ secureWSDLAccess = pc.getSecureWSDLAccess();
}
}
else if(anWebContext != null)
@@ -206,7 +207,7 @@
Element wrc = securityConstraint.addElement("web-resource-collection");
wrc.addElement("web-resource-name").addText(ejbName);
wrc.addElement("url-pattern").addText(ep.getURLPattern());
- if (secureWSDLAccess)
+ if (Boolean.TRUE.equals(secureWSDLAccess))
{
wrc.addElement("http-method").addText("GET");
}
18 years, 11 months
JBossWS SVN: r3189 - trunk/build/eclipse.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-22 14:09:46 -0400 (Tue, 22 May 2007)
New Revision: 3189
Modified:
trunk/build/eclipse/jbossws.userlibraries
Log:
Include jboss-security-spi.jar
Modified: trunk/build/eclipse/jbossws.userlibraries
===================================================================
--- trunk/build/eclipse/jbossws.userlibraries 2007-05-22 18:00:47 UTC (rev 3188)
+++ trunk/build/eclipse/jbossws.userlibraries 2007-05-22 18:09:46 UTC (rev 3189)
@@ -31,7 +31,7 @@
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-j2se.jar"/>
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/jboss-javaee.jar"/>
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-system.jar"/>
-<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-system-jmx.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-system-jmx.jar" source="/home/tdiesler/svn/jbossas/trunk/system-jmx/src/main"/>
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-vfs.jar"/>
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/jboss.jar" source="/home/tdiesler/svn/jbossas/trunk/server/src/main"/>
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/jnpserver.jar"/>
@@ -44,5 +44,6 @@
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/ejb3.deployer/jboss-annotations-ejb3.jar"/>
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/ejb3.deployer/jboss-ejb3.jar"/>
<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/antlr.jar"/>
+<archive path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/jboss-security-spi.jar"/>
</library>
</eclipse-userlibraries>
18 years, 11 months
JBossWS SVN: r3188 - trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-22 14:00:47 -0400 (Tue, 22 May 2007)
New Revision: 3188
Removed:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/Hello.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/HelloService.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UserType.java
Log:
Remove duplicate java types
Deleted: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/Hello.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/Hello.java 2007-05-22 17:27:48 UTC (rev 3187)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/Hello.java 2007-05-22 18:00:47 UTC (rev 3188)
@@ -1,40 +0,0 @@
-
-package org.jboss.test.ws.jaxws.samples.wssecurity;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-
-/**
- * JBossWS Generated Source
- *
- * Generation Date: Mon May 21 19:38:54 CEST 2007
- *
- * This generated source code represents a derivative work of the input to
- * the generator that produced it. Consult the input for the copyright and
- * terms of use that apply to this source code.
- *
- * JAX-WS Version: 2.0
- *
- */
-@WebService(name = "Hello", targetNamespace = "http://org.jboss.ws/samples/wssecurity")
-@SOAPBinding(style = SOAPBinding.Style.RPC)
-public interface Hello {
-
-
- /**
- *
- * @param user
- * @return
- * returns org.jboss.test.ws.jaxws.samples.wssecurity.UserType
- */
- @WebMethod
- @WebResult(partName = "return")
- public UserType echoUserType(
- @WebParam(name = "user", partName = "user")
- UserType user);
-
-}
Deleted: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/HelloService.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/HelloService.java 2007-05-22 17:27:48 UTC (rev 3187)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/HelloService.java 2007-05-22 18:00:47 UTC (rev 3188)
@@ -1,59 +0,0 @@
-
-package org.jboss.test.ws.jaxws.samples.wssecurity;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebEndpoint;
-import javax.xml.ws.WebServiceClient;
-
-
-/**
- * JBossWS Generated Source
- *
- * Generation Date: Mon May 21 19:38:54 CEST 2007
- *
- * This generated source code represents a derivative work of the input to
- * the generator that produced it. Consult the input for the copyright and
- * terms of use that apply to this source code.
- *
- * JAX-WS Version: 2.0
- *
- */
-@WebServiceClient(name = "HelloService", targetNamespace = "http://org.jboss.ws/samples/wssecurity", wsdlLocation = "file:/home/tdiesler/svn/jbossws/trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurity/META-INF/wsdl/HelloService.wsdl")
-public class HelloService
- extends Service
-{
-
- private final static URL HELLOSERVICE_WSDL_LOCATION;
-
- static {
- URL url = null;
- try {
- url = new URL("file:/home/tdiesler/svn/jbossws/trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurity/META-INF/wsdl/HelloService.wsdl");
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
- HELLOSERVICE_WSDL_LOCATION = url;
- }
-
- public HelloService(URL wsdlLocation, QName serviceName) {
- super(wsdlLocation, serviceName);
- }
-
- public HelloService() {
- super(HELLOSERVICE_WSDL_LOCATION, new QName("http://org.jboss.ws/samples/wssecurity", "HelloService"));
- }
-
- /**
- *
- * @return
- * returns Hello
- */
- @WebEndpoint(name = "HelloPort")
- public Hello getHelloPort() {
- return (Hello)super.getPort(new QName("http://org.jboss.ws/samples/wssecurity", "HelloPort"), Hello.class);
- }
-
-}
Deleted: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UserType.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UserType.java 2007-05-22 17:27:48 UTC (rev 3187)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UserType.java 2007-05-22 18:00:47 UTC (rev 3188)
@@ -1,60 +0,0 @@
-
-package org.jboss.test.ws.jaxws.samples.wssecurity;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for UserType complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="UserType">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="msg" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "UserType", propOrder = {
- "msg"
-})
-public class UserType {
-
- protected String msg;
-
- /**
- * Gets the value of the msg property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getMsg() {
- return msg;
- }
-
- /**
- * Sets the value of the msg property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setMsg(String value) {
- this.msg = value;
- }
-
-}
18 years, 11 months