JBossWS SVN: r17661 - in stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests: src/test/java/org/jboss/test/ws/jaxws/cxf and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-06-06 14:27:28 -0400 (Thu, 06 Jun 2013)
New Revision: 17661
Added:
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOne.java
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOneImpl.java
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwo.java
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwoImpl.java
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java
Modified:
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
Log:
More tests
Modified: stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-06-06 18:26:55 UTC (rev 17660)
+++ stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-06-06 18:27:28 UTC (rev 17661)
@@ -332,6 +332,17 @@
</manifest>
</jar>
+ <!-- jaxws-cxf-jbws3648 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-cxf-jbws3648.war" needxmlfile='false'>
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOneImpl.class"/>
+ <include name="org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwo*.class"/>
+ </classes>
+ <manifest>
+ <attribute name="Dependencies" value="org.jboss.ws.cxf.jbossws-cxf-client"/>
+ </manifest>
+ </war>
+
<!-- jaxws-cxf-logging -->
<jar destfile="${tests.output.dir}/test-libs/jaxws-cxf-logging.jar">
<fileset dir="${tests.output.dir}/test-classes">
Added: stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOne.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOne.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOne.java 2013-06-06 18:27:28 UTC (rev 17661)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.cxf.jbws3648;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "EndpointOne", targetNamespace = "http://org.jboss.ws.jaxws.cxf/jbws3648", serviceName = "ServiceOne")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface EndpointOne
+{
+ String echo(String input);
+}
Added: stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOneImpl.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOneImpl.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOneImpl.java 2013-06-06 18:27:28 UTC (rev 17661)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.cxf.jbws3648;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.stack.cxf.policy.PolicySets;
+
+@WebService(name = "EndpointOne", targetNamespace = "http://org.jboss.ws.jaxws.cxf/jbws3648", serviceName = "ServiceOne")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@PolicySets({"WS-RM_Policy_spec_example", "WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt", "WS-Addressing"})
+public class EndpointOneImpl
+{
+ @WebMethod
+ public String echo(String input)
+ {
+ Logger.getLogger(this.getClass()).info("echo: " + input);
+ return input;
+ }
+}
Added: stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwo.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwo.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwo.java 2013-06-06 18:27:28 UTC (rev 17661)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.cxf.jbws3648;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.wsf.stack.cxf.policy.PolicySets;
+
+@WebService(name = "EndpointTwo", targetNamespace = "http://org.jboss.ws.jaxws.cxf/jbws3648")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@PolicySets({"WS-RM_Policy_spec_example", "WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt", "WS-Addressing"})
+public interface EndpointTwo
+{
+ String echo(String input);
+}
Added: stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwoImpl.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwoImpl.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwoImpl.java 2013-06-06 18:27:28 UTC (rev 17661)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.cxf.jbws3648;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+
+@WebService(name = "EndpointTwo",
+ targetNamespace = "http://org.jboss.ws.jaxws.cxf/jbws3648",
+ serviceName = "ServiceTwo",
+ endpointInterface = "org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointTwo")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class EndpointTwoImpl implements EndpointTwo
+{
+ @WebMethod
+ public String echo(String input)
+ {
+ Logger.getLogger(this.getClass()).info("echo: " + input);
+ return input;
+ }
+}
Added: stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java 2013-06-06 18:27:28 UTC (rev 17661)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.cxf.jbws3648;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ *
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 06-Jun-2013
+ */
+public class PolicyAttachmentWSDLTestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(PolicyAttachmentWSDLTestCase.class, "jaxws-cxf-jbws3648.war");
+ }
+
+ public void testEndpointOneWSDL() throws Exception {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jbws3648/ServiceOne" + "?wsdl");
+ checkPolicyAttachments(wsdlURL, new String[]{"WS-RM_Policy_spec_example",
+ "WS-SP-EX223_binding_policy",
+ "WS-SP-EX223_Binding_Operation_Input_Policy",
+ "WS-SP-EX223_Binding_Operation_Output_Policy",
+ "WS-Addressing_binding_policy"});
+ }
+
+ public void testEndpointTwoWSDL() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jbws3648/ServiceTwo" + "?wsdl");
+ checkPolicyAttachments(wsdlURL, new String[]{"WS-RM_Policy_spec_example",
+ "WS-SP-EX223_binding_policy",
+ "WS-SP-EX223_Binding_Operation_Input_Policy",
+ "WS-SP-EX223_Binding_Operation_Output_Policy",
+ "WS-Addressing_binding_policy"});
+ }
+
+ private void checkPolicyAttachments(URL wsdlURL, String[] refIds) throws Exception {
+ BufferedReader br = new BufferedReader(new InputStreamReader(wsdlURL.openStream(), "UTF-8"));
+ StringBuilder sb = new StringBuilder();
+ try {
+ String s;
+ while ((s = br.readLine()) != null) {
+ sb.append(s);
+ }
+ } finally {
+ br.close();
+ }
+ String wsdl = sb.toString();
+ for (String refId : refIds) {
+ assertTrue("WSDL does not contain '" + refId + "'", wsdl.contains(refId));
+ }
+ }
+
+}
10 years, 11 months
JBossWS SVN: r17660 - stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-06-06 14:26:55 -0400 (Thu, 06 Jun 2013)
New Revision: 17660
Modified:
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceIface.java
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceImpl.java
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java
Log:
Improving test
Modified: stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceIface.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceIface.java 2013-06-06 18:25:43 UTC (rev 17659)
+++ stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceIface.java 2013-06-06 18:26:55 UTC (rev 17660)
@@ -24,13 +24,10 @@
import javax.jws.WebMethod;
import javax.jws.WebService;
-import org.jboss.wsf.stack.cxf.policy.PolicySets;
-
@WebService
(
targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy"
)
-@PolicySets("AsymmetricBinding_X509v1_GCM192OAEP_ProtectTokens")
public interface AnnotatedServiceIface
{
@WebMethod
Modified: stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceImpl.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceImpl.java 2013-06-06 18:25:43 UTC (rev 17659)
+++ stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceImpl.java 2013-06-06 18:26:55 UTC (rev 17660)
@@ -25,6 +25,7 @@
import org.apache.cxf.annotations.EndpointProperties;
import org.apache.cxf.annotations.EndpointProperty;
+import org.jboss.wsf.stack.cxf.policy.PolicySets;
@WebService(
portName = "AnnotatedSecurityServicePort",
@@ -41,6 +42,7 @@
@EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback")
}
)
+@PolicySets("AsymmetricBinding_X509v1_GCM192OAEP_ProtectTokens")
public class AnnotatedServiceImpl implements AnnotatedServiceIface
{
public String sayHello()
Modified: stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java 2013-06-06 18:25:43 UTC (rev 17659)
+++ stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java 2013-06-06 18:26:55 UTC (rev 17660)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
import java.net.URL;
import javax.xml.namespace.QName;
@@ -48,6 +50,23 @@
return new JBossWSCXFTestSetup(AnnotatedSignEncryptTestCase.class, "jaxws-samples-wsse-policy-sign-encrypt-gcm-code-first.war jaxws-samples-wsse-policy-sign-encrypt-client.jar");
}
+ public void testWsdl() throws Exception
+ {
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ BufferedReader br = new BufferedReader(new InputStreamReader(wsdlURL.openStream(), "UTF-8"));
+ StringBuilder sb = new StringBuilder();
+ try {
+ String s;
+ while ((s = br.readLine()) != null) {
+ sb.append(s);
+ }
+ } finally {
+ br.close();
+ }
+ String wsdl = sb.toString();
+ assertTrue(wsdl.contains("AsymmetricBinding_X509v1_GCM192OAEP_ProtectTokens_binding_policy"));
+ }
+
public void test() throws Exception
{
QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "AnnotatedSecurityService");
10 years, 11 months
JBossWS SVN: r17659 - stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-06-06 14:25:43 -0400 (Thu, 06 Jun 2013)
New Revision: 17659
Added:
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-Addressing-BINDING.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-RM_Policy_spec_example-BINDING.xml
Modified:
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/org.jboss.wsf.stack.cxf.policy.PolicyAttachmentStore
Log:
Adding policy attachment fragments for ws-rm and ws-a
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-Addressing-BINDING.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-Addressing-BINDING.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-Addressing-BINDING.xml 2013-06-06 18:25:43 UTC (rev 17659)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-Addressing_binding_policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
+ xmlns:wsp="http://www.w3.org/ns/ws-policy">
+ <wsam:Addressing>
+ <wsp:Policy/>
+ </wsam:Addressing>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-RM_Policy_spec_example-BINDING.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-RM_Policy_spec_example-BINDING.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-RM_Policy_spec_example-BINDING.xml 2013-06-06 18:25:43 UTC (rev 17659)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-RM_Policy_spec_example_binding_policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy">
+ <wsrmp:RMAssertion xmlns:wsrmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy">
+ <wsrmp:InactivityTimeout Milliseconds="600000"/>
+ <wsrmp:BaseRetransmissionInterval Milliseconds="3000"/>
+ <wsrmp:ExponentialBackoff/>
+ <wsrmp:AcknowledgementInterval Milliseconds="200"/>
+ </wsrmp:RMAssertion>
+</wsp:Policy>
\ No newline at end of file
Modified: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/org.jboss.wsf.stack.cxf.policy.PolicyAttachmentStore
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/org.jboss.wsf.stack.cxf.policy.PolicyAttachmentStore 2013-06-06 18:24:57 UTC (rev 17658)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/org.jboss.wsf.stack.cxf.policy.PolicyAttachmentStore 2013-06-06 18:25:43 UTC (rev 17659)
@@ -3,4 +3,6 @@
WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt
WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt
WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt
-WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt
\ No newline at end of file
+WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt
+WS-RM_Policy_spec_example
+WS-Addressing
\ No newline at end of file
10 years, 11 months
JBossWS SVN: r17658 - in stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf: policy and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-06-06 14:24:57 -0400 (Thu, 06 Jun 2013)
New Revision: 17658
Modified:
stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicyAttachment.java
stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicySetsAnnotationListener.java
Log:
Misc fixes / additions
Modified: stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2013-06-06 09:46:13 UTC (rev 17657)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2013-06-06 18:24:57 UTC (rev 17658)
@@ -200,4 +200,8 @@
@LogMessage(level = DEBUG)
@Message(id = 24091, value = "Could not get WSDL from %s, aborting soap:address rewrite.")
void abortSoapAddressRewrite(String wsdlLocation, @Cause Throwable cause);
+
+ @LogMessage(level = INFO)
+ @Message(id = 24092, value = "Adding %s policy attachment with id='%s' to honor requirement from %s.")
+ void addingPolicyAttachment(Object placement, String refId, Class<?> cls);
}
Modified: stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java 2013-06-06 09:46:13 UTC (rev 17657)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java 2013-06-06 18:24:57 UTC (rev 17658)
@@ -211,4 +211,7 @@
@Message(id = 24090, value = "Could not read from config file: %s")
RuntimeException couldNotReadConfigFile(String file);
+ @Message(id = 24093, value = "Error parsing policy attachment: %s")
+ RuntimeException errorParsingPolicyAttachment(String uri, @Cause Throwable cause);
+
}
Modified: stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicyAttachment.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicyAttachment.java 2013-06-06 09:46:13 UTC (rev 17657)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicyAttachment.java 2013-06-06 18:24:57 UTC (rev 17658)
@@ -32,6 +32,7 @@
import org.apache.cxf.resource.ExtendedURIResolver;
import org.apache.cxf.staxutils.StaxUtils;
import org.apache.cxf.ws.policy.PolicyConstants;
+import org.jboss.wsf.stack.cxf.Messages;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -116,7 +117,7 @@
}
catch (Exception e)
{
- throw new RuntimeException(e);
+ throw Messages.MESSAGES.errorParsingPolicyAttachment(uri, e);
}
finally
{
Modified: stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicySetsAnnotationListener.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicySetsAnnotationListener.java 2013-06-06 09:46:13 UTC (rev 17657)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicySetsAnnotationListener.java 2013-06-06 18:24:57 UTC (rev 17658)
@@ -21,6 +21,8 @@
*/
package org.jboss.wsf.stack.cxf.policy;
+import static org.jboss.wsf.stack.cxf.Loggers.ROOT_LOGGER;
+
import java.lang.reflect.Method;
import java.net.URL;
import java.util.HashMap;
@@ -58,6 +60,7 @@
public class PolicySetsAnnotationListener implements FactoryBeanListener
{
private final Map<Class<?>, EndpointPolicyAttachments> epaMap = new HashMap<Class<?>, EndpointPolicyAttachments>(); //usare la SEI come class
+ private static final Logger LOG = Logger.getLogger(PolicySetsAnnotationListener.class);
private PolicyAttachmentStore store;
public PolicySetsAnnotationListener() {
@@ -96,21 +99,22 @@
case ENDPOINT_SELECTED : {
Class<?> cls = (Class<?>) args[2];
- //Class<?> implCls = (Class<?>) args[3];
+ Class<?> implCls = (Class<?>) args[3];
Endpoint ep = (Endpoint) args[1];
- if (ep.getEndpointInfo().getInterface() != null)
- {
- addPolicies(factory, ep, cls);
- }
+// if (ep.getEndpointInfo().getInterface() != null)
+// {
+// addPolicies(factory, ep, cls);
+// }
+ addPolicies(factory, ep, cls, implCls);
break;
}
- case INTERFACE_OPERATION_BOUND : { //TODO possibly remove either this block or next one
- OperationInfo inf = (OperationInfo) args[0];
- Method m = (Method) args[1];
- addPolicies(factory, inf, m);
- break;
- }
+// case INTERFACE_OPERATION_BOUND : { //TODO possibly remove either this block or next one
+// OperationInfo inf = (OperationInfo) args[0];
+// Method m = (Method) args[1];
+// addPolicies(factory, inf, m);
+// break;
+// }
case BINDING_OPERATION_CREATED :
BindingOperationInfo boi = (BindingOperationInfo) args[1];
@@ -153,9 +157,17 @@
}
}
- private void addPolicies(AbstractServiceFactoryBean factory, Endpoint ep, Class<?> cls)
+ private void addPolicies(AbstractServiceFactoryBean factory, Endpoint ep, Class<?> seiCls, Class<?> implCls)
{
- final EndpointPolicyAttachments epa = getEndpointPolicyAttachment(cls);
+ EndpointPolicyAttachments epa = null;
+ Class<?> cls = seiCls;
+ if (ep.getEndpointInfo().getInterface() != null) {
+ epa = getEndpointPolicyAttachment(seiCls);
+ }
+ if (epa == null) {
+ cls = implCls;
+ epa = getEndpointPolicyAttachment(implCls);
+ }
if (epa != null) {
final BindingInfo binf = ep.getBinding().getBindingInfo();
final ServiceInfo si = ep.getService().getServiceInfos().get(0);
@@ -219,27 +231,29 @@
private void addPolicy(AbstractPropertiesHolder place, ServiceInfo service, PolicyAttachment pa, Class<?> cls, String defName)
{
+ LOG.info("***** " + place + ", " + pa.getPlacement() + ", " + service + ", " + cls + ", " + defName);
Element el = addPolicy(service, pa, cls, defName);
- if (el != null)
- {
+// if (el != null)
+// {
UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
uee.setElement(el);
uee.setRequired(true);
uee.setElementType(DOMUtils.getElementQName(el));
place.addExtensor(uee);
- }
+// }
}
private Element addPolicy(ServiceInfo service, PolicyAttachment pa, Class<?> cls, String defName)
{
Element element = pa.read(defName);
- if (element == null)
- {
- return null;
- }
+// if (element == null)
+// {
+// return null;
+// }
// might have been updated on load policy
String refId = getPolicyId(element);
+ ROOT_LOGGER.addingPolicyAttachment(pa.getPlacement(), refId, cls);
if (service.getDescription() == null && cls != null)
{
10 years, 11 months
JBossWS SVN: r17657 - projects/wsi-bp-test/trunk.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2013-06-06 05:46:13 -0400 (Thu, 06 Jun 2013)
New Revision: 17657
Modified:
projects/wsi-bp-test/trunk/pom.xml
Log:
Cleanup and add eap610 profile
Modified: projects/wsi-bp-test/trunk/pom.xml
===================================================================
--- projects/wsi-bp-test/trunk/pom.xml 2013-06-06 09:29:22 UTC (rev 17656)
+++ projects/wsi-bp-test/trunk/pom.xml 2013-06-06 09:46:13 UTC (rev 17657)
@@ -521,12 +521,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${surefire.jvm.args} ${surefire.jvm.management.args} ${surefire.default-mgmt-serurity.args} -Djava.endorsed.dirs=${project.build.directory}/endorsed</argLine>
- <excludes>
- <!-- # [PLFED-390] PicketLink STS chokes on WS-Policy 1.5 tags -->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase*</exclude>
- <!--this broke the WSI-Analyzer-->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/*TestCase*</exclude>
- </excludes>
</configuration>
</plugin>
</plugins>
@@ -563,12 +557,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${surefire.jvm.args} ${surefire.jvm.management.args} ${surefire.default-mgmt-serurity.args} -Djava.endorsed.dirs=${project.build.directory}/endorsed</argLine>
- <excludes>
- <!-- # [PLFED-390] PicketLink STS chokes on WS-Policy 1.5 tags -->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase*</exclude>
- <!--this broke the WSI-Analyzer-->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/*TestCase*</exclude>
- </excludes>
</configuration>
</plugin>
</plugins>
@@ -598,13 +586,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${surefire.jvm.args} ${surefire.jvm.management.args} ${surefire.default-mgmt-serurity.args} -Djava.endorsed.dirs=${project.build.directory}/endorsed</argLine>
- <excludes>
- <!-- # [PLFED-390] PicketLink STS chokes on WS-Policy 1.5 tags -->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase*</exclude>
- <!--this broke the WSI-Analyzer-->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/*TestCase*</exclude>
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase</exclude>
- </excludes>
</configuration>
</plugin>
</plugins>
@@ -613,10 +594,10 @@
<profile>
- <id>jboss800</id>
+ <id>wildfly800</id>
<properties>
- <jboss.version>${jboss800.version}</jboss.version>
- <jbossws.integration.target>jboss800</jbossws.integration.target>
+ <jboss.version>${wildfly800.version}</jboss.version>
+ <jbossws.integration.target>wildfly800</jbossws.integration.target>
</properties>
<dependencies>
<dependency>
@@ -645,7 +626,52 @@
</build>
</profile>
+
<!--
+ Name: EAP 6.1.0.GA
+ -->
+ <profile>
+ <id>eap610</id>
+ <properties>
+ <jbossws.cxf.version>4.1.3.Final-redhat-1</jbossws.cxf.version>
+ <jbossws.shared.testsuite.version>4.0.7.GA-redhat-1</jbossws.shared.testsuite.version>
+ <gnu.getopt.version>1.0.13-redhat-2</gnu.getopt.version>
+ <log4j.version>1.2.16-redhat-2</log4j.version>
+ <jboss720.version>7.2.0.Final</jboss720.version>
+ <ejb.api.version>1.0.1.Final</ejb.api.version>
+ <jaxb.api.version>1.0.3.Final</jaxb.api.version>
+ <jaxws.api.version>2.0.0.Final</jaxws.api.version>
+ <jsr181.api.version>1.0-MR1</jsr181.api.version>
+ <spring.version>3.0.7.RELEASE</spring.version>
+ <picketlink.version>2.1.6.Final-redhat-1</picketlink.version>
+ <org.slf4j.version>1.7.2-redhat-1</org.slf4j.version>
+ <jboss.version>${jboss720.version}</jboss.version>
+ <jbossws.integration.target>jboss720</jbossws.integration.target>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-webservices-tests-integration</artifactId>
+ <version>${jboss.version}</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} ${surefire.default-mgmt-serurity.args} -Djava.endorsed.dirs=${project.build.directory}/endorsed</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+
+
+
+
+ <!--
Name: no-jboss-bind-address
Descr: Set the default jboss.bind.address
10 years, 11 months
JBossWS SVN: r17656 - in projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12: basedoc and 11 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2013-06-06 05:29:22 -0400 (Thu, 06 Jun 2013)
New Revision: 17656
Added:
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/common/
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/common/BP12TestCase.java
Modified:
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/basedoc/BaseTypesDocTestCase.java
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/basedoc/utf16/BaseTypesDocTestCase.java
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/baserpc/BaseTypesRPCTestCase.java
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/complexdoc/ComplexTypesDocTestCase.java
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/complexrpc/ComplexTypesRPCTestCase.java
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/Test1189TestCase.java
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/anon/Test1189AnonTestCase.java
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/nonanon/Test1189NonAnonTestCase.java
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1190/Test119XTestCase.java
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1197/Test1197TestCase.java
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/Test1198TestCase.java
Log:
Refactor Bp12 tests to allow use -Dproxy.address to specify the logger proxy server address
Modified: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/basedoc/BaseTypesDocTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/basedoc/BaseTypesDocTestCase.java 2013-06-06 09:26:01 UTC (rev 17655)
+++ projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/basedoc/BaseTypesDocTestCase.java 2013-06-06 09:29:22 UTC (rev 17656)
@@ -34,12 +34,13 @@
import junit.framework.Test;
+import org.jboss.test.ws.jaxws.bp12.common.BP12TestCase;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-public class BaseTypesDocTestCase extends JBossWSTest
+
+public class BaseTypesDocTestCase extends BP12TestCase
{
- private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp12basedoc/BPBaseDoc";
+ private final String serviceURL = "http://localhost:8080/jaxws-bp20basedoc/BPBaseDoc";
public static Test suite()
{
@@ -54,7 +55,7 @@
Service service = Service.create(wsdlURL, serviceName);
IBaseDataTypesDocLitW port = (IBaseDataTypesDocLitW) service.getPort(IBaseDataTypesDocLitW.class);
// invoke method
- ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:9090/jaxws-bp12basedoc/BPBaseDoc");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, PROXY_ADDRESS + "/jaxws-bp12basedoc/BPBaseDoc");
System.out.println("Invoking retInt...");
int _retInt_inInt = 10;
int _retInt__return = port.retInt(_retInt_inInt);
Modified: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/basedoc/utf16/BaseTypesDocTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/basedoc/utf16/BaseTypesDocTestCase.java 2013-06-06 09:26:01 UTC (rev 17655)
+++ projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/basedoc/utf16/BaseTypesDocTestCase.java 2013-06-06 09:29:22 UTC (rev 17656)
@@ -34,12 +34,12 @@
import junit.framework.Test;
+import org.jboss.test.ws.jaxws.bp12.common.BP12TestCase;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-public class BaseTypesDocTestCase extends JBossWSTest
+public class BaseTypesDocTestCase extends BP12TestCase
{
- private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp12basedoc-utf16/BPBaseDoc";
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp20basedoc-utf16/BPBaseDoc";
public static Test suite()
{
@@ -55,7 +55,7 @@
IBaseDataTypesDocLitW port = (IBaseDataTypesDocLitW) service.getPort(IBaseDataTypesDocLitW.class);
// invoke method
((BindingProvider)port).getRequestContext().put("org.apache.cxf.message.Message.ENCODING", "UTF-16");
- ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:9090/jaxws-bp12basedoc-utf16/BPBaseDoc");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, PROXY_ADDRESS + "/jaxws-bp12basedoc-utf16/BPBaseDoc");
System.out.println("Invoking retInt...");
int _retInt_inInt = 10;
int _retInt__return = port.retInt(_retInt_inInt);
Modified: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/baserpc/BaseTypesRPCTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/baserpc/BaseTypesRPCTestCase.java 2013-06-06 09:26:01 UTC (rev 17655)
+++ projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/baserpc/BaseTypesRPCTestCase.java 2013-06-06 09:29:22 UTC (rev 17656)
@@ -34,12 +34,12 @@
import junit.framework.Test;
+import org.jboss.test.ws.jaxws.bp12.common.BP12TestCase;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-public class BaseTypesRPCTestCase extends JBossWSTest
+public class BaseTypesRPCTestCase extends BP12TestCase
{
- private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp12baserpc/BPBaseRPC";
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp20baserpc/BPBaseRPC";
public static Test suite()
{
@@ -54,7 +54,7 @@
Service service = Service.create(wsdlURL, serviceName);
IBaseDataTypesRpcLit port = (IBaseDataTypesRpcLit) service.getPort(IBaseDataTypesRpcLit.class);
// invoke method
- ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:9090/jaxws-bp12baserpc/BPBaseRPC");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, PROXY_ADDRESS + "/jaxws-bp12baserpc/BPBaseRPC");
System.out.println("Invoking retInt...");
int _retInt_inInt = 10;
int _retInt__return = port.retInt(_retInt_inInt);
Added: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/common/BP12TestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/common/BP12TestCase.java (rev 0)
+++ projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/common/BP12TestCase.java 2013-06-06 09:29:22 UTC (rev 17656)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.bp12.common;
+
+import org.jboss.wsf.test.JBossWSTest;
+
+public class BP12TestCase extends JBossWSTest{
+ protected final String PROXY_ADDRESS = System.getProperty("proxy.address", "http://localhost:9090");
+
+}
Property changes on: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/common/BP12TestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/complexdoc/ComplexTypesDocTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/complexdoc/ComplexTypesDocTestCase.java 2013-06-06 09:26:01 UTC (rev 17655)
+++ projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/complexdoc/ComplexTypesDocTestCase.java 2013-06-06 09:29:22 UTC (rev 17656)
@@ -29,12 +29,12 @@
import junit.framework.Test;
+import org.jboss.test.ws.jaxws.bp12.common.BP12TestCase;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-public class ComplexTypesDocTestCase extends JBossWSTest
+public class ComplexTypesDocTestCase extends BP12TestCase
{
- private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp12complexdoc/ComplexDoc";
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp20complexdoc/ComplexDoc";
public static Test suite()
{
@@ -50,7 +50,7 @@
IComplexDataTypesDocLitW port = (IComplexDataTypesDocLitW) service.getPort(IComplexDataTypesDocLitW.class);
// invoke method
((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- "http://localhost:9090/jaxws-bp12complexdoc/ComplexDoc");
+ PROXY_ADDRESS + "/jaxws-bp12complexdoc/ComplexDoc");
System.out.println("Invoking retArrayString1D...");
StringArray inArrayString1D = new StringArray();
Modified: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/complexrpc/ComplexTypesRPCTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/complexrpc/ComplexTypesRPCTestCase.java 2013-06-06 09:26:01 UTC (rev 17655)
+++ projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/complexrpc/ComplexTypesRPCTestCase.java 2013-06-06 09:29:22 UTC (rev 17656)
@@ -29,12 +29,12 @@
import junit.framework.Test;
+import org.jboss.test.ws.jaxws.bp12.common.BP12TestCase;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-public class ComplexTypesRPCTestCase extends JBossWSTest
+public class ComplexTypesRPCTestCase extends BP12TestCase
{
- private final String serviceURL = "http://" + getServerHost() + ":9090/jaxws-bp12complexrpc/ComplexRPC";
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp20complexrpc/ComplexRPC";
public static Test suite()
{
@@ -50,7 +50,7 @@
IComplexDataTypesRpcLit port = (IComplexDataTypesRpcLit) service.getPort(IComplexDataTypesRpcLit.class);
// invoke method
((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- "http://localhost:9090/jaxws-bp12complexrpc/ComplexRPC");
+ PROXY_ADDRESS + "/jaxws-bp12complexrpc/ComplexRPC");
System.out.println("Invoking retArrayString1D...");
StringArray inArrayString1D = new StringArray();
Modified: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/Test1189TestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/Test1189TestCase.java 2013-06-06 09:26:01 UTC (rev 17655)
+++ projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/Test1189TestCase.java 2013-06-06 09:29:22 UTC (rev 17656)
@@ -28,12 +28,13 @@
import javax.xml.ws.Service;
import junit.framework.Test;
+
+import org.jboss.test.ws.jaxws.bp12.common.BP12TestCase;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-public class Test1189TestCase extends JBossWSTest
+public class Test1189TestCase extends BP12TestCase
{
- private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp12test1189/Test1189";
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp20test1189/Test1189";
public static Test suite()
{
@@ -49,7 +50,7 @@
WsaTestPortType port = (WsaTestPortType) service.getPort(WsaTestPortType.class);
// invoke method
((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- "http://" + getServerHost() + ":9090/jaxws-bp12test1189/Test1189");
+ PROXY_ADDRESS +"/jaxws-bp12test1189/Test1189");
System.out.println("Invoking echo...");
String response = port.echo("input string");
Modified: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/anon/Test1189AnonTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/anon/Test1189AnonTestCase.java 2013-06-06 09:26:01 UTC (rev 17655)
+++ projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/anon/Test1189AnonTestCase.java 2013-06-06 09:29:22 UTC (rev 17656)
@@ -35,10 +35,10 @@
import org.apache.cxf.ws.addressing.EndpointReferenceType;
import org.apache.cxf.ws.addressing.JAXWSAConstants;
import org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl;
+import org.jboss.test.ws.jaxws.bp12.common.BP12TestCase;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-public class Test1189AnonTestCase extends JBossWSTest
+public class Test1189AnonTestCase extends BP12TestCase
{
private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp12test1189-anon/Test1189Anon";
@@ -56,13 +56,13 @@
WsaTestPortType port = (WsaTestPortType) service.getPort(WsaTestPortType.class);
// invoke method
((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- "http://" + getServerHost() + ":9090/jaxws-bp12test1189-anon/Test1189Anon");
+ PROXY_ADDRESS + "/jaxws-bp20test1189-anon/Test1189Anon");
EndpointReferenceType wsaTo = new EndpointReferenceType();
AddressingProperties addrProperties = new AddressingPropertiesImpl();
AttributedURIType epr = new AttributedURIType();
- epr.setValue( "http://" + getServerHost() + ":8080/jaxws-bp12test1189-anon/Test1189Anon");
+ epr.setValue( "http://" + getServerHost() + ":8080/jaxws-bp20test1189-anon/Test1189Anon");
wsaTo.setAddress(epr);
addrProperties.setReplyTo(wsaTo);
((BindingProvider) port).getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addrProperties);
@@ -74,6 +74,7 @@
}
catch (SOAPFaultException e)
{
+ e.printStackTrace();
assertTrue("only anonymous supported error message is expected", e.getMessage().contains("Found non-anonymous address but only anonymous supported"));
}
Modified: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/nonanon/Test1189NonAnonTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/nonanon/Test1189NonAnonTestCase.java 2013-06-06 09:26:01 UTC (rev 17655)
+++ projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/nonanon/Test1189NonAnonTestCase.java 2013-06-06 09:29:22 UTC (rev 17656)
@@ -30,12 +30,12 @@
import junit.framework.Test;
+import org.jboss.test.ws.jaxws.bp12.common.BP12TestCase;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-public class Test1189NonAnonTestCase extends JBossWSTest
+public class Test1189NonAnonTestCase extends BP12TestCase
{
- private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp12test1189-nonanon/Test1189NonAnon";
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp20test1189-nonanon/Test1189NonAnon";
public static Test suite()
{
@@ -51,7 +51,7 @@
WsaTestPortType port = (WsaTestPortType) service.getPort(WsaTestPortType.class);
// invoke method
((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- "http://" + getServerHost() + ":9090/jaxws-bp12test1189-nonanon/Test1189NonAnon");
+ PROXY_ADDRESS + "/jaxws-bp12test1189-nonanon/Test1189NonAnon");
try
{
Modified: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1190/Test119XTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1190/Test119XTestCase.java 2013-06-06 09:26:01 UTC (rev 17655)
+++ projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1190/Test119XTestCase.java 2013-06-06 09:29:22 UTC (rev 17656)
@@ -41,12 +41,12 @@
import junit.framework.Test;
import org.apache.cxf.helpers.IOUtils;
+import org.jboss.test.ws.jaxws.bp12.common.BP12TestCase;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-public class Test119XTestCase extends JBossWSTest
+public class Test119XTestCase extends BP12TestCase
{
- private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp12test1190/Test1190";
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp20test1190/Test1190";
public static Test suite()
{
@@ -62,7 +62,7 @@
WsaTestPortType port = (WsaTestPortType) service.getPort(WsaTestPortType.class);
// invoke method
((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- "http://localhost:9090/jaxws-bp12test1190/Test1190");
+ PROXY_ADDRESS +"/jaxws-bp12test1190/Test1190");
System.out.println("Invoking echo1...");
String response = port.echo1("input string");
@@ -87,7 +87,7 @@
Service.Mode.MESSAGE,
new AddressingFeature(false, false));
((BindingProvider) disp).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- "http://" + getServerHost() + ":9090/jaxws-bp12test1190/Test1190");
+ PROXY_ADDRESS + "/jaxws-bp12test1190/Test1190");
InputStream msgIns = getClass().getResourceAsStream("./wsa-without-messageid.xml");
String msg = new String(IOUtils.readBytesFromStream(msgIns));
msg = msg.replaceAll("$PORT", "9090");
@@ -120,7 +120,7 @@
Service.Mode.MESSAGE,
new AddressingFeature(false, false));
((BindingProvider) disp).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- "http://" + getServerHost() + ":9090/jaxws-bp12test1190/Test1192");
+ PROXY_ADDRESS +"/jaxws-bp12test1190/Test1192");
//To mustunderstand
InputStream msgIns = getClass().getResourceAsStream("./wsa-to-mustunderstand.xml");
String msg = new String(IOUtils.readBytesFromStream(msgIns));
@@ -212,7 +212,7 @@
{
//test1194-version mismatch
// construct proxy
- URL url = new URL("http://localhost:9090/jaxws-bp12test1190/Test1190");
+ URL url = new URL( PROXY_ADDRESS +"/jaxws-bp12test1190/Test1190");
HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
InputStream msgIns = getClass().getResourceAsStream("./wsa-version-mismatch.xml");
String msg = new String(IOUtils.readBytesFromStream(msgIns));
@@ -239,6 +239,7 @@
buffer.append(inputLine);
in.close();
+ System.out.println(buffer.toString());
assertTrue("Expected version mismatch error", buffer.toString().contains("soap:VersionMismatch"));
}
Modified: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1197/Test1197TestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1197/Test1197TestCase.java 2013-06-06 09:26:01 UTC (rev 17655)
+++ projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1197/Test1197TestCase.java 2013-06-06 09:29:22 UTC (rev 17656)
@@ -29,12 +29,12 @@
import junit.framework.Test;
+import org.jboss.test.ws.jaxws.bp12.common.BP12TestCase;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-public class Test1197TestCase extends JBossWSTest
+public class Test1197TestCase extends BP12TestCase
{
- private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp12test1197/Test1197";
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp20test1197/Test1197";
public static Test suite()
{
@@ -50,7 +50,7 @@
SignatureDocumentLiteral port = (SignatureDocumentLiteral) service.getPort(SignatureDocumentLiteral.class);
// invoke method
((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- "http://" + getServerHost() + ":9090/jaxws-bp12test1197/Test1197");
+ PROXY_ADDRESS + "/jaxws-bp12test1197/Test1197");
System.out.println("Invoking sign1...");
String response = port.sign1("Hello");
Modified: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/Test1198TestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/Test1198TestCase.java 2013-06-06 09:26:01 UTC (rev 17655)
+++ projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/Test1198TestCase.java 2013-06-06 09:29:22 UTC (rev 17656)
@@ -29,12 +29,12 @@
import junit.framework.Test;
+import org.jboss.test.ws.jaxws.bp12.common.BP12TestCase;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-public class Test1198TestCase extends JBossWSTest
+public class Test1198TestCase extends BP12TestCase
{
- private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp12test1198/Test1198";
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp20test1198/Test1198";
public static Test suite()
{
@@ -50,7 +50,7 @@
SignatureRpcLiteral port = (SignatureRpcLiteral) service.getPort(SignatureRpcLiteral.class);
// invoke method
((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- "http://" + getServerHost() + ":9090/jaxws-bp12test1198/Test1198");
+ PROXY_ADDRESS + "/jaxws-bp12test1198/Test1198");
//request 1
10 years, 11 months
JBossWS SVN: r17654 - in stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests: src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-06-05 13:55:24 -0400 (Wed, 05 Jun 2013)
New Revision: 17654
Added:
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceIface.java
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceImpl.java
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java
Modified:
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
Log:
Adding ws-security policy test
Modified: stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2013-06-05 17:54:10 UTC (rev 17653)
+++ stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2013-06-05 17:55:24 UTC (rev 17654)
@@ -340,6 +340,23 @@
</manifest>
</war>
+ <!-- jaxws-samples-wsse-policy-sign-encrypt-gcm-code-first -->
+ <war
+ warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-sign-encrypt-gcm-code-first.war" needxmlfile='false'>
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedService*.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/policy/jaxws/Say*.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/policy/basic/KeystorePasswordCallback.class"/>
+ </classes>
+ <zipfileset dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/basic/gcm/WEB-INF" prefix="WEB-INF/classes">
+ <include name="bob.jks" />
+ <include name="bob.properties" />
+ </zipfileset>
+ <manifest>
+ <attribute name="Dependencies" value="org.jboss.ws.cxf.jbossws-cxf-client, org.apache.ws.security"/>
+ </manifest>
+ </war>
+
<!-- jaxws-samples-wsse-policy-sign-encrypt-mc -->
<war
warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-sign-encrypt-mc.war" needxmlfile='false'>
Added: stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceIface.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceIface.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceIface.java 2013-06-05 17:55:24 UTC (rev 17654)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+import org.jboss.wsf.stack.cxf.policy.PolicySets;
+
+@WebService
+(
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy"
+)
+@PolicySets("AsymmetricBinding_X509v1_GCM192OAEP_ProtectTokens")
+public interface AnnotatedServiceIface
+{
+ @WebMethod
+ String sayHello();
+}
Added: stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceImpl.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceImpl.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceImpl.java 2013-06-05 17:55:24 UTC (rev 17654)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+
+@WebService(
+ portName = "AnnotatedSecurityServicePort",
+ serviceName = "AnnotatedSecurityService",
+ name = "AnnotatedServiceIface",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.basic.AnnotatedServiceIface",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.properties", value = "bob.properties"),
+ @EndpointProperty(key = "ws-security.encryption.properties", value = "bob.properties"),
+ @EndpointProperty(key = "ws-security.signature.username", value = "bob"),
+ @EndpointProperty(key = "ws-security.encryption.username", value = "alice"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback")
+ }
+)
+public class AnnotatedServiceImpl implements AnnotatedServiceIface
+{
+ public String sayHello()
+ {
+ return "Secure Hello World!";
+ }
+}
Added: stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java 2013-06-05 17:55:24 UTC (rev 17654)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.samples.wsse.policy.basic;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * WS-SecurityPolicy code first dev test
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 05-Jun-2013
+ */
+public final class AnnotatedSignEncryptTestCase extends JBossWSTest
+{
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-sign-encrypt-gcm-code-first/AnnotatedSecurityService";
+
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(AnnotatedSignEncryptTestCase.class, "jaxws-samples-wsse-policy-sign-encrypt-gcm-code-first.war jaxws-samples-wsse-policy-sign-encrypt-client.jar");
+ }
+
+ public void test() throws Exception
+ {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "AnnotatedSecurityService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ AnnotatedServiceIface proxy = (AnnotatedServiceIface)service.getPort(AnnotatedServiceIface.class);
+ setupWsse(proxy);
+ assertEquals("Secure Hello World!", proxy.sayHello());
+ }
+
+ private void setupWsse(AnnotatedServiceIface proxy)
+ {
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_USERNAME, "alice");
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_USERNAME, "bob");
+ }
+}
10 years, 11 months
JBossWS SVN: r17653 - stack/cxf/branches/JBWS-3648/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-06-05 13:54:10 -0400 (Wed, 05 Jun 2013)
New Revision: 17653
Modified:
stack/cxf/branches/JBWS-3648/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
Log:
Install new bean listener into deployment bus
Modified: stack/cxf/branches/JBWS-3648/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2013-06-05 17:52:55 UTC (rev 17652)
+++ stack/cxf/branches/JBWS-3648/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2013-06-05 17:54:10 UTC (rev 17653)
@@ -38,6 +38,8 @@
import org.apache.cxf.management.interceptor.ResponseTimeMessageOutInterceptor;
import org.apache.cxf.resource.ResourceManager;
import org.apache.cxf.resource.ResourceResolver;
+import org.apache.cxf.service.factory.FactoryBeanListener;
+import org.apache.cxf.service.factory.FactoryBeanListenerManager;
import org.apache.cxf.workqueue.AutomaticWorkQueue;
import org.apache.cxf.workqueue.AutomaticWorkQueueImpl;
import org.apache.cxf.workqueue.WorkQueueManager;
@@ -55,6 +57,7 @@
import org.jboss.wsf.stack.cxf.interceptor.EndpointAssociationInterceptor;
import org.jboss.wsf.stack.cxf.interceptor.NsCtxSelectorStoreInterceptor;
import org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl;
+import org.jboss.wsf.stack.cxf.policy.PolicySetsAnnotationListener;
/**
* A wrapper of the Bus for performing most of the configurations required on it by JBossWS
@@ -70,6 +73,7 @@
protected Bus bus;
protected BusHolderLifeCycleListener busHolderListener;
+ protected FactoryBeanListener policySetsListener;
public BusHolder()
{
@@ -111,6 +115,9 @@
setCXFManagement(bus, props); //*first* enabled cxf management if required, *then* add anything else which could be manageable (e.g. work queues)
setAdditionalWorkQueues(bus, props);
setWSDiscovery(bus, props);
+
+ policySetsListener = new PolicySetsAnnotationListener();
+ bus.getExtension(FactoryBeanListenerManager.class).addListener(policySetsListener);
}
@@ -126,6 +133,8 @@
bus.shutdown(true);
}
busHolderListener = null;
+ bus.getExtension(FactoryBeanListenerManager.class).removeListener(policySetsListener);
+ policySetsListener = null;
}
/**
10 years, 11 months
JBossWS SVN: r17652 - in stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF: policies and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-06-05 13:52:55 -0400 (Wed, 05 Jun 2013)
New Revision: 17652
Added:
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/AsymmetricBinding_X509v1_GCM192OAEP_ProtectTokens-BINDING.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/AsymmetricBinding_X509v1_TripleDesRsa15_EncryptBeforeSigning_ProtectTokens-BINDING.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt-BINDING.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt-BINDING.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml
stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/org.jboss.wsf.stack.cxf.policy.PolicyAttachmentStore
Log:
Adding some policy sets
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/AsymmetricBinding_X509v1_GCM192OAEP_ProtectTokens-BINDING.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/AsymmetricBinding_X509v1_GCM192OAEP_ProtectTokens-BINDING.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/AsymmetricBinding_X509v1_GCM192OAEP_ProtectTokens-BINDING.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="AsymmetricBinding_X509v1_GCM192OAEP_ProtectTokens_binding_policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssX509V1Token11/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V1Token11/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:ProtectTokens/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp-cxf:Basic192GCM xmlns:sp-cxf="http://cxf.apache.org/custom/security-policy"/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:Wss10>
+ <wsp:Policy>
+ <sp:MustSupportRefIssuerSerial/>
+ </wsp:Policy>
+ </sp:Wss10>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/AsymmetricBinding_X509v1_TripleDesRsa15_EncryptBeforeSigning_ProtectTokens-BINDING.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/AsymmetricBinding_X509v1_TripleDesRsa15_EncryptBeforeSigning_ProtectTokens-BINDING.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/AsymmetricBinding_X509v1_TripleDesRsa15_EncryptBeforeSigning_ProtectTokens-BINDING.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="AsymmetricBinding_X509v1_TripleDesRsa15_EncryptBeforeSigning_ProtectTokens_binding_policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssX509V1Token11/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V1Token11/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:TripleDesRsa15/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:ProtectTokens/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ <sp:EncryptBeforeSigning/>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:Wss10>
+ <wsp:Policy>
+ <sp:MustSupportRefIssuerSerial/>
+ </wsp:Policy>
+ </sp:Wss10>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX221_binding_policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:Wss10>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ </wsp:Policy>
+ </sp:Wss10>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX221_Binding_Operation_Input_Policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX221_Binding_Operation_Output_Policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX222_binding_policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:ProtectTokens/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:Wss10>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ </wsp:Policy>
+ </sp:Wss10>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX222_Binding_Operation_Input_Policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX222_Binding_Operation_Output_Policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt-BINDING.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt-BINDING.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt-BINDING.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX223_binding_policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SymmetricBinding>
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:RequireDerivedKeys/>
+ <sp:RequireThumbprintReference/>
+ <sp:WssX509V3Token11/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ <sp:RequireSignatureConfirmation/>
+ </wsp:Policy>
+ </sp:Wss11>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX223_Binding_Operation_Input_Policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX223_Binding_Operation_Output_Policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt-BINDING.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt-BINDING.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt-BINDING.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX224_binding_policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SymmetricBinding>
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:RequireDerivedKeys/>
+ <sp:RequireThumbprintReference/>
+ <sp:WssX509V3Token11/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:EndorsingSupportingTokens>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:RequireThumbprintReference/>
+ <sp:WssX509V3Token11/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:EndorsingSupportingTokens>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ <sp:RequireSignatureConfirmation/>
+ </wsp:Policy>
+ </sp:Wss11>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_INPUT.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX224_Binding_Operation_Input_Policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt-BINDING_OPERATION_OUTPUT.xml 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX224_Binding_Operation_Output_Policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/org.jboss.wsf.stack.cxf.policy.PolicyAttachmentStore
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/org.jboss.wsf.stack.cxf.policy.PolicyAttachmentStore (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/resources/META-INF/policies/org.jboss.wsf.stack.cxf.policy.PolicyAttachmentStore 2013-06-05 17:52:55 UTC (rev 17652)
@@ -0,0 +1,6 @@
+AsymmetricBinding_X509v1_TripleDesRsa15_EncryptBeforeSigning_ProtectTokens
+AsymmetricBinding_X509v1_GCM192OAEP_ProtectTokens
+WS-SP-EX221_WSS10_Mutual_Auth_X509_Sign_Encrypt
+WS-SP-EX222_WSS10_Mutual_Auth_X509_Sign_Encrypt
+WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt
+WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt
\ No newline at end of file
10 years, 11 months
JBossWS SVN: r17651 - in stack/cxf/branches/JBWS-3648/modules/client/src: main/java/org/jboss/wsf/stack/cxf/policy and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-06-05 13:52:03 -0400 (Wed, 05 Jun 2013)
New Revision: 17651
Added:
stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/
stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/EndpointPolicyAttachments.java
stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicyAttachment.java
stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicyAttachmentStore.java
stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicySets.java
stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicySetsAnnotationListener.java
stack/cxf/branches/JBWS-3648/modules/client/src/test/java/org/jboss/wsf/stack/cxf/policy/
stack/cxf/branches/JBWS-3648/modules/client/src/test/java/org/jboss/wsf/stack/cxf/policy/PolicySetsTest.java
stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/
stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/
stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/
stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/WS-SP-EX224-BINDING.xml
stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/WS-SP-EX224-BINDING_OPERATION_INPUT.xml
stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/WS-SP-EX224-BINDING_OPERATION_OUTPUT.xml
stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/org.jboss.wsf.stack.cxf.policy.PolicyAttachmentStore
Log:
Adding components for parsing policy attachments and a preliminary cxf bean listener to add policies to endpoints / wsdl contracts
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/EndpointPolicyAttachments.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/EndpointPolicyAttachments.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/EndpointPolicyAttachments.java 2013-06-05 17:52:03 UTC (rev 17651)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.stack.cxf.policy;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cxf.annotations.Policy.Placement;
+
+
+/**
+ * A class for collecting policy attachments for a given endpoint
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 03-Jun-2013
+ *
+ */
+public class EndpointPolicyAttachments
+{
+ private Map<Placement, List<PolicyAttachment>> attachmentMap;
+
+ private EndpointPolicyAttachments(Map<Placement, List<PolicyAttachment>> attachmentMap) {
+ this.attachmentMap = attachmentMap;
+ }
+
+ public static EndpointPolicyAttachments newInstance(String[] sets, PolicyAttachmentStore store) {
+ Map<Placement, List<PolicyAttachment>> map = new HashMap<Placement, List<PolicyAttachment>>();
+ for (String set : sets) {
+ List<PolicyAttachment> attachments = store.get(set);
+ for (PolicyAttachment attachment: attachments) {
+ Placement p = attachment.getPlacement();
+ if (map.containsKey(p)) {
+ map.get(p).add(attachment);
+ } else {
+ List<PolicyAttachment> list = new ArrayList<PolicyAttachment>(4);
+ list.add(attachment);
+ map.put(attachment.getPlacement(), list);
+ }
+ }
+ }
+ return new EndpointPolicyAttachments(map);
+ }
+
+ public List<PolicyAttachment> getPolicyAttachments(Placement placement)
+ {
+ List<PolicyAttachment> pal = attachmentMap.get(placement);
+ if (pal == null) {
+ return Collections.emptyList();
+ } else {
+ return pal;
+ }
+ }
+}
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicyAttachment.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicyAttachment.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicyAttachment.java 2013-06-05 17:52:03 UTC (rev 17651)
@@ -0,0 +1,133 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.stack.cxf.policy;
+
+import java.io.InputStream;
+import java.net.URL;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.cxf.annotations.Policy.Placement;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.resource.ExtendedURIResolver;
+import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.ws.policy.PolicyConstants;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+
+/**
+ * A lazy-loaded Policy attachment reference
+ * with the placement point it is meant for.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 03-Jun-2013
+ *
+ */
+public class PolicyAttachment
+{
+ private Placement placement;
+ private String uri;
+
+ public PolicyAttachment(Placement placement, String uri)
+ {
+ this.placement = placement;
+ this.uri = uri;
+ }
+
+ public Placement getPlacement()
+ {
+ return placement;
+ }
+
+// public Element read(String defName)
+// {
+// String id = uri;
+// ExtendedURIResolver resolver = new ExtendedURIResolver();
+// InputSource src = resolver.resolve(id, "classpath:");
+// if (null == src)
+// {
+// return null;
+// }
+// XMLStreamReader reader = null;
+// try
+// {
+// reader = StaxUtils.createXMLStreamReader(src);
+// Document doc = StaxUtils.read(reader);
+// Element elem = doc.getDocumentElement();
+// id = elem.getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI, PolicyConstants.WSU_ID_ATTR_NAME);
+// if (StringUtils.isEmpty(id))
+// {
+// Attr att = doc.createAttributeNS(PolicyConstants.WSU_NAMESPACE_URI, "wsu:" + PolicyConstants.WSU_ID_ATTR_NAME);
+// att.setNodeValue(defName);
+// elem.setAttributeNodeNS(att);
+// }
+// return elem;
+// }
+// catch (XMLStreamException e)
+// {
+// throw new RuntimeException(e);
+// }
+// finally
+// {
+// StaxUtils.close(reader);
+// }
+// }
+
+ public Element read(String defName)
+ {
+ XMLStreamReader reader = null;
+ InputStream is = null;
+ try
+ {
+ is = new URL(uri).openStream();
+ reader = StaxUtils.createXMLStreamReader(is);
+ Document doc = StaxUtils.read(reader);
+ Element elem = doc.getDocumentElement();
+ String id = elem.getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI, PolicyConstants.WSU_ID_ATTR_NAME);
+ if (StringUtils.isEmpty(id))
+ {
+ Attr att = doc.createAttributeNS(PolicyConstants.WSU_NAMESPACE_URI, "wsu:" + PolicyConstants.WSU_ID_ATTR_NAME);
+ att.setNodeValue(defName);
+ elem.setAttributeNodeNS(att);
+ }
+ return elem;
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ StaxUtils.close(reader);
+ if (is != null) {
+ try {
+ is.close();
+ } catch (Exception e) {
+ //ignore
+ }
+ }
+ }
+ }
+}
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicyAttachmentStore.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicyAttachmentStore.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicyAttachmentStore.java 2013-06-05 17:52:03 UTC (rev 17651)
@@ -0,0 +1,152 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.stack.cxf.policy;
+
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cxf.annotations.Policy.Placement;
+import org.jboss.wsf.stack.cxf.client.ProviderImpl;
+
+
+/**
+ * The store containing pre-defined policy attachments
+ * grouped by set name; lazy loaded on first use.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 03-Jun-2013
+ *
+ */
+public class PolicyAttachmentStore
+{
+ private static final String POLICY_ATTACHMENT_LOCATION = "META-INF/policies/";
+ private volatile Map<String, List<PolicyAttachment>> attachments;
+ private ClassLoader cl;
+ private static PolicyAttachmentStore defaultServerInstance;
+
+ public PolicyAttachmentStore(ClassLoader cl) {
+ this.cl = cl;
+ }
+
+ public static synchronized PolicyAttachmentStore getDefaultServerInstance() {
+ if (defaultServerInstance == null) {
+ defaultServerInstance = new PolicyAttachmentStore(ProviderImpl.class.getClassLoader());
+ }
+ return defaultServerInstance;
+ }
+
+ public List<PolicyAttachment> get(String setName)
+ {
+ if (attachments == null) {
+ synchronized (PolicyAttachmentStore.class)
+ {
+ if (attachments == null) {
+ Map<String, List<PolicyAttachment>> map = new HashMap<String, List<PolicyAttachment>>();
+ parsePolicyAttachmentResources(cl, map);
+ attachments = map;
+ }
+ }
+ }
+ List<PolicyAttachment> l = attachments.get(setName);
+ if (l != null && !l.isEmpty()) {
+ return Collections.unmodifiableList(l);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ private static void parsePolicyAttachmentResources(ClassLoader cl, Map<String, List<PolicyAttachment>> map) {
+ try {
+ Enumeration<URL> urls = getResources(cl, POLICY_ATTACHMENT_LOCATION + PolicyAttachmentStore.class.getName());
+ if (urls != null) {
+ while (urls.hasMoreElements()) {
+ parsePolicyAttachmentStore(urls.nextElement(), map);
+ }
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private static void parsePolicyAttachmentStore(URL url, Map<String, List<PolicyAttachment>> map) throws IOException {
+ InputStream storeStream = url.openStream();
+ if (storeStream != null) {
+ String baseUrl = url.toString();
+ baseUrl = baseUrl.substring(0, baseUrl.length() - PolicyAttachmentStore.class.getName().length());
+ BufferedReader br = new BufferedReader(new InputStreamReader(storeStream, "UTF-8"));
+ try {
+ String set;
+ while ((set = br.readLine()) != null) {
+ for (Placement p : Placement.values()) {
+ final String newUrl = baseUrl + set + "-" + p + ".xml";
+ final URL policyAttachmentUrl = new URL(newUrl);
+ InputStream is = null;
+ try {
+ is = policyAttachmentUrl.openStream();
+ if (is != null) {
+ if (map.containsKey(set)) {
+ map.get(set).add(new PolicyAttachment(p, newUrl));
+ } else {
+ List<PolicyAttachment> list = new ArrayList<PolicyAttachment>(4);
+ list.add(new PolicyAttachment(p, newUrl));
+ map.put(set, list);
+ }
+ }
+ } catch (FileNotFoundException fnfe) {
+ //ignore
+ } finally {
+ if (is != null)
+ is.close();
+ }
+ }
+ }
+ } finally {
+ br.close();
+ }
+ }
+ }
+
+ private static Enumeration<URL> getResources(final ClassLoader cl, final String filename) throws Exception {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null) {
+ return cl.getResources(filename);
+ } else {
+ return AccessController.doPrivileged(new PrivilegedExceptionAction<Enumeration<URL>>() {
+ public Enumeration<URL> run() throws Exception {
+ return cl.getResources(filename);
+ }
+ });
+ }
+ }
+}
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicySets.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicySets.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicySets.java 2013-06-05 17:52:03 UTC (rev 17651)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.stack.cxf.policy;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 04-Jun-2013
+ *
+ */
+(a)Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.TYPE })
+public @interface PolicySets {
+ String[] value();
+}
Added: stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicySetsAnnotationListener.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicySetsAnnotationListener.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/main/java/org/jboss/wsf/stack/cxf/policy/PolicySetsAnnotationListener.java 2013-06-05 17:52:03 UTC (rev 17651)
@@ -0,0 +1,298 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.stack.cxf.policy;
+
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.wsdl.extensions.UnknownExtensibilityElement;
+
+import org.apache.cxf.annotations.Policy.Placement;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.service.factory.AbstractServiceFactoryBean;
+import org.apache.cxf.service.factory.FactoryBeanListener;
+import org.apache.cxf.service.model.AbstractPropertiesHolder;
+import org.apache.cxf.service.model.BindingFaultInfo;
+import org.apache.cxf.service.model.BindingInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.DescriptionInfo;
+import org.apache.cxf.service.model.FaultInfo;
+import org.apache.cxf.service.model.InterfaceInfo;
+import org.apache.cxf.service.model.OperationInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.ws.policy.PolicyConstants;
+import org.apache.neethi.Constants;
+import org.jboss.logging.Logger;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * A FactoryBeanListener that adds policies according to a given map of EndpointPolicyAttachment
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 03-Jun-2013
+ */
+public class PolicySetsAnnotationListener implements FactoryBeanListener
+{
+ private final Map<Class<?>, EndpointPolicyAttachments> epaMap = new HashMap<Class<?>, EndpointPolicyAttachments>(); //usare la SEI come class
+ private PolicyAttachmentStore store;
+
+ public PolicySetsAnnotationListener() {
+ this.store = PolicyAttachmentStore.getDefaultServerInstance();
+ }
+
+ public PolicySetsAnnotationListener(PolicyAttachmentStore store) {
+ this.store = store;
+ }
+
+ protected EndpointPolicyAttachments getEndpointPolicyAttachment(Class<?> clazz) {
+ if (epaMap.containsKey(clazz)) {
+ return epaMap.get(clazz);
+ } else {
+ final PolicySets ps = clazz.getAnnotation(PolicySets.class);
+ final EndpointPolicyAttachments epa = (ps != null) ? EndpointPolicyAttachments.newInstance(ps.value(), store) : null;
+ epaMap.put(clazz, epa);
+ return epa;
+ }
+ }
+
+ public void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object... args)
+ {
+// Logger.getLogger(this.getClass()).info("**** EVENT: " + ev + "# Args: ");
+// for (Object o : args) {
+// Logger.getLogger(this.getClass()).info(o);
+// }
+ switch (ev)
+ {
+// case INTERFACE_CREATED : {
+// InterfaceInfo ii = (InterfaceInfo) args[0];
+// Class<?> cls = (Class<?>) args[1];
+// addPolicies(factory, ii, cls);
+// break;
+// }
+
+ case ENDPOINT_SELECTED : {
+ Class<?> cls = (Class<?>) args[2];
+ //Class<?> implCls = (Class<?>) args[3];
+ Endpoint ep = (Endpoint) args[1];
+ if (ep.getEndpointInfo().getInterface() != null)
+ {
+ addPolicies(factory, ep, cls);
+ }
+ break;
+ }
+
+ case INTERFACE_OPERATION_BOUND : { //TODO possibly remove either this block or next one
+ OperationInfo inf = (OperationInfo) args[0];
+ Method m = (Method) args[1];
+ addPolicies(factory, inf, m);
+ break;
+ }
+
+ case BINDING_OPERATION_CREATED :
+ BindingOperationInfo boi = (BindingOperationInfo) args[1];
+ Method m = (Method) args[2];
+ addPolicies(factory, boi.getOperationInfo(), m);
+ break;
+
+ default :
+ //ignore
+ }
+ }
+
+ private void addPolicies(AbstractServiceFactoryBean factory, OperationInfo inf, Method m)
+ {
+ if (m == null)
+ {
+ return;
+ }
+
+ final Class<?> cls = m.getDeclaringClass();
+ EndpointPolicyAttachments epa = getEndpointPolicyAttachment(cls);
+ if (epa != null)
+ {
+ final ServiceInfo service = inf.getInterface().getService();
+ for (PolicyAttachment pa : epa.getPolicyAttachments(Placement.PORT_TYPE_OPERATION)) {
+ addPolicy(inf, service, pa, cls, inf.getName().getLocalPart() + "PortTypeOpPolicy");
+ }
+ for (PolicyAttachment pa : epa.getPolicyAttachments(Placement.PORT_TYPE_OPERATION_INPUT)) {
+ addPolicy(inf.getInput(), service, pa, cls, inf.getName().getLocalPart() + "PortTypeOpInputPolicy");
+ }
+ for (PolicyAttachment pa : epa.getPolicyAttachments(Placement.PORT_TYPE_OPERATION_OUTPUT)) {
+ addPolicy(inf.getOutput(), service, pa, cls, inf.getName().getLocalPart() + "PortTypeOpOutputPolicy");
+ }
+ for (PolicyAttachment pa : epa.getPolicyAttachments(Placement.PORT_TYPE_OPERATION_FAULT)) {
+ for (FaultInfo f : inf.getFaults())
+ {
+ addPolicy(f, service, pa, cls, f.getName().getLocalPart() + "PortTypeOpFaultPolicy");
+ }
+ }
+ }
+ }
+
+ private void addPolicies(AbstractServiceFactoryBean factory, Endpoint ep, Class<?> cls)
+ {
+ final EndpointPolicyAttachments epa = getEndpointPolicyAttachment(cls);
+ if (epa != null) {
+ final BindingInfo binf = ep.getBinding().getBindingInfo();
+ final ServiceInfo si = ep.getService().getServiceInfos().get(0);
+ final InterfaceInfo inf = ep.getEndpointInfo().getInterface();
+
+ for (PolicyAttachment pa : epa.getPolicyAttachments(Placement.BINDING)) {
+ addPolicy(binf, si, pa, cls, binf.getName().getLocalPart() + "BindingPolicy");
+ }
+ for (PolicyAttachment pa : epa.getPolicyAttachments(Placement.PORT_TYPE)) {
+ addPolicy(inf, si, pa, cls, inf.getName().getLocalPart() + "PortTypePolicy");
+ }
+ for (PolicyAttachment pa : epa.getPolicyAttachments(Placement.SERVICE)) {
+ addPolicy(si, si, pa, cls, si.getName().getLocalPart() + "ServicePolicy");
+ }
+ for (PolicyAttachment pa : epa.getPolicyAttachments(Placement.SERVICE_PORT)) {
+ addPolicy(ep.getEndpointInfo(), si, pa, cls, ep.getEndpointInfo().getName().getLocalPart()
+ + "PortPolicy");
+ }
+
+ for (BindingOperationInfo binfo : binf.getOperations())
+ {
+ for (PolicyAttachment pa : epa.getPolicyAttachments(Placement.BINDING_OPERATION)) {
+ addPolicy(binfo, si, pa, cls, binfo.getName().getLocalPart() + "BindingOpPolicy");
+ }
+ for (PolicyAttachment pa : epa.getPolicyAttachments(Placement.BINDING_OPERATION_INPUT)) {
+ addPolicy(binfo.getInput(), si, pa, cls, binfo.getName().getLocalPart()
+ + "BindingOpInputPolicy");
+ }
+ for (PolicyAttachment pa : epa.getPolicyAttachments(Placement.BINDING_OPERATION_OUTPUT)) {
+ addPolicy(binfo.getOutput(), si, pa, cls, binfo.getName().getLocalPart()
+ + "BindingOpOutputPolicy");
+ }
+ for (PolicyAttachment pa : epa.getPolicyAttachments(Placement.BINDING_OPERATION_FAULT)) {
+ for (BindingFaultInfo f : binfo.getFaults())
+ {
+ addPolicy(f, si, pa, cls, f.getFaultInfo().getName().getLocalPart()
+ + "BindingOpFaultPolicy");
+ }
+ }
+ }
+ }
+ }
+
+// private void addPolicies(AbstractServiceFactoryBean factory, InterfaceInfo ii, Class<?> cls)
+// {
+// if (cls == null)
+// {
+// return;
+// }
+// EndpointPolicyAttachment epa = epaMap.get(cls);
+// if (epa != null)
+// {
+// for (PolicyAttachment pa : epa.getPolicyAttachment(Placement.PORT_TYPE)) {
+// addPolicy(ii, ii.getService(), pa, cls, ii.getName().getLocalPart() + "PortTypePolicy");
+// }
+// for (PolicyAttachment pa : epa.getPolicyAttachment(Placement.SERVICE)) {
+// addPolicy(ii, ii.getService(), pa, cls, ii.getName().getLocalPart() + "PortTypePolicy");
+// }
+// }
+// }
+
+ private void addPolicy(AbstractPropertiesHolder place, ServiceInfo service, PolicyAttachment pa, Class<?> cls, String defName)
+ {
+ Element el = addPolicy(service, pa, cls, defName);
+ if (el != null)
+ {
+ UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
+ uee.setElement(el);
+ uee.setRequired(true);
+ uee.setElementType(DOMUtils.getElementQName(el));
+ place.addExtensor(uee);
+ }
+ }
+
+ private Element addPolicy(ServiceInfo service, PolicyAttachment pa, Class<?> cls, String defName)
+ {
+ Element element = pa.read(defName);
+ if (element == null)
+ {
+ return null;
+ }
+
+ // might have been updated on load policy
+ String refId = getPolicyId(element);
+
+ if (service.getDescription() == null && cls != null)
+ {
+ service.setDescription(new DescriptionInfo());
+ URL u = cls.getResource("/");
+ if (u != null)
+ {
+ service.getDescription().setBaseURI(u.toString());
+ }
+ }
+
+ // if not already added to service add it, otherwise ignore
+ // and just create the policy reference.
+ if (!isExistsPolicy(service, refId))
+ {
+ UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
+ uee.setElement(element);
+ uee.setRequired(true);
+ uee.setElementType(DOMUtils.getElementQName(element));
+ service.getDescription().addExtensor(uee);
+ }
+
+ refId = "#" + refId;
+
+ Document doc = DOMUtils.createDocument();
+ Element el = doc.createElementNS(element.getNamespaceURI(), "wsp:" + Constants.ELEM_POLICY_REF);
+ Attr att = doc.createAttributeNS(null, "URI");
+ att.setValue(refId);
+ el.setAttributeNodeNS(att);
+ return el;
+ }
+
+ private String getPolicyId(Element element)
+ {
+ return element.getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI, PolicyConstants.WSU_ID_ATTR_NAME);
+ }
+
+ private boolean isExistsPolicy(ServiceInfo service, String uri)
+ {
+ Object exts[] = service.getDescription().getExtensors().get();
+ exts = exts == null ? new Object[0] : exts;
+ for (Object o : exts)
+ {
+ if (o instanceof UnknownExtensibilityElement)
+ {
+ UnknownExtensibilityElement uee = (UnknownExtensibilityElement) o;
+ String uri2 = getPolicyId(uee.getElement());
+ if (uri.equals(uri2))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
Added: stack/cxf/branches/JBWS-3648/modules/client/src/test/java/org/jboss/wsf/stack/cxf/policy/PolicySetsTest.java
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/test/java/org/jboss/wsf/stack/cxf/policy/PolicySetsTest.java (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/test/java/org/jboss/wsf/stack/cxf/policy/PolicySetsTest.java 2013-06-05 17:52:03 UTC (rev 17651)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf.policy;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.annotations.Policy.Placement;
+import org.junit.Test;
+import org.w3c.dom.Element;
+
+
+/**
+ * A test case of basic policy sets parsing
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 04-Jun-2013
+ *
+ */
+public class PolicySetsTest extends TestCase
+{
+ @Test
+ public void testStore() throws Exception {
+ PolicyAttachmentStore paStore = new PolicyAttachmentStore(PolicySetsTest.class.getClassLoader());
+ List<PolicyAttachment> pas = paStore.get("WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt");
+ assertNotNull(pas);
+ assertEquals(3, pas.size());
+ pas = paStore.get("Foo");
+ assertNotNull(pas);
+ assertEquals(0, pas.size());
+ }
+
+ @Test
+ public void testPolicyAttachmentRead() throws Exception {
+ PolicyAttachmentStore paStore = new PolicyAttachmentStore(PolicySetsTest.class.getClassLoader());
+ List<PolicyAttachment> pas = paStore.get("WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt");
+ assertNotNull(pas);
+ for (PolicyAttachment pa : pas) {
+ Element el = pa.read("foo");
+ assertEquals("Policy", el.getLocalName());
+ assertEquals("http://www.w3.org/ns/ws-policy", el.getNamespaceURI());
+ }
+ }
+
+ @Test
+ public void testEndpointPolicyAttachments() throws Exception {
+ PolicyAttachmentStore store = new PolicyAttachmentStore(PolicySetsTest.class.getClassLoader());
+ EndpointPolicyAttachments epa = EndpointPolicyAttachments.newInstance(new String[]{""}, store);
+ for (Placement p : Placement.values()) {
+ assertEquals(0, epa.getPolicyAttachments(p).size());
+ }
+ epa = EndpointPolicyAttachments.newInstance(new String[]{"fafds"}, store);
+ for (Placement p : Placement.values()) {
+ assertEquals(0, epa.getPolicyAttachments(p).size());
+ }
+ epa = EndpointPolicyAttachments.newInstance(new String[]{"Foooo", "WS-SP-EX224_WSS11_Mutual_Auth_X509_Sign_Encrypt"}, store);
+ for (Placement p : Placement.values()) {
+ if (p == Placement.BINDING || p == Placement.BINDING_OPERATION_INPUT || p == Placement.BINDING_OPERATION_OUTPUT) {
+ List<PolicyAttachment> pas = epa.getPolicyAttachments(p);
+ assertNotNull(pas);
+ assertEquals(1, pas.size());
+ assertNotNull(pas.iterator().next().read(""));
+ } else {
+ assertEquals(0, epa.getPolicyAttachments(p).size());
+ }
+ }
+ }
+}
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/WS-SP-EX224-BINDING.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/WS-SP-EX224-BINDING.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/WS-SP-EX224-BINDING.xml 2013-06-05 17:52:03 UTC (rev 17651)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX224_binding_policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SymmetricBinding>
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:RequireDerivedKeys/>
+ <sp:RequireThumbprintReference/>
+ <sp:WssX509V3Token11/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:EndorsingSupportingTokens>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:RequireThumbprintReference/>
+ <sp:WssX509V3Token11/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:EndorsingSupportingTokens>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ <sp:RequireSignatureConfirmation/>
+ </wsp:Policy>
+ </sp:Wss11>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/WS-SP-EX224-BINDING_OPERATION_INPUT.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/WS-SP-EX224-BINDING_OPERATION_INPUT.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/WS-SP-EX224-BINDING_OPERATION_INPUT.xml 2013-06-05 17:52:03 UTC (rev 17651)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX224_Binding_Operation_Input_Policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/WS-SP-EX224-BINDING_OPERATION_OUTPUT.xml
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/WS-SP-EX224-BINDING_OPERATION_OUTPUT.xml (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/WS-SP-EX224-BINDING_OPERATION_OUTPUT.xml 2013-06-05 17:52:03 UTC (rev 17651)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="WS-SP-EX224_Binding_Operation_Output_Policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file
Added: stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/org.jboss.wsf.stack.cxf.policy.PolicyAttachmentStore
===================================================================
--- stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/org.jboss.wsf.stack.cxf.policy.PolicyAttachmentStore (rev 0)
+++ stack/cxf/branches/JBWS-3648/modules/client/src/test/resources/META-INF/policies/org.jboss.wsf.stack.cxf.policy.PolicyAttachmentStore 2013-06-05 17:52:03 UTC (rev 17651)
@@ -0,0 +1 @@
+WS-SP-EX224
\ No newline at end of file
10 years, 11 months