JBossWS SVN: r9685 - in stack/native/trunk/modules/testsuite/native-tests/src/test: resources/jaxws/jbws771 and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-03-25 09:38:33 -0400 (Wed, 25 Mar 2009)
New Revision: 9685
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws771/binding.xml
Log:
[JBWS-771][JBWS-2409] fixing jbws 771 binding file
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2009-03-25 11:19:51 UTC (rev 9684)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2009-03-25 13:38:33 UTC (rev 9685)
@@ -150,7 +150,7 @@
String absOutput = createResourceFile("wsconsume" + FS + "java").getAbsolutePath();
String command = JBOSS_HOME + FS + "bin" + FS + "wsconsume" + EXT + " -k -o " + absOutput + " --extension --binding=" + RESOURCES_DIR + FS + "jaxws" + FS + "jbws771" + FS + "binding.xml " + wsdlURL.toExternalForm();
executeCommand(command);
- File javaSource = getResourceFile("wsconsume" + FS + "java" + FS + "org" + FS + "jboss" + FS + "test" + FS + "ws" + FS + "jaxws" + FS + "jbws771" + FS + "JBWS771Service.java");
+ File javaSource = getResourceFile("wsconsume" + FS + "java" + FS + "foo" + FS + "bar" + FS + "com" + FS + "JBWS771Service.java");
assertTrue("Service endpoint interface not generated", javaSource.exists());
}
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws771/binding.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws771/binding.xml 2009-03-25 11:19:51 UTC (rev 9684)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws771/binding.xml 2009-03-25 13:38:33 UTC (rev 9685)
@@ -1,13 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<jaxws:bindings wsdlLocation="http://localhost:8080/jaxws-jbws771/IWebsvcImpl?wsdl"
- xmlns:jaxws="http://java.sun.com/xml/ns/jaxws/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+<jaxws:bindings
+ wsdlLocation="http://localhost:8080/jaxws-jbws771/IWebsvcImpl?wsdl"
+ xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+>
- <jaxws:bindings
- node="wsdl:definitions/wsdl:portType[@name='IWebsvc']/wsdl:operation[@name='cancel']">
- <jaxws:package name="foo.bar.com"/>
- <jaxws:parameter
- part="wsdl:definitions/wsdl:message[@name='IWebsvc_cancel']/wsdl:part[@name='parameters']"
- element="tns:cancel" name="cancelMessage"/>
- </jaxws:bindings>
+ <jaxws:package name="foo.bar.com"/>
+ <jaxws:bindings node="wsdl:definitions/wsdl:portType[@name='IWebsvc']/wsdl:operation[@name='cancel']">
+ <jaxws:parameter
+ part="wsdl:definitions/wsdl:message[@name='IWebsvc_cancel']/wsdl:part[@name='parameters']"
+ element="tns:cancel"
+ name="cancelMessage"
+ />
+ </jaxws:bindings>
+
</jaxws:bindings>
15 years, 2 months
JBossWS SVN: r9684 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-03-25 07:19:51 -0400 (Wed, 25 Mar 2009)
New Revision: 9684
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java
Log:
[JBWS-2405] applying user patch fixing WCF interoperability
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java 2009-03-25 10:30:19 UTC (rev 9683)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java 2009-03-25 11:19:51 UTC (rev 9684)
@@ -23,6 +23,8 @@
import java.io.IOException;
import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
@@ -40,6 +42,7 @@
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
+import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
@@ -63,6 +66,8 @@
*/
public class SOAPMessageImpl extends SOAPMessage implements SOAPMessageAbstraction
{
+ private static Logger log = Logger.getLogger(SOAPMessageImpl.class);
+
private boolean saveRequired = true;
private MimeHeaders mimeHeaders = new MimeHeaders();
private List<AttachmentPart> attachments = new LinkedList<AttachmentPart>();
@@ -128,26 +133,50 @@
public AttachmentPart getAttachmentByContentId(String cid) throws SOAPException
{
+ String cidDecoded = decode(cid);
+
for (AttachmentPart part : attachments)
{
- String contentId = part.getContentId();
- if (contentId.equals(cid))
+ String contentIdDecoded = decode(part.getContentId());
+ if (contentIdDecoded.equals(cidDecoded))
return part;
}
+
return null;
}
+
+ public String decode(String cid)
+ {
+ String cidDecoded = cid;
+
+ try
+ {
+ cidDecoded = URLDecoder.decode(cid, "UTF-8");
+ }
+ catch (UnsupportedEncodingException ex)
+ {
+ log.error("Cannot decode name for cid: " + ex);
+ }
+
+ return cidDecoded;
+ }
public AttachmentPart removeAttachmentByContentId(String cid)
{
- for (AttachmentPart part : attachments)
+ try
{
- String contentId = part.getContentId();
- if (contentId.equals(cid))
+ AttachmentPart part = getAttachmentByContentId(cid);
+ if (part != null)
{
attachments.remove(part);
return part;
}
}
+ catch (SOAPException ex)
+ {
+ // this used to not throw SOAPException
+ log.error("Ignore SOAPException: " + ex);
+ }
return null;
}
15 years, 2 months
JBossWS SVN: r9683 - stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-03-25 06:30:19 -0400 (Wed, 25 Mar 2009)
New Revision: 9683
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/JBWS2565TestCase.java
Log:
[JBWS-2565] fixing test comment
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/JBWS2565TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/JBWS2565TestCase.java 2009-03-25 10:13:21 UTC (rev 9682)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/JBWS2565TestCase.java 2009-03-25 10:30:19 UTC (rev 9683)
@@ -32,7 +32,7 @@
import org.jboss.wsf.test.JBossWSTestSetup;
/**
- * [JBWS-2565] Problems with security after moving from AS 4.2.x series to AS 5.0.x series
+ * [JBWS-2565] Wrong WebContext authMethod or transportGuarantee annotatoin field values are not detected at deploy time.
*
* @author richard.opalka(a)jboss.com
*/
15 years, 2 months
JBossWS SVN: r9682 - in stack/native/trunk/modules/testsuite/native-tests: src/test/java/org/jboss/test/ws/jaxws and 10 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-03-25 06:13:21 -0400 (Wed, 25 Mar 2009)
New Revision: 9682
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/JBWS2565TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/MyWebServiceBean.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/MyWebServiceBeanWrong.java
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/correct/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/correct/META-INF/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/correct/META-INF/application.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/correct/META-INF/jboss-app.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/wrong/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/wrong/META-INF/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/wrong/META-INF/application.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/wrong/META-INF/jboss-app.xml
Modified:
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/dar/DarAddressingEndpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/dar/DarEndpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperMTOMAS5Endpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperMTOMEndpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperSWAAS5Endpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperSWAEndpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/webserviceref/SecureEndpointImpl.java
Log:
[JBWS-2565] fixing tests to demonstrate best practices
Modified: stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-03-25 10:06:09 UTC (rev 9681)
+++ stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-03-25 10:13:21 UTC (rev 9682)
@@ -489,7 +489,37 @@
</classes>
</war>
- <!-- jaxws-webserviceref -->
+ <!-- jaxws-jbws2565 -->
+ <jar jarfile="${tests.output.dir}/test-libs/jaxws-jbws2565.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2565/MyWebServiceBean.class"/>
+ </fileset>
+ </jar>
+ <jar jarfile="${tests.output.dir}/test-libs/jaxws-jbws2565.ear">
+ <fileset dir="${tests.output.dir}/test-libs">
+ <include name="jaxws-jbws2565.jar"/>
+ </fileset>
+ <metainf dir="${tests.output.dir}/test-resources/jaxws/jbws2565/correct/META-INF">
+ <include name="application.xml"/>
+ <include name="jboss-app.xml"/>
+ </metainf>
+ </jar>
+ <jar jarfile="${tests.output.dir}/test-libs/jaxws-jbws2565-wrong.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2565/MyWebServiceBeanWrong.class"/>
+ </fileset>
+ </jar>
+ <jar jarfile="${tests.output.dir}/test-libs/jaxws-jbws2565-wrong.ear">
+ <fileset dir="${tests.output.dir}/test-libs">
+ <include name="jaxws-jbws2565-wrong.jar"/>
+ </fileset>
+ <metainf dir="${tests.output.dir}/test-resources/jaxws/jbws2565/wrong/META-INF">
+ <include name="application.xml"/>
+ <include name="jboss-app.xml"/>
+ </metainf>
+ </jar>
+
+ <!-- jaxws-webserviceref -->
<war warfile="${tests.output.dir}/test-libs/jaxws-webserviceref.war" webxml="${tests.output.dir}/test-resources/jaxws/webserviceref/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
<include name="org/jboss/test/ws/jaxws/webserviceref/TestEndpointImpl.class"/>
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/JBWS2565TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/JBWS2565TestCase.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/JBWS2565TestCase.java 2009-03-25 10:13:21 UTC (rev 9682)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws2565;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Call;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceFactory;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2565] Problems with security after moving from AS 4.2.x series to AS 5.0.x series
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class JBWS2565TestCase extends JBossWSTest
+{
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS2565TestCase.class, "jaxws-jbws2565.ear");
+ }
+
+ public void test() throws Exception
+ {
+ final ServiceFactory factory = ServiceFactory.newInstance();
+ final Service service = factory.createService(new QName("http://my.services.web", "MyWebServiceName"));
+ final Call call = service.createCall(new QName("http://my.services.web", "MyWebServicePort"));
+ call.setTargetEndpointAddress("http://" + getServerHost() + ":8080/jaxws-jbws2565/MyWebServiceBean?wsdl");
+ call.setOperationName(new QName("http://my.services.web", "doStuff"));
+ final QName QNAME_TYPE_STRING = new QName("http://www.w3.org/2001/XMLSchema", "string");
+ call.setReturnType(QNAME_TYPE_STRING);
+ final String[] serviceArgs = {};
+ final String result = (String) call.invoke(serviceArgs);
+ assertEquals("i've done stuff", result);
+ }
+
+ public void testWrongArchiveDeployment() throws Exception
+ {
+ try
+ {
+ this.deploy("jaxws-jbws2565-wrong.ear");
+ fail("Deployment of this archive had to fail.");
+ }
+ catch (Exception ignore)
+ {
+ log.error("Expected exception caught:" + ignore.getMessage(), ignore);
+ }
+ }
+
+}
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/MyWebServiceBean.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/MyWebServiceBean.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/MyWebServiceBean.java 2009-03-25 10:13:21 UTC (rev 9682)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws2565;
+
+import javax.annotation.security.PermitAll;
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
+import org.jboss.wsf.spi.annotation.WebContext;
+
+@Stateless
+@PermitAll
+@WebService
+(
+ name = "MyWebService",
+ targetNamespace = "http://my.services.web",
+ serviceName = "MyWebServiceName"
+)
+@WebContext
+(
+ contextRoot = "/jaxws-jbws2565",
+ transportGuarantee = TransportGuarantee.NONE
+)
+@SOAPBinding
+(
+ use = SOAPBinding.Use.LITERAL,
+ style = SOAPBinding.Style.DOCUMENT,
+ parameterStyle = SOAPBinding.ParameterStyle.WRAPPED
+)
+public final class MyWebServiceBean
+{
+ @WebMethod
+ @PermitAll
+ public final String doStuff()
+ {
+ return "i've done stuff";
+ }
+}
\ No newline at end of file
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/MyWebServiceBeanWrong.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/MyWebServiceBeanWrong.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2565/MyWebServiceBeanWrong.java 2009-03-25 10:13:21 UTC (rev 9682)
@@ -0,0 +1,43 @@
+/**
+ *
+ */
+package org.jboss.test.ws.jaxws.jbws2565;
+
+import javax.annotation.security.PermitAll;
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
+import org.jboss.wsf.spi.annotation.WebContext;
+
+@Stateless
+@PermitAll
+@WebService
+(
+ name = "MyWebService",
+ targetNamespace = "http://my.services.web",
+ serviceName = "MyWebServiceName"
+)
+@WebContext
+(
+ contextRoot = "/jaxws-jbws2565-wrong",
+ transportGuarantee = TransportGuarantee.NONE,
+ authMethod = "NONE" // this is wrong value, deployment should be rejected
+)
+@SOAPBinding
+(
+ use = SOAPBinding.Use.LITERAL,
+ style = SOAPBinding.Style.DOCUMENT,
+ parameterStyle = SOAPBinding.ParameterStyle.WRAPPED
+)
+public final class MyWebServiceBeanWrong
+{
+ @WebMethod
+ @PermitAll
+ public final String doStuff()
+ {
+ return "i've done stuff";
+ }
+}
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/dar/DarAddressingEndpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/dar/DarAddressingEndpoint.java 2009-03-25 10:06:09 UTC (rev 9681)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/dar/DarAddressingEndpoint.java 2009-03-25 10:13:21 UTC (rev 9682)
@@ -43,6 +43,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.annotation.EndpointConfig;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
@@ -53,16 +55,25 @@
* @since 31-Jan-2008
*/
@Stateless
-@WebService(name = "DarEndpoint",
- targetNamespace = "http://org.jboss.ws/samples/dar",
- serviceName = "DarService")
-@SOAPBinding(style = SOAPBinding.Style.RPC,
- use = SOAPBinding.Use.LITERAL)
-@WebContext(contextRoot="/dar",
- urlPattern="/*",
- authMethod="BASIC",
- transportGuarantee="NONE",
- secureWSDLAccess=false)
+@SOAPBinding
+(
+ style = SOAPBinding.Style.RPC,
+ use = SOAPBinding.Use.LITERAL
+)
+@WebService
+(
+ name = "DarEndpoint",
+ serviceName = "DarService",
+ targetNamespace = "http://org.jboss.ws/samples/dar"
+)
+@WebContext
+(
+ contextRoot = "/dar",
+ urlPattern = "/*",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.NONE,
+ secureWSDLAccess = false
+)
@EndpointConfig(configName = "Standard WSAddressing Endpoint")
public class DarAddressingEndpoint
{
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/dar/DarEndpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/dar/DarEndpoint.java 2009-03-25 10:06:09 UTC (rev 9681)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/dar/DarEndpoint.java 2009-03-25 10:13:21 UTC (rev 9682)
@@ -26,6 +26,8 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
/**
@@ -35,16 +37,25 @@
* @since 31-Jan-2008
*/
@Stateless
-@WebService(name = "DarEndpoint",
- targetNamespace = "http://org.jboss.ws/samples/dar",
- serviceName = "DarService")
-@SOAPBinding(style = SOAPBinding.Style.RPC,
- use = SOAPBinding.Use.LITERAL)
-@WebContext(contextRoot="/dar",
- urlPattern="/*",
- authMethod="BASIC",
- transportGuarantee="NONE",
- secureWSDLAccess=false)
+@SOAPBinding
+(
+ style = SOAPBinding.Style.RPC,
+ use = SOAPBinding.Use.LITERAL
+)
+@WebService
+(
+ name = "DarEndpoint",
+ serviceName = "DarService",
+ targetNamespace = "http://org.jboss.ws/samples/dar"
+)
+@WebContext
+(
+ contextRoot = "/dar",
+ urlPattern = "/*",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.NONE,
+ secureWSDLAccess = false
+)
public class DarEndpoint
{
@WebMethod(operationName = "process", action = "http://org.jboss.test.ws.jaxws.samples.dar/action/processIn")
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperMTOMAS5Endpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperMTOMAS5Endpoint.java 2009-03-25 10:06:09 UTC (rev 9681)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperMTOMAS5Endpoint.java 2009-03-25 10:13:21 UTC (rev 9682)
@@ -27,22 +27,32 @@
import javax.xml.ws.BindingType;
import org.jboss.ejb3.annotation.SecurityDomain;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
-
@Stateless
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.news.NewspaperMTOM",
- name = "NewspaperMTOMEndpoint",
- targetNamespace = "http://org.jboss.ws/samples/news",
- serviceName = "NewspaperMTOMService")
-@SOAPBinding(style = SOAPBinding.Style.RPC,
- use = SOAPBinding.Use.LITERAL)
@SecurityDomain("JBossWS")
-@WebContext(contextRoot="/news",
- urlPattern="/newspaper/mtom",
- authMethod="BASIC",
- transportGuarantee="CONFIDENTIAL",
- secureWSDLAccess=false)
+@SOAPBinding
+(
+ style = SOAPBinding.Style.RPC,
+ use = SOAPBinding.Use.LITERAL
+)
+@WebService
+(
+ name = "NewspaperMTOMEndpoint",
+ serviceName = "NewspaperMTOMService",
+ targetNamespace = "http://org.jboss.ws/samples/news",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.news.NewspaperMTOM"
+)
+@WebContext
+(
+ contextRoot = "/news",
+ urlPattern = "/newspaper/mtom",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.CONFIDENTIAL,
+ secureWSDLAccess = false
+)
@BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
public class SecureNewspaperMTOMAS5Endpoint extends AbstractNewspaperMTOMEndpoint implements NewspaperMTOM
{
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperMTOMEndpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperMTOMEndpoint.java 2009-03-25 10:06:09 UTC (rev 9681)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperMTOMEndpoint.java 2009-03-25 10:13:21 UTC (rev 9682)
@@ -27,22 +27,32 @@
import javax.xml.ws.BindingType;
import org.jboss.annotation.security.SecurityDomain;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
-
@Stateless
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.news.NewspaperMTOM",
- name = "NewspaperMTOMEndpoint",
- targetNamespace = "http://org.jboss.ws/samples/news",
- serviceName = "NewspaperMTOMService")
-@SOAPBinding(style = SOAPBinding.Style.RPC,
- use = SOAPBinding.Use.LITERAL)
@SecurityDomain("JBossWS")
-@WebContext(contextRoot="/news",
- urlPattern="/newspaper/mtom",
- authMethod="BASIC",
- transportGuarantee="CONFIDENTIAL",
- secureWSDLAccess=false)
+@SOAPBinding
+(
+ style = SOAPBinding.Style.RPC,
+ use = SOAPBinding.Use.LITERAL
+)
+@WebService
+(
+ name = "NewspaperMTOMEndpoint",
+ serviceName = "NewspaperMTOMService",
+ targetNamespace = "http://org.jboss.ws/samples/news",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.news.NewspaperMTOM"
+)
+@WebContext
+(
+ contextRoot = "/news",
+ urlPattern = "/newspaper/mtom",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.CONFIDENTIAL,
+ secureWSDLAccess = false
+)
@BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
public class SecureNewspaperMTOMEndpoint extends AbstractNewspaperMTOMEndpoint implements NewspaperMTOM
{
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperSWAAS5Endpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperSWAAS5Endpoint.java 2009-03-25 10:06:09 UTC (rev 9681)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperSWAAS5Endpoint.java 2009-03-25 10:13:21 UTC (rev 9682)
@@ -25,23 +25,33 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
import org.jboss.ejb3.annotation.SecurityDomain;
-
@Stateless
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.news.NewspaperSWA",
- name = "NewspaperSWAEndpoint",
- targetNamespace = "http://org.jboss.ws/samples/news",
- serviceName = "NewspaperSWAService")
-@SOAPBinding(style = SOAPBinding.Style.RPC,
- use = SOAPBinding.Use.LITERAL)
@SecurityDomain("JBossWS")
-@WebContext(contextRoot="/news",
- urlPattern="/newspaper/swa",
- authMethod="BASIC",
- transportGuarantee="CONFIDENTIAL",
- secureWSDLAccess=false)
+@SOAPBinding
+(
+ style = SOAPBinding.Style.RPC,
+ use = SOAPBinding.Use.LITERAL
+)
+@WebService
+(
+ name = "NewspaperSWAEndpoint",
+ serviceName = "NewspaperSWAService",
+ targetNamespace = "http://org.jboss.ws/samples/news",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.news.NewspaperSWA"
+)
+@WebContext
+(
+ contextRoot = "/news",
+ urlPattern = "/newspaper/swa",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.CONFIDENTIAL,
+ secureWSDLAccess = false
+)
public class SecureNewspaperSWAAS5Endpoint extends AbstractNewspaperSWAEndpoint implements NewspaperSWA
{
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperSWAEndpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperSWAEndpoint.java 2009-03-25 10:06:09 UTC (rev 9681)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewspaperSWAEndpoint.java 2009-03-25 10:13:21 UTC (rev 9682)
@@ -25,23 +25,33 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
import org.jboss.annotation.security.SecurityDomain;
-
@Stateless
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.news.NewspaperSWA",
- name = "NewspaperSWAEndpoint",
- targetNamespace = "http://org.jboss.ws/samples/news",
- serviceName = "NewspaperSWAService")
-@SOAPBinding(style = SOAPBinding.Style.RPC,
- use = SOAPBinding.Use.LITERAL)
@SecurityDomain("JBossWS")
-@WebContext(contextRoot="/news",
- urlPattern="/newspaper/swa",
- authMethod="BASIC",
- transportGuarantee="CONFIDENTIAL",
- secureWSDLAccess=false)
+@SOAPBinding
+(
+ style = SOAPBinding.Style.RPC,
+ use = SOAPBinding.Use.LITERAL
+)
+@WebService
+(
+ name = "NewspaperSWAEndpoint",
+ serviceName = "NewspaperSWAService",
+ targetNamespace = "http://org.jboss.ws/samples/news",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.news.NewspaperSWA"
+)
+@WebContext
+(
+ contextRoot = "/news",
+ urlPattern = "/newspaper/swa",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.CONFIDENTIAL,
+ secureWSDLAccess = false
+)
public class SecureNewspaperSWAEndpoint extends AbstractNewspaperSWAEndpoint implements NewspaperSWA
{
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/webserviceref/SecureEndpointImpl.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/webserviceref/SecureEndpointImpl.java 2009-03-25 10:06:09 UTC (rev 9681)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/webserviceref/SecureEndpointImpl.java 2009-03-25 10:13:21 UTC (rev 9682)
@@ -30,15 +30,28 @@
import org.jboss.ejb3.annotation.SecurityDomain;
import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
-@WebService(name = "SecureEndpoint", serviceName = "SecureEndpointService", targetNamespace = "http://org.jboss.ws/wsref")
@Stateless(name = "SecureEndpoint")
@SOAPBinding(style = Style.RPC)
-
-@WebContext(contextRoot="/jaxws-webserviceref-secure", urlPattern="/*", authMethod = "BASIC", transportGuarantee = "NONE", secureWSDLAccess = false)
@SecurityDomain("JBossWS")
@RolesAllowed("friend")
+@WebService
+(
+ name = "SecureEndpoint",
+ serviceName = "SecureEndpointService",
+ targetNamespace = "http://org.jboss.ws/wsref"
+)
+@WebContext
+(
+ contextRoot="/jaxws-webserviceref-secure",
+ urlPattern="/*",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.NONE,
+ secureWSDLAccess = false
+)
public class SecureEndpointImpl
{
// Provide logging
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/correct/META-INF/application.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/correct/META-INF/application.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/correct/META-INF/application.xml 2009-03-25 10:13:21 UTC (rev 9682)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
+ version="5">
+ <display-name>JBWS-2565</display-name>
+ <module>
+ <ejb>jaxws-jbws2565.jar</ejb>
+ </module>
+</application>
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/correct/META-INF/jboss-app.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/correct/META-INF/jboss-app.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/correct/META-INF/jboss-app.xml 2009-03-25 10:13:21 UTC (rev 9682)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss-app
+ PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd">
+<jboss-app>
+</jboss-app>
\ No newline at end of file
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/wrong/META-INF/application.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/wrong/META-INF/application.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/wrong/META-INF/application.xml 2009-03-25 10:13:21 UTC (rev 9682)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
+ version="5">
+ <display-name>JBWS-2565</display-name>
+ <module>
+ <ejb>jaxws-jbws2565-wrong.jar</ejb>
+ </module>
+</application>
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/wrong/META-INF/jboss-app.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/wrong/META-INF/jboss-app.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2565/wrong/META-INF/jboss-app.xml 2009-03-25 10:13:21 UTC (rev 9682)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss-app
+ PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd">
+<jboss-app>
+</jboss-app>
\ No newline at end of file
15 years, 2 months
JBossWS SVN: r9681 - in framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws: jbws1845 and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-03-25 06:06:09 -0400 (Wed, 25 Mar 2009)
New Revision: 9681
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1799/UserAccountService.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1799/UserAccountServiceExt.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1845/SpamComplaintWS.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointAS5Impl.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl.java
Log:
[JBWS-2565] fixing tests to demonstrate best practices
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1799/UserAccountService.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1799/UserAccountService.java 2009-03-25 10:05:10 UTC (rev 9680)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1799/UserAccountService.java 2009-03-25 10:06:09 UTC (rev 9681)
@@ -25,6 +25,7 @@
import javax.ejb.TransactionAttribute;
import javax.jws.WebService;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
/**
@@ -37,15 +38,15 @@
@Stateless
@WebService
(
- targetNamespace="namespace1",
- serviceName="UserAccountService1.0",
- endpointInterface="org.jboss.test.ws.jaxws.jbws1799.IUserAccountService"
+ targetNamespace = "namespace1",
+ serviceName = "UserAccountService1.0",
+ endpointInterface = "org.jboss.test.ws.jaxws.jbws1799.IUserAccountService"
)
@WebContext
(
- transportGuarantee="NONE",
- contextRoot="/svc-useracctv1.0",
- urlPattern="/UserAccountService1.0"
+ transportGuarantee = TransportGuarantee.NONE,
+ contextRoot = "/svc-useracctv1.0",
+ urlPattern = "/UserAccountService1.0"
)
public class UserAccountService implements IUserAccountService
{
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1799/UserAccountServiceExt.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1799/UserAccountServiceExt.java 2009-03-25 10:05:10 UTC (rev 9680)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1799/UserAccountServiceExt.java 2009-03-25 10:06:09 UTC (rev 9681)
@@ -27,6 +27,7 @@
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
/**
@@ -39,21 +40,21 @@
@Stateless
@WebService
(
- targetNamespace="namespaceExt",
- serviceName="UserAccountServiceExt1.0",
- endpointInterface="org.jboss.test.ws.jaxws.jbws1799.IUserAccountServiceExt"
+ targetNamespace = "namespaceExt",
+ serviceName = "UserAccountServiceExt1.0",
+ endpointInterface = "org.jboss.test.ws.jaxws.jbws1799.IUserAccountServiceExt"
)
@WebContext
(
- transportGuarantee="NONE",
- contextRoot="/svc-useracctv1.0",
- urlPattern="/UserAccountServiceExt1.0"
+ transportGuarantee = TransportGuarantee.NONE,
+ contextRoot = "/svc-useracctv1.0",
+ urlPattern = "/UserAccountServiceExt1.0"
)
public class UserAccountServiceExt implements IUserAccountServiceExt
{
@TransactionAttribute(javax.ejb.TransactionAttributeType.SUPPORTS)
- @RequestWrapper(className="org.jboss.test.ws.jaxws.jbws1799.jaxws.Authenticate1")
- @ResponseWrapper(className="org.jboss.test.ws.jaxws.jbws1799.jaxws.Authenticate1Response")
+ @RequestWrapper(className = "org.jboss.test.ws.jaxws.jbws1799.jaxws.Authenticate1")
+ @ResponseWrapper(className = "org.jboss.test.ws.jaxws.jbws1799.jaxws.Authenticate1Response")
public boolean authenticate(String username, String password)
{
return "authorized".equals(username) && "password".equals(password);
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1845/SpamComplaintWS.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1845/SpamComplaintWS.java 2009-03-25 10:05:10 UTC (rev 9680)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1845/SpamComplaintWS.java 2009-03-25 10:06:09 UTC (rev 9681)
@@ -25,6 +25,7 @@
import javax.jws.WebService;
import javax.xml.ws.ResponseWrapper;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
/**
@@ -37,15 +38,15 @@
@Stateless
@WebService
(
- targetNamespace="http://service.responsys.com/rsystools/ws/SpamComplaintWS/1.0",
- serviceName="SpamService",
- endpointInterface="org.jboss.test.ws.jaxws.jbws1845.SpamComplaintWSIface"
+ serviceName = "SpamService",
+ targetNamespace = "http://service.responsys.com/rsystools/ws/SpamComplaintWS/1.0",
+ endpointInterface = "org.jboss.test.ws.jaxws.jbws1845.SpamComplaintWSIface"
)
@WebContext
(
- transportGuarantee="NONE",
- contextRoot="/jaxws-jbws1845",
- urlPattern="/SpamService"
+ transportGuarantee = TransportGuarantee.NONE,
+ contextRoot = "/jaxws-jbws1845",
+ urlPattern = "/SpamService"
)
public class SpamComplaintWS implements SpamComplaintWSIface
{
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2009-03-25 10:05:10 UTC (rev 9680)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2009-03-25 10:06:09 UTC (rev 9681)
@@ -38,14 +38,28 @@
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
-@WebService(name = "Endpoint", serviceName="EndpointService", targetNamespace = "http://org.jboss.ws/jaxws/context")
+@Stateless
@SOAPBinding(style = Style.RPC)
-@Stateless
-@WebContext(contextRoot = "/jaxws-samples-context", urlPattern = "/*", authMethod = "BASIC", transportGuarantee = "NONE", secureWSDLAccess = false)
+@WebService
+(
+ name = "Endpoint",
+ serviceName="EndpointService",
+ targetNamespace = "http://org.jboss.ws/jaxws/context"
+)
+@WebContext
+(
+ contextRoot = "/jaxws-samples-context",
+ urlPattern = "/*",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.NONE,
+ secureWSDLAccess = false
+)
// [JBWS-1339] @Security domain vs. <security-domain>
//@SecurityDomain("JBossWS")
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointAS5Impl.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointAS5Impl.java 2009-03-25 10:05:10 UTC (rev 9680)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointAS5Impl.java 2009-03-25 10:06:09 UTC (rev 9681)
@@ -30,13 +30,26 @@
import org.jboss.ejb3.annotation.SecurityDomain;
import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
-@WebService(name = "SecureEndpoint", serviceName = "SecureEndpointService", targetNamespace = "http://org.jboss.ws/securityDomain")
@Stateless(name = "SecureEndpoint")
@SOAPBinding(style = Style.RPC)
-
-@WebContext(contextRoot="/jaxws-securityDomain", urlPattern="/*", authMethod = "BASIC", transportGuarantee = "NONE", secureWSDLAccess = false)
+@WebService
+(
+ name = "SecureEndpoint",
+ serviceName = "SecureEndpointService",
+ targetNamespace = "http://org.jboss.ws/securityDomain"
+)
+@WebContext
+(
+ contextRoot="/jaxws-securityDomain",
+ urlPattern="/*",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.NONE,
+ secureWSDLAccess = false
+)
@SecurityDomain("JBossWS")
@RolesAllowed("friend")
public class SecureEndpointAS5Impl
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl.java 2009-03-25 10:05:10 UTC (rev 9680)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl.java 2009-03-25 10:06:09 UTC (rev 9681)
@@ -30,13 +30,26 @@
import org.jboss.annotation.security.SecurityDomain;
import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
-@WebService(name = "SecureEndpoint", serviceName = "SecureEndpointService", targetNamespace = "http://org.jboss.ws/securityDomain")
@Stateless(name = "SecureEndpoint")
@SOAPBinding(style = Style.RPC)
-
-@WebContext(contextRoot="/jaxws-securityDomain", urlPattern="/*", authMethod = "BASIC", transportGuarantee = "NONE", secureWSDLAccess = false)
+@WebService
+(
+ name = "SecureEndpoint",
+ serviceName = "SecureEndpointService",
+ targetNamespace = "http://org.jboss.ws/securityDomain"
+)
+@WebContext
+(
+ contextRoot="/jaxws-securityDomain",
+ urlPattern="/*",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.NONE,
+ secureWSDLAccess = false
+)
@SecurityDomain("JBossWS")
@RolesAllowed("friend")
public class SecureEndpointImpl
15 years, 2 months
JBossWS SVN: r9680 - in framework/trunk: src/main/java/org/jboss/wsf/framework/deployment and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-03-25 06:05:10 -0400 (Wed, 25 Mar 2009)
New Revision: 9680
Modified:
framework/trunk/pom.xml
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java
Log:
[JBWS-2565] fixing issue
Modified: framework/trunk/pom.xml
===================================================================
--- framework/trunk/pom.xml 2009-03-25 10:02:47 UTC (rev 9679)
+++ framework/trunk/pom.xml 2009-03-25 10:05:10 UTC (rev 9680)
@@ -26,7 +26,7 @@
<!-- Properties -->
<properties>
<jbossws.common.version>1.0.10-SNAPSHOT</jbossws.common.version>
- <jbossws.spi.version>1.1.0-SNAPSHOT</jbossws.spi.version>
+ <jbossws.spi.version>1.1.1-SNAPSHOT</jbossws.spi.version>
<jboss.common.version>1.2.1.GA</jboss.common.version>
<jbossxb.version>1.0.0.SP1</jbossxb.version>
</properties>
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java 2009-03-25 10:02:47 UTC (rev 9679)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java 2009-03-25 10:05:10 UTC (rev 9680)
@@ -21,6 +21,8 @@
*/
package org.jboss.wsf.framework.deployment;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
import org.jboss.wsf.spi.annotation.WebContext;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -71,6 +73,7 @@
{
Class implClass = ep.getTargetBeanClass();
WebContext anWebContext = (WebContext)implClass.getAnnotation(WebContext.class);
+ this.validateSecuritySettings(anWebContext);
if (anWebContext != null && anWebContext.contextRoot().length() > 0)
{
if (contextRoot != null && contextRoot.equals(anWebContext.contextRoot()) == false)
@@ -104,4 +107,13 @@
}
return contextRoot;
}
+
+ private void validateSecuritySettings(WebContext webCtx)
+ {
+ if (webCtx != null)
+ {
+ TransportGuarantee.valueOf(webCtx.transportGuarantee());
+ AuthMethod.valueOf(webCtx.authMethod());
+ }
+ }
}
15 years, 2 months
JBossWS SVN: r9679 - spi/trunk/src/main/java/org/jboss/wsf/spi/annotation.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-03-25 06:02:47 -0400 (Wed, 25 Mar 2009)
New Revision: 9679
Added:
spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/AuthMethod.java
spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/TransportGuarantee.java
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/WebContext.java
Log:
[JBWS-2565] providing helper classes
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/AuthMethod.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/AuthMethod.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/AuthMethod.java 2009-03-25 10:02:47 UTC (rev 9679)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.annotation;
+
+/**
+ * The authMethod is used to configure the authentication mechanism for the web service.
+ * As a prerequisite to gaining access to any web service which are protected by an
+ * authorization constraint, a user must have authenticated using the configured mechanism.
+ *
+ * @author ropalka(a)redhat.com
+ */
+public final class AuthMethod
+{
+
+ /**
+ * Basic authentication.
+ */
+ public static final String BASIC = "BASIC";
+ /**
+ * Client certificate based authentication.
+ */
+ public static final String CLIENT_CERT = "CLIENT-CERT";
+
+ /**
+ * Forbidden constructor.
+ */
+ private AuthMethod()
+ {
+ super();
+ }
+
+ /**
+ * Returns string representing correct auth method value.
+ * @param s string to convert, both lowercased and uppercased values are accepted
+ * @return correct auth method value
+ * @throws IllegalArgumentException if <b>s</b> is <b>null</b> or it contains unknown value.
+ */
+ public static String valueOf(final String s)
+ {
+ if (s != null)
+ {
+ if (s.equals(""))
+ {
+ return s;
+ }
+ if (s.equals(AuthMethod.BASIC))
+ {
+ return AuthMethod.BASIC;
+ }
+ if (s.equals(AuthMethod.CLIENT_CERT))
+ {
+ return AuthMethod.CLIENT_CERT;
+ }
+ }
+
+ throw new IllegalArgumentException("Illegal auth method value: " + s);
+ }
+
+}
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/TransportGuarantee.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/TransportGuarantee.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/TransportGuarantee.java 2009-03-25 10:02:47 UTC (rev 9679)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.annotation;
+
+/**
+ * The transportGuarantee specifies that the communication
+ * between client and server should be NONE, INTEGRAL, or
+ * CONFIDENTIAL. NONE means that the application does not require any
+ * transport guarantees. A value of INTEGRAL means that the application
+ * requires that the data sent between the client and server be sent in
+ * such a way that it can't be changed in transit. CONFIDENTIAL means
+ * that the application requires that the data be transmitted in a
+ * fashion that prevents other entities from observing the contents of
+ * the transmission. In most cases, the presence of the INTEGRAL or
+ * CONFIDENTIAL flag will indicate that the use of SSL is required.
+ *
+ * @author ropalka(a)redhat.com
+ */
+public final class TransportGuarantee
+{
+
+ /**
+ * Application does not require any transport guarantees.
+ */
+ public static final String NONE = "NONE";
+ /**
+ * Application requires that the data sent between the client and
+ * server be sent in such a way that it can't be changed in transit.
+ */
+ public static final String INTEGRAL = "INTEGRAL";
+ /**
+ * Application requires that the data be transmitted in a fashion that
+ * prevents other entities from observing the contents of the transmission.
+ */
+ public static final String CONFIDENTIAL = "CONFIDENTIAL";
+
+ /**
+ * Forbidden constructor.
+ */
+ private TransportGuarantee()
+ {
+ super();
+ }
+
+ /**
+ * Returns string representing correct transport guarantee value.
+ * @param s string to convert, both lowercased and uppercased values are accepted
+ * @return correct transport guarantee value
+ * @throws IllegalArgumentException if <b>s</b> is <b>null</b> or it contains unknown value.
+ */
+ public static String valueOf(final String s)
+ {
+ if (s != null)
+ {
+ if (s.equals(""))
+ {
+ return s;
+ }
+ if (s.equals(TransportGuarantee.NONE))
+ {
+ return TransportGuarantee.NONE;
+ }
+ if (s.equals(TransportGuarantee.INTEGRAL))
+ {
+ return TransportGuarantee.INTEGRAL;
+ }
+ if (s.equals(TransportGuarantee.CONFIDENTIAL))
+ {
+ return TransportGuarantee.CONFIDENTIAL;
+ }
+ }
+
+ throw new IllegalArgumentException("Illegal transport guarantee value: " + s);
+ }
+
+}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/WebContext.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/WebContext.java 2009-03-25 09:35:56 UTC (rev 9678)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/WebContext.java 2009-03-25 10:02:47 UTC (rev 9679)
@@ -35,7 +35,7 @@
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = { ElementType.TYPE })
public @interface WebContext {
-
+
/**
* The contextRoot element specifies the context root that the web service endpoint is deployed to.
* If it is not specified it will be derived from the deployment short name.
@@ -65,6 +65,8 @@
* constraint, a user must have authenticated using the configured mechanism.
*
* Legal values for this element are "BASIC", or "CLIENT-CERT".
+ *
+ * @see AuthMethod
*/
String authMethod() default "";
@@ -79,6 +81,8 @@
* fashion that prevents other entities from observing the contents of
* the transmission. In most cases, the presence of the INTEGRAL or
* CONFIDENTIAL flag will indicate that the use of SSL is required.
+ *
+ * @see TransportGuarantee
*/
String transportGuarantee() default "";
15 years, 2 months