JBossWS SVN: r3217 - in trunk/jbossws-core: ant-import-tests and 33 other directories.
by jbossws-commits@lists.jboss.org
Author: palin
Date: 2007-05-23 10:51:22 -0400 (Wed, 23 May 2007)
New Revision: 3217
Added:
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/PolicyScopeLevel.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/annotation/
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/annotation/Policy.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/annotation/PolicyAttachment.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/AssertionDeployer.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/NopAssertionDeployer.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/WSSecurityAssertionDeployer.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/exceptions/
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/exceptions/UnsupportedAlternative.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/exceptions/UnsupportedAssertion.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/exceptions/UnsupportedPolicy.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/util/
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/util/PrimitiveAssertionWriter.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaExtension.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLExtensibilityElement.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/HelloJavaBean.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/SimpleEncryptTestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/SimpleEncryptTestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1645/
trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1645/JBWS1645TestCase.java
trunk/jbossws-core/src/test/resources/common/wsdl11/PolicyAttachment.wsdl
trunk/jbossws-core/src/test/resources/common/wsdl11/PolicyAttachmentFragment.wsdl
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/META-INF/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/META-INF/wsdl/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/META-INF/wsdl/HelloService.wsdl
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF/Policy.xml
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF/web.xml
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/simple-encrypt/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/simple-encrypt/META-INF/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/simple-encrypt/WEB-INF/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/wsse.keystore
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/wsse.truststore
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/META-INF/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/META-INF/wsdl/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/WEB-INF/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/WEB-INF/web.xml
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/WEB-INF/wsdl/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/WEB-INF/wsdl/HelloService.wsdl
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/simple-encrypt/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/simple-encrypt/META-INF/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/simple-encrypt/WEB-INF/
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/wsse.keystore
trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/wsse.truststore
trunk/jbossws-core/src/test/resources/tools/jbws1645/
trunk/jbossws-core/src/test/resources/tools/jbws1645/BindingPolicy.txt
trunk/jbossws-core/src/test/resources/tools/jbws1645/PortPolicy.txt
trunk/jbossws-core/src/test/resources/tools/jbws1645/PortTypePolicy.txt
trunk/jbossws-core/src/test/resources/tools/jbws1645/StandardJavaTypesServiceJBWS1645.wsdl
Modified:
trunk/jbossws-core/ant-import-tests/build-samples-jaxws.xml
trunk/jbossws-core/ant-import-tests/build-testsuite.xml
trunk/jbossws-core/ant-import/build-thirdparty.xml
trunk/jbossws-core/src/main/java/org/jboss/ws/Constants.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/Policy.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperation.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidationHelper.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidator.java
Log:
Merging ws-policy implementation from branch JBWS-856 to trunk
Modified: trunk/jbossws-core/ant-import/build-thirdparty.xml
===================================================================
--- trunk/jbossws-core/ant-import/build-thirdparty.xml 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/ant-import/build-thirdparty.xml 2007-05-23 14:51:22 UTC (rev 3217)
@@ -133,7 +133,7 @@
<pathelement location="${thirdparty.dir}/xmlsec.jar"/>
<pathelement location="${thirdparty.dir}/xercesImpl.jar"/>
<pathelement location="${thirdparty.dir}/xalan.jar"/>
-
+ <pathelement location="${thirdparty.dir}/policy.jar"/>
</path>
</target>
Modified: trunk/jbossws-core/ant-import-tests/build-samples-jaxws.xml
===================================================================
--- trunk/jbossws-core/ant-import-tests/build-samples-jaxws.xml 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/ant-import-tests/build-samples-jaxws.xml 2007-05-23 14:51:22 UTC (rev 3217)
@@ -163,6 +163,38 @@
</webinf>
</war>
+ <!-- jaxws-samples-wssecurityAnnotatedpolicy-encrypt -->
+ <war warfile="${tests.output.dir}/libs/jaxws-samples-wssecurityAnnotatedpolicy-encrypt.war" webxml="${tests.output.dir}/resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/Hello.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/HelloJavaBean.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/UserType.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/samples/wssecurityAnnotatedpolicy">
+ <include name="wsse.keystore"/>
+ <include name="wsse.truststore"/>
+ </webinf>
+ <webinf dir="${tests.output.dir}/resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF">
+ <include name="Policy.xml"/>
+ </webinf>
+ </war>
+
+ <!-- jaxws-samples-wssecuritypolicy-encrypt -->
+ <war warfile="${tests.output.dir}/libs/jaxws-samples-wssecuritypolicy-encrypt.war" webxml="${tests.output.dir}/resources/jaxws/samples/wssecuritypolicy/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wssecuritypolicy/Hello.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wssecuritypolicy/UserType.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/samples/wssecuritypolicy">
+ <include name="wsse.keystore"/>
+ <include name="wsse.truststore"/>
+ </webinf>
+ <webinf dir="${tests.output.dir}/resources/jaxws/samples/wssecuritypolicy/WEB-INF">
+ <include name="wsdl/**"/>
+ </webinf>
+ </war>
+
<!-- Please add alphabetically -->
</target>
Modified: trunk/jbossws-core/ant-import-tests/build-testsuite.xml
===================================================================
--- trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-23 14:51:22 UTC (rev 3217)
@@ -43,6 +43,7 @@
<pathelement location="${core.dir}/thirdparty/qdox.jar"/>
<pathelement location="${core.dir}/thirdparty/wsdl4j.jar"/>
<pathelement location="${core.dir}/thirdparty/xmlunit.jar"/>
+ <pathelement location="${core.dir}/thirdparty/wstx.jar"/>
</path>
<!-- The jBPM BPEL classpath -->
@@ -85,6 +86,8 @@
<wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesRpcLit/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.baserpclit" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
<wsconsume wsdl="${tests.resources.dir}/jaxws/complex/META-INF/wsdl/RegistrationService.wsdl" package="org.jboss.test.ws.jaxws.complex" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
<wsconsume wsdl="${tests.resources.dir}/jaxws/holder/META-INF/wsdl/HolderService.wsdl" package="org.jboss.test.ws.jaxws.holder" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
+ <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecuritypolicy/WEB-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecuritypolicy" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
+ <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecurityAnnotatedpolicy/META-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecurityAnnotatedpolicy" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
<wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecurity/META-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecurity" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
</target>
@@ -172,10 +175,13 @@
<classpath refid="ws.stack.classpath"/>
<classpath refid="thirdparty.classpath"/>
<classpath location="${core.dir}/thirdparty/concurrent.jar"/>
+ <classpath location="${thirdparty.dir}/commons-logging.jar"/>
<classpath location="${tests.output.dir}/classes"/>
+ <classpath location="${tests.output.dir}/resources/jaxws/samples/wssecurityAnnotatedpolicy"/>
</taskdef>
- <wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurity" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurity.HelloJavaBean"/>
+ <wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurity" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurity.HelloJavaBean"/>
+ <wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurityAnnotatedpolicy" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurityAnnotatedpolicy.HelloJavaBean"/>
</target>
<target name="tests-generate-resources" depends="servicegen,wstools,wsprovide">
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/Constants.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/Constants.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/Constants.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -99,7 +99,10 @@
/** WS-Eventing namespace uri **/
static final String URI_WS_EVENTING = "http://schemas.xmlsoap.org/ws/2004/08/eventing";
-
+
+ /** WS-Policy namespace uri **/
+ static final String URI_WS_POLICY = "http://schemas.xmlsoap.org/ws/2004/09/policy";
+
/** WS-Addressing namespace uri **/
static final String URI_WS_ADDRESSING = "http://www.w3.org/2005/08/addressing";
@@ -276,7 +279,11 @@
static final String WSDL_PROPERTY_ACTION_OUT = "http://www.jboss.org/jbossws/wsa/actionOut";
static final String WSDL_PROPERTY_EVENTSOURCE = "http://www.jboss.org/jbossws/wse/isEventSource";
-
+
+ static final String WSDL_ELEMENT_POLICY = "http://www.jboss.org/jbossws/wsp/policy";
+ static final String WSDL_PROPERTY_POLICYURIS = "http://www.jboss.org/jbossws/wsp/policyURIs";
+ static final String WSDL_ELEMENT_POLICYREFERENCE = "http://www.jboss.org/jbossws/wsp/policyReference";
+
/** The key to the original message part name */
static final String WSDL_PROPERTY_PART_NAME = "http://www.jboss.org/jbossws/partname";
/** The key to the message part type in case a part does not reference an element; http://www.jboss.org/jbossws/part/xmltype */
@@ -293,6 +300,9 @@
static final QName WSDL_ATTRIBUTE_WSA_ACTION = new QName(URI_WS_ADDRESSING, "Action");
static final QName WSDL_ATTRIBUTE_WSE_EVENTSOURCE = new QName(URI_WS_EVENTING, "EventSource");
+
+ static final QName WSDL_ATTRIBUTE_WSP_POLICYURIS = new QName(URI_WS_POLICY, "PolicyURIs");
+ static final QName WSDL_ELEMENT_WSP_POLICYREFERENCE = new QName(URI_WS_POLICY, "PolicyReference");
/** WSDL-2.0 exchange patterns */
static final String WSDL20_PATTERN_IN_ONLY = "http://www.w3.org/2004/08/wsdl/in-only";
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/Policy.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/Policy.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/Policy.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -115,6 +115,11 @@
{
return new ArrayList<PolicyAlternative>(alternatives);
}
+
+ public void clearPolicyAlternatives()
+ {
+ alternatives.clear();
+ }
public Element toElement()
{
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -52,11 +52,13 @@
public class PolicyAssertion
{
private Element assertionElement;
+ private String nameSpace;
PolicyAssertion(Element element)
{
Document doc = DOMUtils.getOwnerDocument();
this.assertionElement = (Element)doc.adoptNode(element);
+ this.nameSpace = assertionElement.getNamespaceURI();
}
public Element getElement()
@@ -73,4 +75,9 @@
{
return toXMLString(true);
}
+
+ public String getNameSpace()
+ {
+ return nameSpace;
+ }
}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/PolicyScopeLevel.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/PolicyScopeLevel.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/PolicyScopeLevel.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.policy;
+
+
+/**
+ * When attaching a Policy to a WSDL element, a Policy Scope is implied for that attachment.
+ * PolicyScopeLevel enumerates all kind of element a Policy can be attached to in wsdl 1.1.
+ *
+ * @author Alessio Soldano, <alessio.soldano(a)javalinux.it>
+ * @since 3-May-2007
+ */
+public enum PolicyScopeLevel
+{
+ WSDL_SERVICE, //wsdl:service
+ WSDL_PORT, //wsdl:port
+ WSDL_PORT_TYPE, //wsdl:portType
+ WSDL_BINDING, //wsdl:binding
+ BINDING_OPERATION, //wsdl:binding/wsdl:operation
+ PORT_TYPE_OPERATION, //wsdl:portType/wsdl:operation
+ BINDING_OPERATION_INPUT, //wsdl:binding/wsdl:operation/wsdl:input
+ PORT_TYPE_OPERATION_INPUT, //wsdl:portType/wsdl:operation/wsdl:input
+ MESSAGE //wsdl:message
+}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/annotation/Policy.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/annotation/Policy.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/annotation/Policy.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.policy.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+
+/**
+ * @author Stefano Maestri <mailto:stefano.maestri@javalinux.it>
+ *
+ * since 11/05/2007
+ */
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface Policy {
+
+ public String policyFileLocation();
+
+ public PolicyScopeLevel scope();
+}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/annotation/PolicyAttachment.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/annotation/PolicyAttachment.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/annotation/PolicyAttachment.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.policy.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author Stefano Maestri <mailto:stefano.maestri@javalinux.it>
+ *
+ * since 11/05/2007
+ */
+(a)Target(ElementType.TYPE)
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface PolicyAttachment {
+ Policy[] value();
+}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,247 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.policy.deployer;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ws.policy.AndCompositeAssertion;
+import org.apache.ws.policy.Assertion;
+import org.apache.ws.policy.Policy;
+import org.apache.ws.policy.PrimitiveAssertion;
+import org.apache.ws.policy.XorCompositeAssertion;
+import org.jboss.logging.Logger;
+import org.jboss.ws.extensions.policy.deployer.domainAssertion.AssertionDeployer;
+import org.jboss.ws.extensions.policy.deployer.domainAssertion.NopAssertionDeployer;
+import org.jboss.ws.extensions.policy.deployer.domainAssertion.WSSecurityAssertionDeployer;
+import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAlternative;
+import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
+import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedPolicy;
+import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
+
+
+
+/**
+ * @author Stefano Maestri <mailto:stefano.maestri@javalinux.it>
+ *
+ * since 27/04/2007
+ */
+public class PolicyDeployer
+{
+ private final static Logger log = Logger.getLogger(PolicyDeployer.class);
+ private static PolicyDeployer me;
+ private Map<String, Class> domainDeployerMap = new HashMap<String, Class>();
+
+
+ static {
+ me = new PolicyDeployer();
+ me.domainDeployerMap.put("http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd",WSSecurityAssertionDeployer.class);
+ }
+
+ //hide constructor
+ PolicyDeployer()
+ {
+ }
+
+ public static PolicyDeployer getInstance()
+ {
+ return me;
+ }
+
+ //for test
+ public static PolicyDeployer newInstance(Map<String,Class> customDomainMap)
+ {
+ PolicyDeployer instance = new PolicyDeployer();
+ instance.domainDeployerMap = customDomainMap;
+ return instance;
+
+ }
+
+ //for tools
+ public static PolicyDeployer newInstanceForTools()
+ {
+ PolicyDeployer instance = new PolicyDeployer();
+ instance.domainDeployerMap.put("http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd", NopAssertionDeployer.class);
+ return instance;
+
+ }
+
+ @SuppressWarnings("unchecked")
+ public Policy deployServerside(Policy policy, ExtensibleMetaData extMetaData) throws UnsupportedPolicy
+ {
+
+ List<Assertion> returnedPolicyTerms = new LinkedList<Assertion>();
+
+ if (! policy.isNormalized())
+ {
+ policy.normalize();
+ }
+
+ //in normal form we have just one wsp:ExactlyOne element containg unbounded wsp:All (alternative)
+ XorCompositeAssertion exactlyOne = (XorCompositeAssertion) policy.getTerms().get(0);
+ log.debug("####"+ exactlyOne.getClass());
+ log.debug("####"+ exactlyOne.getTerms());
+ for (AndCompositeAssertion alternative: (List<AndCompositeAssertion>) exactlyOne.getTerms() )
+ {
+ log.debug("alternative");
+ try
+ {
+ deployAlternativeServerSide(alternative,extMetaData);
+ returnedPolicyTerms.add(alternative);
+ }
+ catch (UnsupportedAlternative e)
+ {
+ log.debug("Unsupported Alternative");
+ //policy is unsupported only if it have all alternative unsupported
+ }
+
+ }
+ if (returnedPolicyTerms.size() == 0)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("XorComposite zero element...Policy not supported");
+ }
+ throw new UnsupportedPolicy();
+ }
+ policy.getTerms().clear();
+ policy.addTerms(returnedPolicyTerms);
+ return policy;
+ }
+
+ /**
+ * Policy deployer method for client side: delegates to the right domain deployer
+ * and fails if one or more policy assertions are not supported.
+ *
+ * @param policy
+ * @param extMetaData
+ * @throws UnsupportedPolicy
+ */
+ @SuppressWarnings("unchecked")
+ public void deployClientSide(Policy policy, ExtensibleMetaData extMetaData) throws UnsupportedPolicy
+ {
+ if (! policy.isNormalized())
+ {
+ policy.normalize();
+ }
+ //in normal form we have just one wsp:ExactlyOne element containg unbounded wsp:All (alternative)
+ XorCompositeAssertion exactlyOne = (XorCompositeAssertion) policy.getTerms().get(0);
+ for (AndCompositeAssertion alternative: (List<AndCompositeAssertion>) exactlyOne.getTerms() )
+ {
+ for (Assertion assertion : (List<Assertion>) alternative.getTerms())
+ {
+ if (assertion instanceof PrimitiveAssertion)
+ {
+ try
+ {
+ deployAssertionClientSide((PrimitiveAssertion) assertion, extMetaData);
+ }
+ catch (UnsupportedAssertion e)
+ {
+ log.error("Unsupported assertion!");
+ throw new UnsupportedPolicy();
+ }
+ }
+ else if (assertion instanceof Policy) //inner policy to be verified
+ {
+ deployClientSide((Policy) assertion, extMetaData);
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void deployAlternativeServerSide(AndCompositeAssertion alternative, ExtensibleMetaData extMetaData) throws UnsupportedAlternative
+ {
+ for (Assertion assertion : (List<Assertion>) alternative.getTerms())
+ {
+
+ try
+ {
+ if (assertion instanceof PrimitiveAssertion)
+ {
+ deployAssertionServerSide((PrimitiveAssertion) assertion,extMetaData);
+ }
+ else if (assertion instanceof Policy) //inner policy to be verified
+ {
+ deployServerside((Policy) assertion, extMetaData);
+ }
+ else
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("Unknown Alternative type....Alternative not supported");
+ }
+ throw new UnsupportedAlternative();
+ }
+
+ }
+ catch (UnsupportedAssertion e)
+ {
+ //If there is al least one unsupported assertion the alternative isn't supported
+ throw new UnsupportedAlternative();
+ }
+ catch (UnsupportedPolicy ep)
+ {
+ //If there is al least one unsupported assertion the alternative isn't supported
+ throw new UnsupportedAlternative();
+ }
+ }
+ }
+
+ private void deployAssertionServerSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
+ {
+ AssertionDeployer deployer = getDomainDeployerInstance(assertion.getName().getNamespaceURI());
+ deployer.deployServerSide(assertion,extMetaData);
+ }
+
+ private void deployAssertionClientSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
+ {
+ AssertionDeployer deployer = getDomainDeployerInstance(assertion.getName().getNamespaceURI());
+ deployer.deployClientSide(assertion,extMetaData);
+ }
+
+ /**
+ *
+ * @param namespace
+ * @return the correct AssertionDeployer instance, or null if namespace not supported
+ */
+ private AssertionDeployer getDomainDeployerInstance(String namespace) throws UnsupportedAssertion
+ {
+ try {
+ if (! domainDeployerMap.containsKey(namespace) )
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("Unknown namespace:"+namespace+"...Assertion not supported");
+ }
+ throw new UnsupportedAssertion();
+ }
+ return (AssertionDeployer) (domainDeployerMap.get(namespace)).newInstance();
+ } catch (Exception e) {
+
+ throw new UnsupportedAssertion();
+ }
+ }
+}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/AssertionDeployer.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/AssertionDeployer.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/AssertionDeployer.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.policy.deployer.domainAssertion;
+
+import org.apache.ws.policy.PrimitiveAssertion;
+import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
+import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
+
+/**
+ * Interface each policy domain should implement for policy deployment.
+ *
+ * @author Stefano Maestri <mailto:stefano.maestri@javalinux.it>
+ * @author Alessio Soldano <mailto:alessio.soldano@javalinux.it>
+ *
+ */
+public interface AssertionDeployer
+{
+ /**
+ * Server side deployment method; ExtensibleMetaData provided so
+ * that the implementor to let it plugs its own handlers.
+ *
+ * @param assertion
+ * @param extMetaData
+ * @throws UnsupportedAssertion
+ */
+ public void deployServerSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion;
+
+ /**
+ * Client side deployment method; ExtensibleMetaData provided so
+ * that the implementor to let it plugs its own handlers.
+ *
+ * @param assertion
+ * @param extMetaData
+ * @throws UnsupportedAssertion
+ */
+ public void deployClientSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion;
+}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/NopAssertionDeployer.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/NopAssertionDeployer.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/NopAssertionDeployer.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.policy.deployer.domainAssertion;
+
+import org.apache.ws.policy.PrimitiveAssertion;
+import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
+import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
+
+/**
+ * This assertion deployer actually does nothing when asked to
+ * deploy a policy assertion. It is used as a placeholder by
+ * PolicyDeployer in case no modification to umdm or anything
+ * else is actually required (for example when running the
+ * wsprovide tool).
+ *
+ * @author Stefano Maestri <mailto:stefano.maestri@javalinux.it>
+ * @author Alessio Soldano <mailto:alessio.soldano@javalinux.it>
+ *
+ * @since 16-May-2007
+ *
+ */
+public class NopAssertionDeployer implements AssertionDeployer
+{
+
+ public void deployClientSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
+ {
+ //nop
+ }
+
+ public void deployServerSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
+ {
+ //nop
+ }
+
+}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/WSSecurityAssertionDeployer.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/WSSecurityAssertionDeployer.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/WSSecurityAssertionDeployer.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.policy.deployer.domainAssertion;
+
+import java.io.ByteArrayOutputStream;
+import java.io.StringReader;
+
+import org.apache.ws.policy.PrimitiveAssertion;
+import org.jboss.logging.Logger;
+import org.jboss.ws.extensions.policy.deployer.PolicyDeployer;
+import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedAssertion;
+import org.jboss.ws.extensions.policy.deployer.util.PrimitiveAssertionWriter;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.wsse.WSSecurityConfigFactory;
+import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
+
+/**
+ *
+ * @author Stefano Maestri, <mailto:stefano.maestri@javalinux.it>
+ * @author Alessio Soldano, <mailto:alessio.soldano@javalinux.it>
+ *
+ */
+public class WSSecurityAssertionDeployer implements AssertionDeployer
+{
+ private final static Logger log = Logger.getLogger(PolicyDeployer.class);
+
+ public void deployServerSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
+ {
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ if (extMetaData instanceof EndpointMetaData)
+ {
+ EndpointMetaData ep = (EndpointMetaData) extMetaData;
+
+ WSSecurityConfiguration securityConfiguration;
+ try
+ {
+ //GET XML of security assertion
+ PrimitiveAssertionWriter.newInstance().writePrimitiveAssertion(assertion, stream);
+ StringReader reader = new StringReader(stream.toString());
+
+ //Set security configuration
+ securityConfiguration = WSSecurityOMFactory.newInstance().parse(reader);
+ WSSecurityConfigFactory.newInstance().initKeystorePath(ep.getRootFile(), securityConfiguration);
+ ep.getServiceMetaData().setSecurityConfiguration(securityConfiguration);
+
+ //set up handler chain as defined in standard file
+ ep.setConfigName("Standard WSSecurity Endpoint");
+ ep.initEndpointConfig();
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new UnsupportedAssertion();
+ }
+ }
+ }
+
+ public void deployClientSide(PrimitiveAssertion assertion, ExtensibleMetaData extMetaData) throws UnsupportedAssertion
+ {
+ if (extMetaData instanceof EndpointMetaData)
+ {
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ EndpointMetaData epMetaData = (EndpointMetaData) extMetaData;
+ ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
+ if (serviceMetaData.getSecurityConfiguration() == null)
+ {
+ try
+ {
+ PrimitiveAssertionWriter.newInstance().writePrimitiveAssertion(assertion, stream);
+ StringReader reader = new StringReader(stream.toString());
+
+ WSSecurityConfiguration securityConfiguration = WSSecurityOMFactory.newInstance().parse(reader);
+ serviceMetaData.setSecurityConfiguration(securityConfiguration);
+
+ epMetaData.setConfigName("Standard WSSecurity Client");
+ epMetaData.initEndpointConfig();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new UnsupportedAssertion();
+ }
+ }
+ }
+
+ }
+
+}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/exceptions/UnsupportedAlternative.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/exceptions/UnsupportedAlternative.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/exceptions/UnsupportedAlternative.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.policy.deployer.exceptions;
+
+/**
+ * @author Stefano Maestri <mailto:stefano.maestri@javalinux.it>
+ *
+ * since 27/04/2007
+ */
+public class UnsupportedAlternative extends Exception
+{
+
+}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/exceptions/UnsupportedAssertion.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/exceptions/UnsupportedAssertion.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/exceptions/UnsupportedAssertion.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.policy.deployer.exceptions;
+
+/**
+ * @author Stefano Maestri <mailto:stefano.maestri@javalinux.it>
+ *
+ * since 27/04/2007
+ */
+public class UnsupportedAssertion extends Exception
+{
+
+}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/exceptions/UnsupportedPolicy.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/exceptions/UnsupportedPolicy.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/exceptions/UnsupportedPolicy.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.policy.deployer.exceptions;
+
+/**
+ * @author Stefano Maestri <mailto:stefano.maestri@javalinux.it>
+ *
+ * since 27/04/2007
+ */
+public class UnsupportedPolicy extends Exception
+{
+
+}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/util/PrimitiveAssertionWriter.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/util/PrimitiveAssertionWriter.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/util/PrimitiveAssertionWriter.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.policy.deployer.util;
+
+import java.io.ByteArrayOutputStream;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.ws.policy.Assertion;
+import org.apache.ws.policy.PrimitiveAssertion;
+
+/**
+ *
+ * @author Stefano Maestri, <mailto:stefano.maestri@javalinux.it>
+ *
+ */
+public class PrimitiveAssertionWriter
+{
+
+ private int num = 1;
+
+ PrimitiveAssertionWriter()
+ {
+ }
+
+ public static PrimitiveAssertionWriter newInstance()
+ {
+ return new PrimitiveAssertionWriter();
+ }
+
+ public void writePrimitiveAssertion(PrimitiveAssertion assertion, ByteArrayOutputStream stream) throws XMLStreamException
+ {
+ XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(stream);
+ writePrimitiveAssertion(assertion, writer);
+
+ }
+ public void writePrimitiveAssertion(PrimitiveAssertion assertion, XMLStreamWriter writer) throws XMLStreamException
+ {
+
+ QName qname = assertion.getName();
+
+ String writerPrefix = writer.getPrefix(qname.getNamespaceURI());
+ if (writerPrefix != null)
+ {
+ writer.writeStartElement(qname.getNamespaceURI(), qname.getLocalPart());
+ }
+ else
+ {
+ String prefix = (qname.getPrefix() != null) ? qname.getPrefix() : generateNamespace();
+ writer.writeStartElement(prefix, qname.getLocalPart(), qname.getNamespaceURI());
+ writer.writeNamespace(prefix, qname.getNamespaceURI());
+ writer.setPrefix(prefix, qname.getNamespaceURI());
+
+ }
+
+ Hashtable attributes = assertion.getAttributes();
+ writeAttributes(attributes, writer);
+
+ String text = (String)assertion.getStrValue();
+ if (text != null)
+ {
+ writer.writeCharacters(text);
+ }
+
+ //A Primitive assertion can't have terms----to be verified
+ List terms = assertion.getTerms();
+ writeTerms(terms, writer);
+
+ writer.writeEndElement();
+ writer.flush();
+ }
+
+ private void writeTerms(List terms, XMLStreamWriter writer) throws XMLStreamException
+ {
+
+ Iterator iterator = terms.iterator();
+ while (iterator.hasNext())
+ {
+ Assertion assertion = (Assertion)iterator.next();
+ writePrimitiveAssertion((PrimitiveAssertion) assertion, writer);
+ }
+ }
+
+ private void writeAttributes(Hashtable attributes, XMLStreamWriter writer) throws XMLStreamException
+ {
+
+ Iterator iterator = attributes.keySet().iterator();
+ while (iterator.hasNext())
+ {
+ QName qname = (QName)iterator.next();
+ String value = (String)attributes.get(qname);
+
+ String prefix = qname.getPrefix();
+ if (prefix != null)
+ {
+ writer.writeAttribute(prefix, qname.getNamespaceURI(), qname.getLocalPart(), value);
+ }
+ else
+ {
+ writer.writeAttribute(qname.getNamespaceURI(), qname.getLocalPart(), value);
+ }
+ }
+ }
+
+ private String generateNamespace()
+ {
+ return "ns" + num++;
+ }
+}
\ No newline at end of file
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,300 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.policy.metadata;
+
+import java.io.InputStream;
+import java.util.List;
+
+import org.apache.ws.policy.Policy;
+import org.apache.ws.policy.PolicyReference;
+import org.apache.ws.policy.util.DOMPolicyReader;
+import org.apache.ws.policy.util.PolicyFactory;
+import org.apache.ws.policy.util.PolicyRegistry;
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+import org.jboss.ws.extensions.policy.annotation.PolicyAttachment;
+import org.jboss.ws.extensions.policy.deployer.PolicyDeployer;
+import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedPolicy;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
+import org.jboss.ws.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
+import org.jboss.ws.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.metadata.wsdl.WSDLService;
+
+/**
+ * A meta data builder for policies; handles checks for policy support
+ * and their eventual deploy on both server side and client side.
+ *
+ * @author Alessio Soldano, <mailto:alessio.soldano@javalinux.it>
+ *
+ * @since 16-May-2007
+ */
+public class PolicyMetaDataBuilder
+{
+ private static final Logger log = Logger.getLogger(PolicyMetaDataBuilder.class);
+ private boolean serverSide = true;
+ private boolean toolMode = false;
+
+ public PolicyMetaDataBuilder()
+ {
+
+ }
+
+ /**
+ * Creates a new PolicyMetaDataBuilder for server side policy processing.
+ *
+ * @param toolMode True if running wsprovide (no policy deployments)
+ * @return
+ */
+ public static PolicyMetaDataBuilder getServerSidePolicyMetaDataBuilder(boolean toolMode) {
+ PolicyMetaDataBuilder builder = new PolicyMetaDataBuilder();
+ builder.setServerSide(true);
+ builder.setToolMode(toolMode);
+ return builder;
+ }
+
+ /**
+ * Creates a new PolicyMetaDataBuilder for client side policy processing.
+ *
+ * @return
+ */
+ public static PolicyMetaDataBuilder getClientSidePolicyMetaDataBuilder() {
+ PolicyMetaDataBuilder builder = new PolicyMetaDataBuilder();
+ builder.setServerSide(false);
+ return builder;
+ }
+
+ public void processPolicyAnnotations(EndpointMetaData epMetaData, Class<?> sepClass, UnifiedDeploymentInfo udi)
+ {
+ for (org.jboss.ws.extensions.policy.annotation.Policy policy : sepClass.getAnnotation(PolicyAttachment.class).value())
+ {
+ InputStream is = null;
+ try
+ {
+ DOMPolicyReader reader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
+ if (toolMode)
+ {
+ is = Thread.currentThread().getContextClassLoader().getResourceAsStream(policy.policyFileLocation());
+ } else
+ {
+ is = udi.getMetaDataFileURL(policy.policyFileLocation()).openStream();
+ }
+ Policy unnormalizedPolicy = reader.readPolicy(is);
+ Policy normPolicy = (Policy)unnormalizedPolicy.normalize();
+ log.info("Deploying Annotated Policy = "+policy.policyFileLocation());
+ PolicyScopeLevel scope = policy.scope();
+ if (PolicyScopeLevel.WSDL_PORT.equals(scope) || PolicyScopeLevel.WSDL_PORT_TYPE.equals(scope) ||
+ PolicyScopeLevel.WSDL_BINDING.equals(scope))
+ {
+ deployPolicy(normPolicy, scope, epMetaData);
+ }
+ else
+ {
+ throw new WSException("Policy scope "+scope+" not supported yet!");
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ } finally
+ {
+ try
+ {
+ is.close();
+ } catch (Exception e) {}
+ }
+ }
+ }
+
+ public void processPolicyExtensions(EndpointMetaData epMetaData, WSDLDefinitions wsdlDefinitions)
+ {
+ //Collect all policies defined in our wsdl definitions
+ DOMPolicyReader reader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
+ PolicyRegistry localPolicyRegistry = new PolicyRegistry();
+ for (WSDLExtensibilityElement policyElement : wsdlDefinitions.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY))
+ {
+ Policy policy = reader.readPolicy(policyElement.getElement());
+ localPolicyRegistry.register(policy.getPolicyURI(), policy);
+ }
+ //Port scope
+ WSDLService wsdlService = wsdlDefinitions.getService(epMetaData.getServiceMetaData().getServiceName());
+ if (wsdlService != null)
+ {
+ WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoint(epMetaData.getPortName());
+ if (wsdlEndpoint != null)
+ {
+ List<WSDLExtensibilityElement> portPolicyRefList = wsdlEndpoint.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ processPolicies(portPolicyRefList, PolicyScopeLevel.WSDL_PORT, localPolicyRegistry, epMetaData);
+ }
+ else
+ {
+ log.warn("Cannot get port '"+epMetaData.getPortName()+"' from the given wsdl definitions! Eventual policies attached to this port won't be considered.");
+ }
+ }
+ else
+ {
+ log.warn("Cannot get service '"+epMetaData.getServiceMetaData().getServiceName()+"' from the given wsdl definitions! Eventual policies attached to this service won't be considered.");
+ }
+
+ //Binding scope
+ WSDLBinding wsdlBinding = wsdlDefinitions.getBindingByInterfaceName(epMetaData.getPortTypeName());
+ if (wsdlBinding != null)
+ {
+ List<WSDLExtensibilityElement> bindingPolicyRefList = wsdlBinding.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ processPolicies(bindingPolicyRefList, PolicyScopeLevel.WSDL_BINDING, localPolicyRegistry, epMetaData);
+ }
+ else
+ {
+ log.warn("Cannot get binding for portType '"+epMetaData.getPortTypeName()+"' from the given wsdl definitions! Eventual policies attached to this binding won't be considered.");
+ }
+
+ //PortType scope
+ WSDLInterface wsdlInterface = wsdlDefinitions.getInterface(epMetaData.getPortTypeName());
+ if (wsdlInterface != null)
+ {
+ List<WSDLExtensibilityElement> portTypePolicyRefList = wsdlInterface.getExtensibilityElements(Constants.WSDL_PROPERTY_POLICYURIS);
+ processPolicies(portTypePolicyRefList, PolicyScopeLevel.WSDL_PORT_TYPE, localPolicyRegistry, epMetaData);
+ }
+ else
+ {
+ log.warn("Cannot get portType '"+epMetaData.getPortTypeName()+"' from the given wsdl definitions! Eventual policies attached to this portType won't be considered.");
+ }
+ }
+
+ private void processPolicies(List<WSDLExtensibilityElement> policyReferences, PolicyScopeLevel scope, PolicyRegistry localPolicies, ExtensibleMetaData extMetaData)
+ {
+ if (policyReferences != null && policyReferences.size() != 0)
+ {
+ DOMPolicyReader reader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
+ for (WSDLExtensibilityElement element : policyReferences)
+ {
+ PolicyReference policyRef = reader.readPolicyReference(element.getElement());
+ Policy normPolicy;
+ try
+ {
+ normPolicy = (Policy)policyRef.normalize(localPolicies);
+ }
+ catch (RuntimeException e)
+ {
+ //TODO!!! not a local policy: get the policy definition and create the policy
+ normPolicy = null;
+ }
+ deployPolicy(normPolicy, scope, extMetaData);
+
+ }
+ }
+ }
+
+ private void deployPolicy(Policy policy, PolicyScopeLevel scope, ExtensibleMetaData extMetaData)
+ {
+ PolicyDeployer deployer;
+ if (toolMode)
+ {
+ deployer = PolicyDeployer.newInstanceForTools();
+ }
+ else
+ {
+ deployer = PolicyDeployer.getInstance();
+ }
+ if (serverSide)
+ {
+ deployPolicyServerSide(policy, scope, extMetaData, deployer);
+ }
+ else
+ {
+ deployPolicyClientSide(policy, scope, extMetaData, deployer);
+ }
+ }
+
+
+ private void deployPolicyServerSide(Policy policy, PolicyScopeLevel scope, ExtensibleMetaData extMetaData, PolicyDeployer deployer)
+ {
+ PolicyMetaExtension ext = (PolicyMetaExtension)extMetaData.getExtension(Constants.URI_WS_POLICY);
+ if (ext == null)
+ {
+ ext = new PolicyMetaExtension(Constants.URI_WS_POLICY);
+ extMetaData.addExtension(ext);
+ }
+ try
+ {
+ Policy deployedPolicy = deployer.deployServerside(policy, extMetaData);
+ ext.addPolicy(scope,deployedPolicy);
+ }
+ catch (UnsupportedPolicy e)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("Policy Not supported:" + policy.getPolicyURI());
+ }
+ }
+ }
+
+
+ private void deployPolicyClientSide(Policy policy, PolicyScopeLevel scope, ExtensibleMetaData extMetaData, PolicyDeployer deployer)
+ {
+ PolicyMetaExtension ext = (PolicyMetaExtension)extMetaData.getExtension(Constants.URI_WS_POLICY);
+ if (ext == null)
+ {
+ ext = new PolicyMetaExtension(Constants.URI_WS_POLICY);
+ extMetaData.addExtension(ext);
+ }
+ try
+ {
+ deployer.deployClientSide(policy, extMetaData);
+ ext.addPolicy(scope, policy);
+ }
+ catch (UnsupportedPolicy e)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("Policy Not supported:" + policy.getPolicyURI());
+ }
+ WSException.rethrow("Policy not supported! " + policy.getPolicyURI(), e);
+ }
+ }
+
+ public boolean isServerSide()
+ {
+ return serverSide;
+ }
+
+ public void setServerSide(boolean serverSide)
+ {
+ this.serverSide = serverSide;
+ }
+
+ public boolean isToolMode()
+ {
+ return toolMode;
+ }
+
+ public void setToolMode(boolean toolMode)
+ {
+ this.toolMode = toolMode;
+ }
+}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaExtension.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaExtension.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaExtension.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,54 @@
+package org.jboss.ws.extensions.policy.metadata;
+
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.Map;
+
+import org.apache.ws.policy.Policy;
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+import org.jboss.ws.metadata.umdm.MetaDataExtension;
+
+public class PolicyMetaExtension extends MetaDataExtension
+{
+ //Policies may be attached to a policy subject with different policy scopes
+ private Map<PolicyScopeLevel,Collection<Policy>> policies = new HashMap<PolicyScopeLevel,Collection<Policy>>();
+
+ public PolicyMetaExtension(String extensionNameSpace)
+ {
+ super(extensionNameSpace);
+ }
+
+ public void addPolicy(PolicyScopeLevel scope, Policy policy)
+ {
+ Collection<Policy> list;
+ if (!policies.containsKey(scope))
+ {
+ list = new LinkedList<Policy>();
+ policies.put(scope,list);
+ }
+ else
+ {
+ list = policies.get(scope);
+ }
+ list.add(policy);
+ }
+
+ public Collection<Policy> getPolicies(PolicyScopeLevel scope)
+ {
+ Collection<Policy> policyCollection = policies.get(scope);
+ return policyCollection == null ? new LinkedList<Policy>() : policyCollection;
+ }
+
+ public Collection<Policy> getAllPolicies()
+ {
+ Collection<Policy> list = new LinkedList<Policy>();
+ for (PolicyScopeLevel scope : policies.keySet())
+ {
+ list.addAll(policies.get(scope));
+ }
+ return list;
+ }
+
+}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -35,6 +35,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.jaxws.client.ServiceObjectFactoryJAXWS;
+import org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -84,6 +85,13 @@
buildMetaDataInternal(serviceMetaData, wsdlDefinitions);
+ //Setup policies for each endpoint
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ PolicyMetaDataBuilder policyBuilder = PolicyMetaDataBuilder.getClientSidePolicyMetaDataBuilder();
+ policyBuilder.processPolicyExtensions(epMetaData, wsdlDefinitions);
+ }
+
// Read the WSDL and initialize the schema model
// This should only be needed for debuging purposes of the UMDM
JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -37,6 +37,8 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.extensions.policy.annotation.PolicyAttachment;
+import org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
@@ -51,6 +53,7 @@
import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
import org.jboss.ws.tools.ToolsUtils;
import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.wsdl.WSDLGenerator;
import org.jboss.ws.tools.wsdl.WSDLWriter;
import org.jboss.ws.tools.wsdl.WSDLWriterResolver;
@@ -89,6 +92,7 @@
private ServerEndpointMetaData sepMetaData;
private ServiceMetaData serviceMetaData;
private URL wsdlLocation;
+ private URL policyLocation;
}
public void setGenerateWsdl(boolean generateWsdl)
@@ -136,6 +140,13 @@
// Initialize types
createJAXBContext(sepMetaData);
populateXmlTypes(sepMetaData);
+
+ //Process an optional @PolicyAttachment annotation
+ if (sepClass.isAnnotationPresent(PolicyAttachment.class))
+ {
+ PolicyMetaDataBuilder policyBuilder = PolicyMetaDataBuilder.getServerSidePolicyMetaDataBuilder(toolMode);
+ policyBuilder.processPolicyAnnotations(sepMetaData, sepClass, udi);
+ }
// The server must always generate WSDL
if (generateWsdl || !toolMode)
@@ -341,72 +352,84 @@
private void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData, URL wsdlLocation, EndpointMetaData epMetaData)
{
- if (wsdlLocation != null)
+ PolicyMetaDataBuilder policyBuilder = PolicyMetaDataBuilder.getServerSidePolicyMetaDataBuilder(toolMode);
+ try
{
- serviceMetaData.setWsdlLocation(wsdlLocation);
+ WSDLGenerator generator = new JAXBWSDLGenerator(jaxbCtx);
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ if (wsdlLocation != null)
+ {
+ //we can no longer use the user provided wsdl without parsing it right now, since we
+ //need to look for policies and eventually choose the supported policy alternatives
+ WSDLDefinitions wsdlDefinitions = factory.parse(wsdlLocation);
+ policyBuilder.processPolicyExtensions(epMetaData, wsdlDefinitions);
+ //now we have the UMDM containing policy data; anyway we can't write a new wsdl file with
+ //the supported alternatives and so on, since we need to publish the file the user provided
+ serviceMetaData.setWsdlLocation(wsdlLocation);
+ }
+ else
+ {
+ WSDLDefinitions wsdlDefinitions = generator.generate(serviceMetaData);
+ writeWsdl(serviceMetaData,wsdlDefinitions,epMetaData);
+ }
}
- else
+ catch (RuntimeException rte)
{
- try
- {
- // The RI uses upper case, and the TCK expects it, so we just mimic this even though we don't really have to
- String wsdlName = ToolsUtils.firstLetterUpperCase(serviceMetaData.getServiceName().getLocalPart());
+ throw rte;
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Cannot write generated wsdl", e);
+ }
+ }
+
+
+ private void writeWsdl(ServiceMetaData serviceMetaData, WSDLDefinitions wsdlDefinitions, EndpointMetaData epMetaData) throws IOException
+ {
+ // The RI uses upper case, and the TCK expects it, so we just mimic this even though we don't really have to
+ String wsdlName = ToolsUtils.firstLetterUpperCase(serviceMetaData.getServiceName().getLocalPart());
+ // Ensure that types are only in the interface qname
+ wsdlDefinitions.getWsdlTypes().setNamespace(epMetaData.getPortTypeName().getNamespaceURI());
- WSDLGenerator generator = new JAXBWSDLGenerator(jaxbCtx);
- WSDLDefinitions wsdlDefinitions = generator.generate(serviceMetaData);
+ final File dir, wsdlFile;
- // Ensure that types are only in the interface qname
- wsdlDefinitions.getWsdlTypes().setNamespace(epMetaData.getPortTypeName().getNamespaceURI());
+ if (wsdlDirectory != null)
+ {
+ dir = wsdlDirectory;
+ wsdlFile = new File(dir, wsdlName + ".wsdl");
+ }
+ else
+ {
+ dir = IOUtils.createTempDirectory();
+ wsdlFile = File.createTempFile(wsdlName, ".wsdl", dir);
+ wsdlFile.deleteOnExit();
+ }
- final File dir, wsdlFile;
-
+ message(wsdlFile.getName());
+ Writer writer = IOUtils.getCharsetFileWriter(wsdlFile, Constants.DEFAULT_XML_CHARSET);
+ new WSDLWriter(wsdlDefinitions).write(writer, Constants.DEFAULT_XML_CHARSET, new WSDLWriterResolver() {
+ public WSDLWriterResolver resolve(String suggestedFile) throws IOException
+ {
+ File file;
if (wsdlDirectory != null)
{
- dir = wsdlDirectory;
- wsdlFile = new File(dir, wsdlName + ".wsdl");
+ file = new File(dir, suggestedFile + ".wsdl");
}
else
{
- dir = IOUtils.createTempDirectory();
- wsdlFile = File.createTempFile(wsdlName, ".wsdl", dir);
- wsdlFile.deleteOnExit();
+ file = File.createTempFile(suggestedFile, ".wsdl", dir);
+ file.deleteOnExit();
}
+ actualFile = file.getName();
+ message(actualFile);
+ charset = Constants.DEFAULT_XML_CHARSET;
+ writer = IOUtils.getCharsetFileWriter(file, Constants.DEFAULT_XML_CHARSET);
+ return this;
+ }
+ });
+ writer.close();
- message(wsdlFile.getName());
- Writer writer = IOUtils.getCharsetFileWriter(wsdlFile, Constants.DEFAULT_XML_CHARSET);
- new WSDLWriter(wsdlDefinitions).write(writer, Constants.DEFAULT_XML_CHARSET, new WSDLWriterResolver() {
- public WSDLWriterResolver resolve(String suggestedFile) throws IOException
- {
- File file;
- if (wsdlDirectory != null)
- {
- file = new File(dir, suggestedFile + ".wsdl");
- }
- else
- {
- file = File.createTempFile(suggestedFile, ".wsdl", dir);
- file.deleteOnExit();
- }
- actualFile = file.getName();
- message(actualFile);
- charset = Constants.DEFAULT_XML_CHARSET;
- writer = IOUtils.getCharsetFileWriter(file, Constants.DEFAULT_XML_CHARSET);
- return this;
- }
- });
- writer.close();
-
- serviceMetaData.setWsdlLocation(wsdlFile.toURL());
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (IOException e)
- {
- throw new WSException("Cannot write generated wsdl", e);
- }
- }
+ serviceMetaData.setWsdlLocation(wsdlFile.toURL());
}
private void message(String msg)
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -26,6 +26,8 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import org.jboss.logging.Logger;
@@ -43,6 +45,7 @@
private Map features = new LinkedHashMap();
private Map properties = new LinkedHashMap();
+ private Map<String,List<WSDLExtensibilityElement>> extElements = new LinkedHashMap<String,List<WSDLExtensibilityElement>>();
public WSDLFeature[] getFeatures()
{
@@ -83,4 +86,33 @@
WSDLProperty property = (WSDLProperty)properties.get(uri);
return property;
}
+
+ public void addExtensibilityElement(WSDLExtensibilityElement extElement)
+ {
+ log.trace("addExtensibilityElement: " + extElement);
+ String uri = extElement.getUri();
+ List<WSDLExtensibilityElement> list = extElements.get(uri);
+ if (list == null)
+ {
+ list = new LinkedList<WSDLExtensibilityElement>();
+ extElements.put(uri,list);
+ }
+ list.add(extElement);
+ }
+
+ public List<WSDLExtensibilityElement> getExtensibilityElements(String uri)
+ {
+ List<WSDLExtensibilityElement> list = extElements.get(uri);
+ return list == null ? new ArrayList<WSDLExtensibilityElement>() : list;
+ }
+
+ public List<WSDLExtensibilityElement> getAllExtensibilityElements()
+ {
+ List<WSDLExtensibilityElement> list = new LinkedList<WSDLExtensibilityElement>();
+ for (String k : extElements.keySet())
+ {
+ list.addAll(extElements.get(k));
+ }
+ return list;
+ }
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -40,7 +40,7 @@
* @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
* @since 10-Oct-2004
*/
-public class WSDLBinding implements Serializable
+public class WSDLBinding extends Extendable implements Serializable
{
private static final long serialVersionUID = -7699953670233209811L;
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -34,7 +34,7 @@
* @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
* @version $Revision$
*/
-public abstract class WSDLBindingMessageReference
+public abstract class WSDLBindingMessageReference extends Extendable
{
// The parent WSDL binding operation
private WSDLBindingOperation wsdlBindingOperation;
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperation.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperation.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperation.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -41,7 +41,7 @@
* @author Anil.Saldhana(a)jboss.org
* @since 10-Oct-2004
*/
-public class WSDLBindingOperation implements Comparable, Serializable
+public class WSDLBindingOperation extends Extendable implements Comparable, Serializable
{
private static final long serialVersionUID = -1986624862746844610L;
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -47,7 +47,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 10-Oct-2004
*/
-public class WSDLDefinitions implements Serializable
+public class WSDLDefinitions extends Extendable implements Serializable
{
private static final long serialVersionUID = 1643422922694990226L;
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLExtensibilityElement.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLExtensibilityElement.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLExtensibilityElement.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.wsdl;
+
+import java.io.Serializable;
+
+import org.w3c.dom.Element;
+
+/**
+ * Common metadata for (unknown) wsdl extensibility elements
+ *
+ * @author Alessio Soldano, <alessio.soldano(a)javalinux.it>
+ * @since 24-Apr-2007
+ *
+ */
+public class WSDLExtensibilityElement implements Serializable
+{
+ private static final long serialVersionUID = -7528676719881753461L;
+
+ /** A REQUIRED uri attribute information item */
+ private String uri;
+ /** An OPTIONAL required attribute information item */
+ private boolean required;
+
+ private Element element;
+
+ public WSDLExtensibilityElement(String uri, Element element)
+ {
+ this.element = element;
+ this.uri = uri;
+ }
+
+ public Element getElement()
+ {
+ return element;
+ }
+
+ public void setElement(Element element)
+ {
+ this.element = element;
+ }
+
+ public boolean isRequired()
+ {
+ return required;
+ }
+
+ public void setRequired(boolean required)
+ {
+ this.required = required;
+ }
+
+ public String getUri()
+ {
+ return uri;
+ }
+
+ public void setUri(String uri)
+ {
+ this.uri = uri;
+ }
+
+}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -72,27 +72,32 @@
log.debug("createConfiguration from: " + configLocation);
config = WSSecurityOMFactory.newInstance().parse(configLocation);
- // Get and set deployment path to the keystore file
- URL keystoreLocation = null;
- if (config.getKeyStoreFile() != null)
- {
- keystoreLocation = getResource(vfsRoot, config.getKeyStoreFile(), true);
- log.debug("Add keystore: " + keystoreLocation);
- config.setKeyStoreURL(keystoreLocation);
- }
-
- URL truststoreLocation = null;
- if (config.getTrustStoreFile() != null)
- {
- truststoreLocation = getResource(vfsRoot, config.getTrustStoreFile(), true);
- log.debug("Add truststore: " + truststoreLocation);
- config.setTrustStoreURL(truststoreLocation);
- }
+ initKeystorePath(vfsRoot, config);
}
return config;
}
+
+ public void initKeystorePath(UnifiedVirtualFile vfsRoot, WSSecurityConfiguration config)
+ {
+ // Get and set deployment path to the keystore file
+ URL keystoreLocation = null;
+ if (config.getKeyStoreFile() != null)
+ {
+ keystoreLocation = getResource(vfsRoot, config.getKeyStoreFile(), true);
+ log.debug("Add keystore: " + keystoreLocation);
+ config.setKeyStoreURL(keystoreLocation);
+ }
+ URL truststoreLocation = null;
+ if (config.getTrustStoreFile() != null)
+ {
+ truststoreLocation = getResource(vfsRoot, config.getTrustStoreFile(), true);
+ log.debug("Add truststore: " + truststoreLocation);
+ config.setTrustStoreURL(truststoreLocation);
+ }
+ }
+
private URL getResource(UnifiedVirtualFile vfsRoot, String resource, boolean failOnNotFound)
{
URL resourceURL = null;
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.io.InputStream;
+import java.io.StringReader;
import java.net.URL;
import java.util.HashMap;
@@ -104,6 +105,28 @@
}
}
+
+ public WSSecurityConfiguration parse(String xmlString) throws JBossXBException
+ {
+ if (xmlString == null)
+ throw new IllegalArgumentException("Security config xml String cannot be null");
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ WSSecurityConfiguration configuration = (WSSecurityConfiguration) unmarshaller.unmarshal(xmlString, this, null);
+ return configuration;
+
+ }
+
+ public WSSecurityConfiguration parse(StringReader strReader) throws JBossXBException
+ {
+ if (strReader == null)
+ throw new IllegalArgumentException("Security InputStream cannot be null");
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ WSSecurityConfiguration configuration = (WSSecurityConfiguration) unmarshaller.unmarshal(strReader, this, null);
+ return configuration;
+ }
+
/**
* This method is called on the factory by the object model builder when the
* parsing starts.
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -53,6 +53,7 @@
import javax.wsdl.Service;
import javax.wsdl.Types;
import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.ElementExtensible;
import javax.wsdl.extensions.ExtensibilityElement;
import javax.wsdl.extensions.UnknownExtensibilityElement;
import javax.wsdl.extensions.mime.MIMEContent;
@@ -74,6 +75,7 @@
import org.jboss.ws.Constants;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.utils.ResourceURL;
+import org.jboss.ws.metadata.wsdl.Extendable;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingMessageReference;
import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
@@ -81,6 +83,7 @@
import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
import org.jboss.ws.metadata.wsdl.WSDLInterface;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
@@ -106,6 +109,7 @@
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* A helper that translates a WSDL-1.1 object graph into a WSDL-2.0 object graph.
@@ -156,6 +160,7 @@
processNamespaces(srcWsdl);
processTypes(srcWsdl, wsdlLoc);
+ processUnknownExtensibilityElements(srcWsdl, destWsdl);
processServices(srcWsdl);
if (getAllDefinedBindings(srcWsdl).size() != destWsdl.getBindings().length)
@@ -209,7 +214,43 @@
destWsdl.registerNamespaceURI(nsURI, prefix);
}
}
-
+
+ private void processUnknownExtensibilityElements(ElementExtensible src, Extendable dest) throws WSDLException
+ {
+ List extElements = src.getExtensibilityElements();
+ for (int i=0; i<extElements.size(); i++)
+ {
+ ExtensibilityElement extElement = (ExtensibilityElement)extElements.get(i);
+ processPolicyElements(extElement, dest);
+ //add processing of further extensibility element types below
+ }
+ }
+
+ private void processPolicyElements(ExtensibilityElement extElement, Extendable dest)
+ {
+ if (extElement instanceof UnknownExtensibilityElement)
+ {
+ Element srcElement = ((UnknownExtensibilityElement)extElement).getElement();
+ if (Constants.URI_WS_POLICY.equals(srcElement.getNamespaceURI()))
+ {
+ //copy missing namespaces from the source element to our element
+ Element element = (Element)srcElement.cloneNode(true);
+ copyMissingNamespaceDeclarations(element, srcElement);
+ if (element.getLocalName().equals("Policy"))
+ {
+ dest.addExtensibilityElement(
+ new WSDLExtensibilityElement(Constants.WSDL_ELEMENT_POLICY,element));
+ }
+ else if (element.getLocalName().equals("PolicyReference"))
+ {
+ dest.addExtensibilityElement(
+ new WSDLExtensibilityElement(Constants.WSDL_ELEMENT_POLICYREFERENCE,element));
+ }
+
+ }
+ }
+ }
+
private void processTypes(Definition srcWsdl, URL wsdlLoc) throws IOException, WSDLException
{
log.trace("BEGIN processTypes: " + wsdlLoc);
@@ -311,6 +352,43 @@
parent = parent.getParentNode();
}
}
+
+ private void copyMissingNamespaceDeclarations(Element destElement, Element srcElement)
+ {
+ String prefix = destElement.getPrefix();
+ String nsUri;
+ try
+ {
+ nsUri = DOMUtils.getElementQName(destElement).getNamespaceURI();
+ }
+ catch (IllegalArgumentException e)
+ {
+ nsUri = null;
+ }
+ if (prefix!=null && nsUri == null)
+ {
+ destElement.setAttributeNS(Constants.NS_XMLNS,"xmlns:"+prefix,srcElement.lookupNamespaceURI(prefix));
+
+ }
+
+ NamedNodeMap attributes = destElement.getAttributes();
+ for (int i = 0; i < attributes.getLength(); i++)
+ {
+ Attr attr = (Attr)attributes.item(i);
+ String attrPrefix = attr.getPrefix();
+ if (attrPrefix!=null && !attr.getName().startsWith("xmlns") && destElement.lookupNamespaceURI(attrPrefix) == null)
+ {
+ destElement.setAttributeNS(Constants.NS_XMLNS,"xmlns:"+attrPrefix,srcElement.lookupNamespaceURI(attrPrefix));
+ }
+ }
+ NodeList childrenList = destElement.getChildNodes();
+ for (int i=0; i<childrenList.getLength(); i++)
+ {
+ Node node = childrenList.item(i);
+ if (node instanceof Element)
+ copyMissingNamespaceDeclarations((Element)node, srcElement);
+ }
+ }
private void processSchemaImport(WSDLTypes types, URL wsdlLoc, Element importEl) throws IOException, WSDLException
{
@@ -465,7 +543,14 @@
if (destWsdl.getInterface(qname) == null)
{
WSDLInterface destInterface = new WSDLInterface(destWsdl, qname);
-
+
+ //policy extensions
+ QName policyURIsProp = (QName)srcPortType.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSP_POLICYURIS);
+ if (policyURIsProp != null && !"".equalsIgnoreCase(policyURIsProp.getLocalPart()))
+ {
+ destInterface.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_POLICYURIS, policyURIsProp.getLocalPart()));
+ }
+
// eventing extensions
QName eventSourceProp = (QName)srcPortType.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSE_EVENTSOURCE);
if (eventSourceProp != null && eventSourceProp.getLocalPart().equals(Boolean.TRUE.toString()))
@@ -487,6 +572,7 @@
Operation srcOperation = (Operation)itOperations.next();
WSDLInterfaceOperation destOperation = new WSDLInterfaceOperation(destInterface, srcOperation.getName());
+ processUnknownExtensibilityElements(srcOperation, destOperation);
destOperation.setStyle(getOperationStyle(srcWsdl, srcPortType, srcOperation));
if (srcOperation.getStyle() != null && false == OperationType.NOTIFICATION.equals(srcOperation.getStyle()))
@@ -545,6 +631,7 @@
destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_IN, srcMessage.getQName().getLocalPart()));
destInput.setPartName(srcPart.getName());
+ processUnknownExtensibilityElements(srcMessage, destInput);
destOperation.addInput(destInput);
}
@@ -565,6 +652,7 @@
// WSDL 2.0 RPC bindings
rpcInput.setElement(destOperation.getName());
rpcInput.setMessageName(srcMessage.getQName());
+ processUnknownExtensibilityElements(srcMessage, rpcInput);
destOperation.addInput(rpcInput);
}
}
@@ -861,6 +949,7 @@
WSDLBinding destBinding = new WSDLBinding(destWsdl, srcBindingQName);
destBinding.setInterfaceName(srcPortType.getQName());
destBinding.setType(bindingType);
+ processUnknownExtensibilityElements(srcBinding, destBinding);
destWsdl.addBinding(destBinding);
// mark SWA Parts upfront
@@ -1011,6 +1100,7 @@
WSDLBindingOperation destBindingOperation = new WSDLBindingOperation(destBinding);
QName refQName = new QName(namespaceURI, srcOperationName);
destBindingOperation.setRef(refQName);
+ processUnknownExtensibilityElements(srcBindingOperation, destBindingOperation);
destBinding.addOperation(destBindingOperation);
String opName = srcOperationName;
@@ -1061,6 +1151,7 @@
List<ExtensibilityElement> extList = srcBindingInput.getExtensibilityElements();
WSDLBindingOperationInput input = new WSDLBindingOperationInput(destBindingOperation);
+ processUnknownExtensibilityElements(srcBindingInput, input);
destBindingOperation.addInput(input);
ReferenceCallback cb = new ReferenceCallback() {
@@ -1284,6 +1375,7 @@
Service srcService = (Service)it.next();
QName qname = srcService.getQName();
WSDLService destService = new WSDLService(destWsdl, qname);
+ processUnknownExtensibilityElements(srcService, destService);
destWsdl.addService(destService);
processPorts(srcWsdl, destService, srcService);
}
@@ -1328,6 +1420,7 @@
WSDLEndpoint destEndpoint = new WSDLEndpoint(destService, endpointName);
destEndpoint.setBinding(srcBinding.getQName());
destEndpoint.setAddress(getSOAPAddress(srcPort));
+ processUnknownExtensibilityElements(srcPort, destEndpoint);
if (processBinding(srcWsdl, srcBinding))
destService.addEndpoint(destEndpoint);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -33,6 +33,7 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.metadata.wsdl.Extendable;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingMessageReference;
import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
@@ -40,6 +41,7 @@
import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
import org.jboss.ws.metadata.wsdl.WSDLImport;
import org.jboss.ws.metadata.wsdl.WSDLInterface;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
@@ -48,6 +50,7 @@
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.metadata.wsdl.WSDLProperty;
import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem;
import org.jboss.ws.metadata.wsdl.WSDLSOAPHeader;
@@ -55,7 +58,11 @@
import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem.Direction;
import org.jboss.wsf.spi.utils.DOMUtils;
import org.jboss.wsf.spi.utils.DOMWriter;
+import org.w3c.dom.Attr;
import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* A WSDL Writer that writes a WSDL 1.1 file. It works off
@@ -158,13 +165,64 @@
writtenFaultMessages.clear();
appendTypes(builder, namespace);
+ appendUnknownExtensibilityElements(builder, wsdl);
appendMessages(builder, namespace);
appendInterfaces(builder, namespace);
appendBindings(builder, namespace);
appendServices(builder, namespace);
builder.append("</definitions>");
}
-
+
+ protected void appendUnknownExtensibilityElements(StringBuilder builder, Extendable extendable)
+ {
+ for (WSDLExtensibilityElement ext : extendable.getAllExtensibilityElements())
+ {
+ appendPolicyElements(builder, ext);
+ //add processing of further extensibility element types below
+ }
+ }
+
+ private void appendPolicyElements(StringBuilder builder, WSDLExtensibilityElement extElem)
+ {
+ if (Constants.WSDL_ELEMENT_POLICY.equalsIgnoreCase(extElem.getUri()) ||
+ Constants.WSDL_ELEMENT_POLICYREFERENCE.equalsIgnoreCase(extElem.getUri()))
+ {
+ appendElementSkippingKnownNs(builder, extElem.getElement());
+ }
+ }
+
+ private void appendElementSkippingKnownNs(StringBuilder builder, Element el)
+ {
+ builder.append("<"+el.getNodeName());
+ NamedNodeMap attributes = el.getAttributes();
+ for (int i = 0; i < attributes.getLength(); i++)
+ {
+ Attr attr = (Attr)attributes.item(i);
+ if (attr.getName().startsWith("xmlns:") && attr.getValue()!=null)
+ {
+ String prefix = attr.getName().substring(6);
+ if (attr.getValue().equalsIgnoreCase(wsdl.getNamespaceURI(prefix)))
+ continue;
+ }
+ builder.append(" "+attr.getName()+"='"+attr.getValue()+"'");
+ }
+ builder.append(">");
+ NodeList childrenList = el.getChildNodes();
+ for (int i=0; i<childrenList.getLength(); i++)
+ {
+ Node node = childrenList.item(i);
+ if (node instanceof Element)
+ {
+ appendElementSkippingKnownNs(builder, (Element)node);
+ }
+ else
+ {
+ builder.append(DOMWriter.printNode(node, false));
+ }
+ }
+ builder.append("</"+el.getNodeName()+">");
+ }
+
protected void appendMessages(StringBuilder buffer, String namespace)
{
WSDLInterface[] interfaces = wsdl.getInterfaces();
@@ -195,7 +253,10 @@
String interfaceName = operation.getWsdlInterface().getName().getLocalPart();
buffer.append("<message name='" + interfaceName + "_" + opname + "' >");
for (WSDLInterfaceOperationInput input : operation.getInputs())
+ {
+ appendUnknownExtensibilityElements(buffer, input); //only one may contain extensibility elements
appendMessageParts(buffer, input);
+ }
buffer.append("</message>");
if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
@@ -311,7 +372,20 @@
if (!namespace.equals(intf.getName().getNamespaceURI()))
continue;
- buffer.append("<portType name='" + intf.getName().getLocalPart() + "'>");
+ buffer.append("<portType name='" + intf.getName().getLocalPart() + "'");
+ WSDLProperty policyProp = intf.getProperty(Constants.WSDL_PROPERTY_POLICYURIS);
+ if (policyProp != null)
+ {
+ String prefix = wsdl.getPrefix(Constants.URI_WS_POLICY);
+ buffer.append(" ");
+ buffer.append(prefix);
+ buffer.append(":");
+ buffer.append(Constants.WSDL_ATTRIBUTE_WSP_POLICYURIS.getLocalPart());
+ buffer.append("='");
+ buffer.append(policyProp.getValue());
+ buffer.append("'");
+ }
+ buffer.append(">");
appendPortOperations(buffer, intf);
buffer.append("</portType>");
}
@@ -351,6 +425,7 @@
}
buffer.append(">");
+ appendUnknownExtensibilityElements(buffer, operation);
String opname = operation.getName().getLocalPart();
String interfaceName = operation.getWsdlInterface().getName().getLocalPart();
@@ -392,6 +467,7 @@
String style = "rpc";
if (wsdlStyle.equals(Constants.DOCUMENT_LITERAL))
style = "document";
+ appendUnknownExtensibilityElements(buffer, binding);
buffer.append("<" + soapPrefix + ":binding transport='http://schemas.xmlsoap.org/soap/http' style='" + style + "'/>");
appendBindingOperations(buffer, binding);
buffer.append("</binding>");
@@ -415,6 +491,7 @@
buffer.append("<operation name='" + interfaceOperation.getName().getLocalPart() + "'>");
String soapAction = (operation.getSOAPAction() != null ? operation.getSOAPAction() : "");
+ appendUnknownExtensibilityElements(buffer, operation);
buffer.append("<" + soapPrefix + ":operation soapAction=\"" + soapAction + "\"/>");
WSDLBindingOperationInput[] inputs = operation.getInputs();
@@ -422,6 +499,7 @@
throw new WSException("WSDl 1.1 only supports In-Only, and In-Out MEPS.");
buffer.append("<input>");
+ appendUnknownExtensibilityElements(buffer, inputs[0]);
appendSOAPBinding(buffer, wsdlInterface, operation, inputs);
buffer.append("</input>");
@@ -519,6 +597,7 @@
if (!namespace.equals(service.getName().getNamespaceURI()))
continue;
buffer.append("<service name='" + service.getName().getLocalPart() + "'>");
+ appendUnknownExtensibilityElements(buffer, service);
WSDLEndpoint[] endpoints = service.getEndpoints();
int lenend = endpoints.length;
for (int j = 0; j < lenend; j++)
@@ -540,6 +619,7 @@
String ebname = prefix + ":" + endpointBinding.getLocalPart();
buffer.append("<port name='" + name + "' binding='" + ebname + "'>");
buffer.append("<" + soapPrefix + ":address location='" + endpoint.getAddress() + "'/>");
+ appendUnknownExtensibilityElements(buffer, endpoint);
buffer.append("</port>");
}
}
\ No newline at end of file
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -21,18 +21,28 @@
*/
package org.jboss.ws.tools.wsdl;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
import java.util.Iterator;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
+import org.apache.ws.policy.Policy;
+import org.apache.ws.policy.util.PolicyFactory;
+import org.apache.ws.policy.util.PolicyWriter;
import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+import org.jboss.ws.extensions.policy.metadata.PolicyMetaExtension;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.MetaDataExtension;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.wsdl.Extendable;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingFault;
import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
@@ -40,6 +50,7 @@
import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
import org.jboss.ws.metadata.wsdl.WSDLImport;
import org.jboss.ws.metadata.wsdl.WSDLInterface;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
@@ -47,11 +58,14 @@
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.metadata.wsdl.WSDLProperty;
import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem;
import org.jboss.ws.metadata.wsdl.WSDLSOAPHeader;
import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem.Direction;
+import org.jboss.wsf.spi.utils.DOMUtils;
+import org.w3c.dom.Element;
/**
@@ -97,7 +111,74 @@
{
processOperation(wsdlInterface, wsdlBinding, operation);
}
+
+ //Policies
+ MetaDataExtension ext = endpoint.getExtension(Constants.URI_WS_POLICY);
+ if (ext != null)
+ {
+ PolicyMetaExtension policyExt = (PolicyMetaExtension)ext;
+ for (Policy policy : policyExt.getPolicies(PolicyScopeLevel.WSDL_PORT))
+ {
+ addPolicyDefinition(policy);
+ addPolicyReference(policy, wsdlEndpoint);
+ }
+ for (Policy policy : policyExt.getPolicies(PolicyScopeLevel.WSDL_PORT_TYPE))
+ {
+ addPolicyDefinition(policy);
+ addPolicyURIAttribute(policy, wsdlInterface);
+ }
+ for (Policy policy : policyExt.getPolicies(PolicyScopeLevel.WSDL_BINDING))
+ {
+ addPolicyDefinition(policy);
+ addPolicyReference(policy, wsdlBinding);
+ }
+ }
}
+
+ protected void addPolicyDefinition(Policy policy)
+ {
+ try
+ {
+ PolicyWriter writer = PolicyFactory.getPolicyWriter(PolicyFactory.StAX_POLICY_WRITER);
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ writer.writePolicy(policy, outputStream);
+ Element element = DOMUtils.parse(outputStream.toString(Constants.DEFAULT_XML_CHARSET));
+ WSDLExtensibilityElement ext = new WSDLExtensibilityElement(Constants.WSDL_ELEMENT_POLICY, element);
+ wsdl.addExtensibilityElement(ext);
+ //optional: to obtain a better looking wsdl, register ws-policy
+ //prefix in wsdl:definitions if it is not defined there yet
+ if (wsdl.getPrefix(element.getNamespaceURI())==null)
+ {
+ wsdl.registerNamespaceURI(element.getNamespaceURI(),element.getPrefix());
+ }
+ }
+ catch (IOException ioe)
+ {
+ throw new WSException("Error while converting policy to element!");
+ }
+ }
+
+ protected void addPolicyReference(Policy policy, Extendable extendable)
+ {
+ QName policyRefQName = Constants.WSDL_ELEMENT_WSP_POLICYREFERENCE;
+ String prefix = wsdl.getPrefix(policyRefQName.getNamespaceURI());
+ if (prefix == null)
+ {
+ prefix = "wsp";
+ wsdl.registerNamespaceURI(policyRefQName.getNamespaceURI(), prefix);
+ }
+ Element element = DOMUtils.createElement(policyRefQName.getLocalPart(), prefix);
+ element.setAttribute("URI", policy.getPolicyURI());
+ //TODO!! we need to understand if the policy is local or not...
+ WSDLExtensibilityElement ext = new WSDLExtensibilityElement(Constants.WSDL_ELEMENT_POLICYREFERENCE, element);
+ extendable.addExtensibilityElement(ext);
+ }
+
+ protected void addPolicyURIAttribute(Policy policy, Extendable extendable)
+ {
+ //TODO!! we need to understand if the policy is local or not...
+ extendable.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_POLICYURIS, policy.getPolicyURI()));
+ }
protected void processOperation(WSDLInterface wsdlInterface, WSDLBinding wsdlBinding, OperationMetaData operation)
{
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -22,23 +22,32 @@
package org.jboss.test.ws.common.wsdl11;
import java.io.File;
+import java.io.Writer;
+import java.util.List;
import javax.xml.namespace.QName;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.tools.validation.WSDLValidator;
import org.jboss.ws.Constants;
import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
import org.jboss.ws.metadata.wsdl.WSDLInterface;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.metadata.wsdl.WSDLProperty;
import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.ws.metadata.wsdl.WSDLTypes;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
+import org.jboss.wsf.spi.utils.IOUtils;
+import org.w3c.dom.Element;
/**
* Test the unmarshalling of wsdl-1.1 into the unified wsdl structure
@@ -182,4 +191,123 @@
WSDLDefinitions wsdlDefinitions = factory.parse(wsdlFile.toURL());
assertNotNull(wsdlDefinitions); // should throw an Exception when SWA parts are not skipped
}
+
+ /**************************************************
+ * Test WSDL 1.1 marshal/unmarshal with policies *
+ **************************************************/
+
+ public void testPolicyAttachment() throws Exception
+ {
+ File wsdlFile = new File("resources/common/wsdl11/PolicyAttachment.wsdl");
+ assertTrue(wsdlFile.exists());
+ testPolicyAttachment(wsdlFile);
+ wsdlFile = new File("resources/common/wsdl11/PolicyAttachmentFragment.wsdl");
+ assertTrue(wsdlFile.exists());
+ testPolicyAttachment(wsdlFile);
+ }
+
+ private void testPolicyAttachment(File wsdlFile) throws Exception
+ {
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdlDefinitions = factory.parse(wsdlFile.toURL());
+ assertNotNull(wsdlDefinitions);
+ List<WSDLExtensibilityElement> list = wsdlDefinitions.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY);
+ assertNotNull(list);
+ assertEquals(list.size(),5);
+ for (WSDLExtensibilityElement extEl : list)
+ {
+ Element el = extEl.getElement();
+ assertNotNull(el);
+ QName qName = new QName(el.getNamespaceURI(),el.getLocalName(),el.getPrefix());
+ assertEquals(qName,new QName("http://schemas.xmlsoap.org/ws/2004/09/policy","Policy","wsp"));
+ assertNotNull(el.getAttributeNodeNS("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...","Id"));
+ //System.out.println(DOMWriter.printNode(extEl.getElement(),true));
+ }
+ }
+
+ public void testServicePolicyRef() throws Exception
+ {
+ File wsdlFile = new File("resources/common/wsdl11/PolicyAttachment.wsdl");
+ testServicePolicyRef(wsdlFile);
+ wsdlFile = new File("resources/common/wsdl11/PolicyAttachmentFragment.wsdl");
+ testServicePolicyRef(wsdlFile);
+ }
+
+ public void testServicePolicyRef(File wsdlFile) throws Exception
+ {
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdlDefinitions = factory.parse(wsdlFile.toURL());
+ WSDLService wsdlService = wsdlDefinitions.getServices()[0];
+ List<WSDLExtensibilityElement> list = wsdlService.getExtensibilityElements(
+ Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ assertNotNull(list);
+ assertEquals(list.size(),1);
+ assertPolicyRef(list.get(0),"uselessServicePolicy");
+ }
+
+ public void testEndpointPolicyRef() throws Exception
+ {
+ File wsdlFile = new File("resources/common/wsdl11/PolicyAttachment.wsdl");
+ testEndpointPolicyRef(wsdlFile);
+ wsdlFile = new File("resources/common/wsdl11/PolicyAttachmentFragment.wsdl");
+ testEndpointPolicyRef(wsdlFile);
+ }
+
+ public void testEndpointPolicyRef(File wsdlFile) throws Exception
+ {
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdlDefinitions = factory.parse(wsdlFile.toURL());
+ WSDLService wsdlService = wsdlDefinitions.getServices()[0];
+ WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoints()[0];
+
+ List<WSDLExtensibilityElement> extPortList = wsdlEndpoint.getExtensibilityElements(
+ Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ assertNotNull(extPortList);
+ assertEquals(extPortList.size(),1);
+ assertPolicyRef(extPortList.get(0),"uselessPortPolicy");
+
+ WSDLProperty extPortTypeProp = wsdlEndpoint.getInterface().getProperty(
+ Constants.WSDL_PROPERTY_POLICYURIS);
+ assertEquals(extPortTypeProp.getValue(),"#RmPolicy");
+
+ WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(wsdlEndpoint.getBinding());
+ List<WSDLExtensibilityElement> extBinding = wsdlBinding.getExtensibilityElements(
+ Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ assertNotNull(extBinding);
+ assertEquals(extBinding.size(),2);
+ assertPolicyRef(extBinding.get(0),"RmPolicy");
+ assertPolicyRef(extBinding.get(1),"X509EndpointPolicy");
+ }
+
+ private void assertPolicyRef(WSDLExtensibilityElement extEl, String policyURI)
+ {
+ Element el = extEl.getElement();
+ QName qName = new QName(el.getNamespaceURI(),el.getLocalName(),el.getPrefix());
+ assertEquals(qName,new QName("http://schemas.xmlsoap.org/ws/2004/09/policy","PolicyReference","wsp"));
+ assertNotNull(el);
+ assertEquals(el.getAttributeNode("URI").getValue(),"#"+policyURI);
+ }
+
+ public void testPolicyAttachmentReadWrite() throws Exception
+ {
+ //Read wsdl containing policies from file and get the wsdl metadata model
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdlDefinitions = factory.parse(new File("resources/common/wsdl11/PolicyAttachment.wsdl").toURL());
+ assertNotNull(wsdlDefinitions);
+ //set wsdlOneOne to null to force wsdl generation from metadata model
+ wsdlDefinitions.setWsdlOneOneDefinition(null);
+
+ //process the wsdl metadata model writing it back to another file
+ File wsdlDir = new File("./tools/wsdl-out");
+ if (!wsdlDir.exists()) wsdlDir.mkdirs();
+ Writer fw = IOUtils.getCharsetFileWriter(new File(wsdlDir+"/GeneratedWsdlWithPolicies.wsdl"), Constants.DEFAULT_XML_CHARSET);
+ new WSDLWriter(wsdlDefinitions).write(fw, Constants.DEFAULT_XML_CHARSET);
+ fw.close();
+
+ //parse the obtained file and validate the resulting wsdl metadata model against the first one
+ WSDLDefinitions newWsdlDefinitions = factory.parse(new File(wsdlDir+"/GeneratedWsdlWithPolicies.wsdl").toURL());
+ assertNotNull(newWsdlDefinitions);
+ WSDLValidator validator = new WSDLValidator();
+ assertTrue(validator.validate(wsdlDefinitions,newWsdlDefinitions));
+ }
}
Added: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/HelloJavaBean.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/HelloJavaBean.java (rev 0)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/HelloJavaBean.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wssecurityAnnotatedpolicy;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.annotation.EndpointConfig;
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+import org.jboss.ws.extensions.policy.annotation.Policy;
+import org.jboss.ws.extensions.policy.annotation.PolicyAttachment;
+
+
+@WebService(name = "Hello", targetNamespace = "http://org.jboss.ws/samples/wssecurityAnnotatedpolicy")
+@PolicyAttachment({@Policy( policyFileLocation="WEB-INF/Policy.xml", scope = PolicyScopeLevel.WSDL_PORT ) })
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class HelloJavaBean
+{
+ private Logger log = Logger.getLogger(HelloJavaBean.class);
+
+ @WebMethod
+ public UserType echoUserType(@WebParam(name = "user") UserType in0)
+ {
+ log.info(in0);
+ return in0;
+ }
+}
Added: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/SimpleEncryptTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/SimpleEncryptTestCase.java (rev 0)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/SimpleEncryptTestCase.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wssecurityAnnotatedpolicy;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.core.jaxws.client.ServiceExt;
+
+/**
+ * Test WS-Security with RPC/Literal
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision: 2385 $
+ */
+public class SimpleEncryptTestCase extends JBossWSTest
+{
+ /** Construct the test case with a given name
+ */
+
+ /** Deploy the test */
+ public static Test suite() throws Exception
+ {
+ return JBossWSTestSetup.newTestSetup(SimpleEncryptTestCase.class, "jaxws-samples-wssecurityAnnotatedpolicy-encrypt.war");
+ }
+
+ /**
+ * Test JSE endpoint
+ */
+ public void testEndpoint() throws Exception
+ {
+ Hello hello = getPort();
+
+ UserType in0 = new UserType();
+ in0.setMsg("Kermit");
+ UserType retObj = hello.echoUserType(in0);
+ assertEquals("Kermit", retObj.getMsg());
+ }
+
+ private Hello getPort() throws Exception
+ {
+ URL wsdlURL = new File("wsprovide/resources/jaxws/samples/wssecurityAnnotatedpolicy/HelloService.wsdl").toURL();
+ QName serviceName = new QName("http://org.jboss.ws/samples/wssecurityAnnotatedpolicy", "HelloService");
+
+
+ Service service = Service.create(wsdlURL, serviceName);
+
+ Hello port = (Hello)service.getPort(Hello.class);
+
+ Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
+ reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxws-samples-wssecurityAnnotatedpolicy-encrypt");
+
+ return port;
+ }
+}
\ No newline at end of file
Added: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java (rev 0)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wssecuritypolicy;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.annotation.EndpointConfig;
+
+@WebService(name = "Hello", targetNamespace = "http://org.jboss.ws/samples/wssecuritypolicy", wsdlLocation="WEB-INF/wsdl/HelloService.wsdl")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class HelloJavaBean
+{
+ private Logger log = Logger.getLogger(HelloJavaBean.class);
+
+ @WebMethod
+ public UserType echoUserType(@WebParam(name = "user") UserType in0)
+ {
+ log.info(in0);
+ return in0;
+ }
+}
Added: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/SimpleEncryptTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/SimpleEncryptTestCase.java (rev 0)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/SimpleEncryptTestCase.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wssecuritypolicy;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.core.jaxws.client.ServiceExt;
+
+/**
+ * Test WS-Security with RPC/Literal
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision: 2385 $
+ */
+public class SimpleEncryptTestCase extends JBossWSTest
+{
+ /** Construct the test case with a given name
+ */
+
+ /** Deploy the test */
+ public static Test suite() throws Exception
+ {
+ return JBossWSTestSetup.newTestSetup(SimpleEncryptTestCase.class, "jaxws-samples-wssecuritypolicy-encrypt.war");
+ }
+
+ /**
+ * Test JSE endpoint
+ */
+ public void testEndpoint() throws Exception
+ {
+ Hello hello = getPort();
+
+ UserType in0 = new UserType();
+ in0.setMsg("Kermit");
+ UserType retObj = hello.echoUserType(in0);
+ assertEquals("Kermit", retObj.getMsg());
+ }
+
+ private Hello getPort() throws Exception
+ {
+ URL wsdlURL = new File("resources/jaxws/samples/wssecuritypolicy/WEB-INF/wsdl/HelloService.wsdl").toURL();
+ QName serviceName = new QName("http://org.jboss.ws/samples/wssecuritypolicy", "HelloService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+
+ Hello port = (Hello)service.getPort(Hello.class);
+
+ Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
+ reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxws-samples-wssecuritypolicy-encrypt");
+
+ return port;
+ }
+}
\ No newline at end of file
Added: trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1645/JBWS1645TestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1645/JBWS1645TestCase.java (rev 0)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1645/JBWS1645TestCase.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,151 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.tools.jbws1645;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.Writer;
+
+import org.apache.ws.policy.Policy;
+import org.apache.ws.policy.util.DOMPolicyReader;
+import org.apache.ws.policy.util.PolicyFactory;
+import org.apache.ws.policy.util.PolicyReader;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.tools.sei.StandardJavaTypes;
+import org.jboss.test.ws.tools.validation.WSDLValidator;
+import org.jboss.ws.Constants;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.wsf.spi.utils.IOUtils;
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+import org.jboss.ws.extensions.policy.metadata.PolicyMetaExtension;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.tools.JavaToWSDL;
+import org.jboss.ws.tools.WSToolsConstants;
+import org.jboss.ws.tools.metadata.ToolsUnifiedMetaDataBuilder;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
+
+/**
+ *
+ * @author Alessio Soldano, <alessio.soldano(a)javalinux.it>
+ * @since 05-May-2007
+ */
+public class JBWS1645TestCase extends JBossWSTest
+{
+ private PolicyReader reader;
+
+ public JBWS1645TestCase()
+ {
+ super();
+ setPolicyReader();
+ }
+
+ public JBWS1645TestCase(String name)
+ {
+ super(name);
+ setPolicyReader();
+ }
+
+ private void setPolicyReader()
+ {
+ reader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
+ }
+
+ public void testWSDLGeneratorWithPolicies() throws Exception
+ {
+ Class seiClass = StandardJavaTypes.class;
+ String fixturefile = "resources/tools/jbws1645/StandardJavaTypesServiceJBWS1645.wsdl";
+
+ File wsdlDir = new File("./tools/jbws1645");
+ wsdlDir.mkdirs();
+
+ String sname = WSDLUtils.getJustClassName(seiClass) + "Service";
+ String wsdlPath = wsdlDir + "/" + sname + "JBWS1645.wsdl";
+ String targetNamespace = "http://org.jboss.ws";
+ Style style = Style.DOCUMENT;
+ JavaToWSDL jwsdl = new JavaToWSDL(Constants.NS_WSDL11);
+ jwsdl.setServiceName(sname);
+ jwsdl.setTargetNamespace(targetNamespace);
+ jwsdl.addFeature(WSToolsConstants.WSTOOLS_FEATURE_RESTRICT_TO_TARGET_NS, true);
+ jwsdl.setStyle(style);
+
+ //manually generate the umd using tools
+ UnifiedMetaData umd = new ToolsUnifiedMetaDataBuilder(seiClass, targetNamespace,
+ null, sname, style, null, null).getUnifiedMetaData();
+ jwsdl.setUmd(umd);
+
+ //manually add policies to the umd
+ ServiceMetaData serviceMetaData = umd.getServices().get(0);
+ EndpointMetaData epMetaData = serviceMetaData.getEndpoints().get(0);
+ addPolicy(new File("resources/tools/jbws1645/PortPolicy.txt"), PolicyScopeLevel.WSDL_PORT, epMetaData);
+ addPolicy(new File("resources/tools/jbws1645/PortTypePolicy.txt"), PolicyScopeLevel.WSDL_PORT_TYPE, epMetaData);
+ addPolicy(new File("resources/tools/jbws1645/BindingPolicy.txt"), PolicyScopeLevel.WSDL_BINDING, epMetaData);
+
+ //generate the wsdl definitions and write the wsdl file
+ WSDLDefinitions wsdl = jwsdl.generate(seiClass);
+
+ //performe some trivial checks on wsdl definitions
+ assertEquals(1, wsdl.getServices()[0].getEndpoints()[0].getExtensibilityElements(
+ Constants.WSDL_ELEMENT_POLICYREFERENCE).size());
+ assertNotNull(wsdl.getInterfaces()[0].getProperty(Constants.WSDL_PROPERTY_POLICYURIS));
+ assertEquals(1, wsdl.getBindings()[0].getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE).size());
+ assertEquals(3, wsdl.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY).size());
+
+ Writer fw = IOUtils.getCharsetFileWriter(new File(wsdlPath), Constants.DEFAULT_XML_CHARSET);
+ new WSDLWriter(wsdl).write(fw, Constants.DEFAULT_XML_CHARSET);
+ fw.close();
+
+ //validate the generated WSDL
+ validateGeneratedWSDL(new File(wsdlPath), new File(fixturefile));
+
+ }
+
+ private void addPolicy(File sourceFile, PolicyScopeLevel scope, ExtensibleMetaData extMetaData) throws Exception
+ {
+ PolicyMetaExtension ext = (PolicyMetaExtension)extMetaData.getExtension(Constants.URI_WS_POLICY);
+ if (ext == null)
+ {
+ ext = new PolicyMetaExtension(Constants.URI_WS_POLICY);
+ extMetaData.addExtension(ext);
+ }
+ FileInputStream fis = new FileInputStream(sourceFile);
+ Policy policy = reader.readPolicy(fis);
+ fis.close();
+ ext.addPolicy(scope, policy);
+ }
+
+ private void validateGeneratedWSDL(File wsdlFile, File expectedWsdlFile) throws Exception
+ {
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdl = factory.parse(wsdlFile.toURL());
+ WSDLDefinitions expWsdl = factory.parse(expectedWsdlFile.toURL());
+ assertNotNull(wsdl);
+ assertNotNull(expWsdl);
+ WSDLValidator validator = new WSDLValidator();
+ assertTrue(validator.validate(expWsdl,wsdl));
+ }
+}
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidationHelper.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidationHelper.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidationHelper.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -21,24 +21,34 @@
*/
package org.jboss.test.ws.tools.validation;
+import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import javax.xml.namespace.QName;
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.metadata.wsdl.Extendable;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
import org.jboss.ws.metadata.wsdl.WSDLBindingOperationInput;
import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.metadata.wsdl.WSDLExtensibilityElement;
import org.jboss.ws.metadata.wsdl.WSDLInterface;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInfault;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.metadata.wsdl.WSDLProperty;
import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
+import org.jboss.wsf.spi.utils.DOMUtils;
+import org.w3c.dom.Element;
/**
* WSDL Validator Helper class
@@ -47,6 +57,9 @@
*/
public class WSDLValidationHelper
{
+
+ private final static Logger log = Logger.getLogger(WSDLValidationHelper.class);
+
/**
* Validate the WSDLBinding objects
* @param w1 WSDLDefinitions object for the first wsdl
@@ -56,7 +69,7 @@
*/
public static boolean validateBindings(WSDLDefinitions w1, WSDLDefinitions w2)
throws JBossWSToolsException
- { boolean bool = false;
+ { boolean bool = true;
WSDLBinding[] bindings1 = w1.getBindings();
WSDLBinding[] bindings2 = w2.getBindings();
if (bindings1 == null || bindings1.length == 0)
@@ -74,7 +87,8 @@
{
WSDLBinding binding1 = bindings1[i];
WSDLBinding binding2 = bindings2[i];
- bool = validateBindingOperations(binding1.getOperations(),binding2.getOperations());
+ bool = bool && validateExtensibilityElements(binding1, binding2);
+ bool = bool && validateBindingOperations(binding1.getOperations(),binding2.getOperations());
}
return bool;
}
@@ -123,6 +137,103 @@
}
/**
+ * Validates the extensibility elements contained into the specified Extendable
+ * objects.
+ * @param w1
+ * @param w2
+ * @return
+ * @throws JBossWSToolsException
+ */
+ public static boolean validateExtensibilityElements(Extendable ext1, Extendable ext2)
+ throws JBossWSToolsException
+ {
+ boolean bool = true;
+ //add validation of further extensibility element types below
+ if (bool) bool = validatePolicyElements(ext1,ext2);
+
+ return bool;
+ }
+
+
+ private static boolean validatePolicyElements(Extendable ext1, Extendable ext2)
+ throws JBossWSToolsException
+ {
+ //policies
+ List<WSDLExtensibilityElement> pol1 = new ArrayList<WSDLExtensibilityElement>(
+ ext1.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY));
+ List<WSDLExtensibilityElement> pol2 = new ArrayList<WSDLExtensibilityElement>(
+ ext2.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY));
+ //check whether lists are the same size
+ if (pol1.size() != pol2.size())
+ throw new JBossWSToolsException("Policy WSDLExtensibilityElement mismatch!");
+ //check equality
+ for (WSDLExtensibilityElement el1 : pol1)
+ {
+ boolean done = false;
+ Iterator it = pol2.iterator();
+ WSDLExtensibilityElement el2 = null;
+ while (it.hasNext() && !done)
+ {
+ el2 = (WSDLExtensibilityElement)it.next();
+ done = (el1.isRequired() == el2.isRequired()) &&
+ checkElementEquality(el1.getElement(), el2.getElement());
+ }
+ if (!done)
+ {
+ log.error("Failing policy validation on policy on: "+ext1+" and "+ext2);
+ return false;
+ }
+ pol2.remove(el2);
+ }
+ //policy references
+ List<WSDLExtensibilityElement> polRef1 = new ArrayList<WSDLExtensibilityElement>(
+ ext1.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE));
+ List<WSDLExtensibilityElement> polRef2 = new ArrayList<WSDLExtensibilityElement>(
+ ext2.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE));
+ //check whether lists are the same size
+ if (polRef1.size() != polRef2.size())
+ throw new JBossWSToolsException("Policy ref WSDLExtensibilityElement mismatch!");
+ //check equality
+ for (WSDLExtensibilityElement el1 : polRef1)
+ {
+ boolean done = false;
+ Iterator it = polRef2.iterator();
+ WSDLExtensibilityElement el2 = null;
+ while (it.hasNext() && !done)
+ {
+ el2 = (WSDLExtensibilityElement)it.next();
+ done = (el1.isRequired() == el2.isRequired()) &&
+ checkElementEquality(el1.getElement(), el2.getElement());
+ }
+ if (!done)
+ {
+ log.error("Failing policy validation on policy ref on: "+ext1+" and "+ext2);
+ return false;
+ }
+ polRef2.remove(el2);
+ }
+ //check properties
+ WSDLProperty prop1 = ext1.getProperty(Constants.WSDL_PROPERTY_POLICYURIS);
+ WSDLProperty prop2 = ext2.getProperty(Constants.WSDL_PROPERTY_POLICYURIS);
+ if (prop1 != null || prop2 != null)
+ {
+ if (prop1 == null || prop2 == null || prop1.isRequired() != prop2.isRequired())
+ throw new JBossWSToolsException("Policy prop WSDLExtensibilityElement mismatch!");
+ String value1 = prop1.getValue();
+ String value2 = prop2.getValue();
+ if (value1 != null || value2 != null)
+ {
+ if (value1 == null || value2 == null || !value1.equalsIgnoreCase(value2))
+ {
+ log.error("Failing policy validation on policy uri prop on: "+ext1+" and "+ext2);
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
* Validates the namespace definitions in the wsdl
* @param w1 WSDL Definitions for the first wsdl
* @param w2 WSDL Definitions for the second wsdl
@@ -215,9 +326,10 @@
bool = checkQNameEquality(s1.getName(),s2.getName());
if(bool)
{
+ bool = validateExtensibilityElements(s1, s2);
WSDLEndpoint[] we1 = s1.getEndpoints();
WSDLEndpoint[] we2 = s2.getEndpoints();
- bool = validateWSDLEndpoints(we1, we2);
+ bool = bool && validateWSDLEndpoints(we1, we2);
}
}
return bool;
@@ -238,11 +350,46 @@
return true;
}
+ /**
+ * Compare two Element (s) for equality (this cares about child elements and attributes only)
+ * @param el1
+ * @param el2
+ * @return
+ */
+ private static boolean checkElementEquality(Element el1, Element el2)
+ {
+ QName qName1 = DOMUtils.getElementQName(el1);
+ QName qName2 = DOMUtils.getElementQName(el2);
+ if (!checkQNameEquality(qName1,qName2)) return false;
+ Map attributes1 = DOMUtils.getAttributes(el1); //map <QName, String>
+ Map attributes2 = DOMUtils.getAttributes(el2);
+ if (attributes1.size()!=attributes2.size()) return false;
+ for (Iterator it = attributes1.keySet().iterator(); it.hasNext(); )
+ {
+ QName key = (QName)it.next();
+ if (key.getPrefix().startsWith("xmlns")) continue;
+ if (!attributes2.containsKey(key)) return false;
+ String value1 = (String)attributes1.get(key);
+ String value2 = (String)attributes2.get(key);
+ if (!value1.equals(value2)) return false;
+ }
+ for (Iterator it = DOMUtils.getChildElements(el1); it.hasNext(); )
+ {
+ Element child1 = (Element)it.next();
+ Iterator it2 = DOMUtils.getChildElements(el2, DOMUtils.getElementQName(child1));
+ if (!it2.hasNext()) return false;
+ Element child2 = (Element)it2.next();
+ if (it2.hasNext() || !checkElementEquality(child1, child2)) return false;
+ }
+ return true;
+ }
+
private static boolean validateInterfaceOperation(WSDLInterfaceOperation w1,
WSDLInterfaceOperation w2) throws JBossWSToolsException
{
boolean bool = checkQNameEquality(w1.getName(),w2.getName());
+ bool = bool && validateExtensibilityElements(w1, w2);
if(bool)
{
//validate the inputs
@@ -323,6 +470,9 @@
bool = checkQNameEquality(xmlName1,xmlName2);
if(bool == false)
throw new JBossWSToolsException(xmlName1 + " & " + xmlName2 + " mismatch");
+ bool = validateExtensibilityElements(i1, i2);
+ if(bool == false)
+ throw new JBossWSToolsException("WSDLExtensibilityElement mismatch");
return bool;
}
@@ -374,6 +524,7 @@
WSDLBindingOperationInput bindin1 = wb1[i];
WSDLBindingOperationInput bindin2 = wb2[i];
bool = checkStringEquality(bindin1.getMessageLabel(),bindin2.getMessageLabel());
+ bool = bool & validateExtensibilityElements(bindin1, bindin2);
if(!bool) return bool;
}
@@ -390,6 +541,7 @@
WSDLBindingOperationOutput bindout2 = wboutarr2[i];
bool = checkStringEquality(bindout1.getMessageLabel(),bindout2.getMessageLabel());
}
+ bool = bool & validateExtensibilityElements(b1, b2);
return bool;
}
@@ -416,6 +568,7 @@
bool = checkQNameEquality(e1.getName(),e2.getName());
if(bool == false)
throw new JBossWSToolsException("Endpoint Names do not match");
+ bool = bool && validateExtensibilityElements(e1, e2);
}
return bool;
}
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidator.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidator.java 2007-05-23 12:31:03 UTC (rev 3216)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidator.java 2007-05-23 14:51:22 UTC (rev 3217)
@@ -100,6 +100,8 @@
{
boolean bool = false;
bool = WSDLValidationHelper.validateNSDefinitions(wsdlExp,wsdlAct);
+ if ( bool )
+ bool = WSDLValidationHelper.validateExtensibilityElements(wsdlExp,wsdlAct);
if( bool)
bool = WSDLValidationHelper.validateBindings(wsdlExp,wsdlAct);
if( bool)
Added: trunk/jbossws-core/src/test/resources/common/wsdl11/PolicyAttachment.wsdl
===================================================================
--- trunk/jbossws-core/src/test/resources/common/wsdl11/PolicyAttachment.wsdl (rev 0)
+++ trunk/jbossws-core/src/test/resources/common/wsdl11/PolicyAttachment.wsdl 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<definitions name="TestService" targetNamespace="http://org.jboss.ws/jaxrpc"
+ xmlns:tns="http://org.jboss.ws/jaxrpc"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:ns2="http://org.jboss.ws/jaxrpc/types"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:fab="http://www.fabrikam123.example.com/stock"
+ xmlns:rmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+ xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..." >
+ <wsp:Policy wsu:Id="RmPolicy" >
+ <rmp:RMAssertion>
+ <rmp:InactivityTimeout Milliseconds="600000" />
+ <rmp:BaseRetransmissionInterval Milliseconds="3000" />
+ <rmp:ExponentialBackoff />
+ <rmp:AcknowledgementInterval Milliseconds="200" />
+ </rmp:RMAssertion>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="uselessServicePolicy" >
+ <fab:useless>nothing</fab:useless>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="uselessPortPolicy" >
+ <fab:useless>nothing again</fab:useless>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="X509EndpointPolicy" >
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <!-- Details omitted for readability -->
+ <sp:IncludeTimestamp />
+ <sp:OnlySignEntireHeadersAndBody />
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="SecureMessagePolicy" >
+ <sp:SignedParts>
+ <sp:Body />
+ </sp:SignedParts>
+ <sp:EncryptedParts>
+ <sp:Body />
+ </sp:EncryptedParts>
+ </wsp:Policy>
+ <types>
+ <schema targetNamespace="http://org.jboss.ws/jaxrpc/types" xmlns:tns="http://org.jboss.ws/jaxrpc/types" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">
+ <complexType name="echoSimpleUserType">
+ <sequence>
+ <element name="String_1" type="string" nillable="true"/>
+ <element name="SimpleUserType_2" type="tns:SimpleUserType" nillable="true"/>
+ </sequence>
+ </complexType>
+ <complexType name="SimpleUserType">
+ <sequence>
+ <element name="a" type="int"/>
+ <element name="b" type="int"/>
+ </sequence>
+ </complexType>
+ <complexType name="echoSimpleUserTypeResponse">
+ <sequence>
+ <element name="result" type="tns:SimpleUserType" nillable="true"/>
+ </sequence>
+ </complexType>
+ <complexType name="echoString">
+ <sequence>
+ <element name="String_1" type="string" nillable="true"/>
+ <element name="String_2" type="string" nillable="true"/>
+ </sequence>
+ </complexType>
+ <complexType name="echoStringResponse">
+ <sequence>
+ <element name="result" type="string" nillable="true"/>
+ </sequence>
+ </complexType>
+ <element name="echoSimpleUserType" type="tns:echoSimpleUserType"/>
+ <element name="echoSimpleUserTypeResponse" type="tns:echoSimpleUserTypeResponse"/>
+ <element name="echoString" type="tns:echoString"/>
+ <element name="echoStringResponse" type="tns:echoStringResponse"/>
+ </schema>
+ </types>
+ <message name="JaxRpcTestService_echoSimpleUserType">
+ <part name="parameters" element="ns2:echoSimpleUserType"/>
+ </message>
+ <message name="JaxRpcTestService_echoSimpleUserTypeResponse">
+ <part name="result" element="ns2:echoSimpleUserTypeResponse"/>
+ </message>
+ <message name="JaxRpcTestService_echoString">
+ <part name="parameters" element="ns2:echoString"/>
+ </message>
+ <message name="JaxRpcTestService_echoStringResponse">
+ <part name="result" element="ns2:echoStringResponse"/>
+ </message>
+ <portType name="JaxRpcTestService" wsp:PolicyURIs="#RmPolicy">
+ <operation name="echoSimpleUserType">
+ <input message="tns:JaxRpcTestService_echoSimpleUserType"/>
+ <output message="tns:JaxRpcTestService_echoSimpleUserTypeResponse"/>
+ </operation>
+ <operation name="echoString">
+ <input message="tns:JaxRpcTestService_echoString"/>
+ <output message="tns:JaxRpcTestService_echoStringResponse"/>
+ </operation>
+ </portType>
+ <binding name="JaxRpcTestServiceBinding" type="tns:JaxRpcTestService">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsp:PolicyReference URI="#RmPolicy" wsdl:required="true" />
+ <wsp:PolicyReference URI="#X509EndpointPolicy" wsdl:required="true" />
+ <operation name="echoSimpleUserType">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoString">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="TestService">
+ <wsp:PolicyReference URI="#uselessServicePolicy" wsdl:required="true" />
+ <port name="JaxRpcTestServicePort" binding="tns:JaxRpcTestServiceBinding">
+ <wsp:PolicyReference URI="#uselessPortPolicy" wsdl:required="true" />
+ <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
+ </port>
+ </service>
+</definitions>
Added: trunk/jbossws-core/src/test/resources/common/wsdl11/PolicyAttachmentFragment.wsdl
===================================================================
--- trunk/jbossws-core/src/test/resources/common/wsdl11/PolicyAttachmentFragment.wsdl (rev 0)
+++ trunk/jbossws-core/src/test/resources/common/wsdl11/PolicyAttachmentFragment.wsdl 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<definitions name="TestService" targetNamespace="http://org.jboss.ws/jaxrpc"
+ xmlns:tns="http://org.jboss.ws/jaxrpc"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:fab="http://www.fabrikam123.example.com/stock"
+ xmlns:rmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+ xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..." >
+ <wsp:Policy wsu:Id="RmPolicy" >
+ <rmp:RMAssertion>
+ <rmp:InactivityTimeout Milliseconds="600000" />
+ <rmp:BaseRetransmissionInterval Milliseconds="3000" />
+ <rmp:ExponentialBackoff />
+ <rmp:AcknowledgementInterval Milliseconds="200" />
+ </rmp:RMAssertion>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="uselessServicePolicy" >
+ <fab:useless>nothing</fab:useless>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="uselessPortPolicy" >
+ <fab:useless>nothing again</fab:useless>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="X509EndpointPolicy" >
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <!-- Details omitted for readability -->
+ <sp:IncludeTimestamp />
+ <sp:OnlySignEntireHeadersAndBody />
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="SecureMessagePolicy" >
+ <sp:SignedParts>
+ <sp:Body />
+ </sp:SignedParts>
+ <sp:EncryptedParts>
+ <sp:Body />
+ </sp:EncryptedParts>
+ </wsp:Policy>
+ <types>
+ </types>
+ <portType name="JaxRpcTestService" wsp:PolicyURIs="#RmPolicy">
+ </portType>
+ <binding name="JaxRpcTestServiceBinding" type="tns:JaxRpcTestService">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsp:PolicyReference URI="#RmPolicy" wsdl:required="true" />
+ <wsp:PolicyReference URI="#X509EndpointPolicy" wsdl:required="true" />
+ </binding>
+ <service name="TestService">
+ <wsp:PolicyReference URI="#uselessServicePolicy" wsdl:required="true" />
+ <port name="JaxRpcTestServicePort" binding="tns:JaxRpcTestServiceBinding">
+ <wsp:PolicyReference URI="#uselessPortPolicy" wsdl:required="true" />
+ <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
+ </port>
+ </service>
+</definitions>
Added: trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/META-INF/wsdl/HelloService.wsdl
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/META-INF/wsdl/HelloService.wsdl (rev 0)
+++ trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/META-INF/wsdl/HelloService.wsdl 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='HelloService' targetNamespace='http://org.jboss.ws/samples/wssecurity' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/samples/wssecurity' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <xs:schema targetNamespace='http://org.jboss.ws/samples/wssecurity' version='1.0' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:complexType name='UserType'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='msg' type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name='Hello_echoUserType'>
+ <part name='user' type='tns:UserType'/>
+ </message>
+ <message name='Hello_echoUserTypeResponse'>
+ <part name='return' type='tns:UserType'/>
+ </message>
+ <portType name='Hello'>
+ <operation name='echoUserType' parameterOrder='user'>
+ <input message='tns:Hello_echoUserType'/>
+ <output message='tns:Hello_echoUserTypeResponse'/>
+ </operation>
+ </portType>
+ <binding name='HelloBinding' type='tns:Hello'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echoUserType'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.ws/samples/wssecurity' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.ws/samples/wssecurity' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='HelloService'>
+ <port binding='tns:HelloBinding' name='HelloPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Added: trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF/Policy.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF/Policy.xml (rev 0)
+++ trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF/Policy.xml 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<wsp:Policy wsu:Id="X509EndpointPolicy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:jboss-ws-security xmlns:sp="http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+ <sp:key-store-file>WEB-INF/wsse.keystore</sp:key-store-file>
+ <sp:key-store-password>jbossws</sp:key-store-password>
+ <sp:trust-store-file>WEB-INF/wsse.truststore</sp:trust-store-file>
+ <sp:trust-store-password>jbossws</sp:trust-store-password>
+ <sp:config>
+ <sp:encrypt type="x509v3" alias="wsse"/>
+ <sp:requires>
+ <sp:encryption/>
+ </sp:requires>
+ </sp:config>
+ </sp:jboss-ws-security>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
Added: trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF/web.xml (rev 0)
+++ trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF/web.xml 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>HelloService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wssecurityAnnotatedpolicy.HelloJavaBean</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>HelloService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
+
Added: trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/wsse.keystore
===================================================================
(Binary files differ)
Property changes on: trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/wsse.keystore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/wsse.truststore
===================================================================
(Binary files differ)
Property changes on: trunk/jbossws-core/src/test/resources/jaxws/samples/wssecurityAnnotatedpolicy/wsse.truststore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/WEB-INF/web.xml (rev 0)
+++ trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/WEB-INF/web.xml 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>HelloService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wssecuritypolicy.HelloJavaBean</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>HelloService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
+
Added: trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/WEB-INF/wsdl/HelloService.wsdl
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/WEB-INF/wsdl/HelloService.wsdl (rev 0)
+++ trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/WEB-INF/wsdl/HelloService.wsdl 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='HelloService' targetNamespace='http://org.jboss.ws/samples/wssecuritypolicy' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://org.jboss.ws/samples/wssecurity' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/samples/wssecuritypolicy' xmlns:wsp='http://schemas.xmlsoap.org/ws/2004/09/policy' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <xs:schema targetNamespace='http://org.jboss.ws/samples/wssecurity' version='1.0' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:complexType name='UserType'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='msg' type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <wsp:Policy wsu:Id='X509EndpointPolicy' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>
+ <wsp:All>
+ <sp:jboss-ws-security xmlns:sp='http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+ <sp:key-store-file>WEB-INF/wsse.keystore</sp:key-store-file>
+ <sp:key-store-password>jbossws</sp:key-store-password>
+ <sp:trust-store-file>WEB-INF/wsse.truststore</sp:trust-store-file>
+ <sp:trust-store-password>jbossws</sp:trust-store-password>
+ <sp:config>
+ <sp:encrypt alias='wsse' type='x509v3'/>
+ <sp:requires>
+ <sp:encryption/>
+ </sp:requires>
+ </sp:config>
+ </sp:jboss-ws-security>
+ </wsp:All>
+ </wsp:Policy>
+ <message name='Hello_echoUserType'>
+ <part name='user' type='ns1:UserType'/>
+ </message>
+ <message name='Hello_echoUserTypeResponse'>
+ <part name='return' type='ns1:UserType'/>
+ </message>
+ <portType name='Hello'>
+ <operation name='echoUserType' parameterOrder='user'>
+ <input message='tns:Hello_echoUserType'/>
+ <output message='tns:Hello_echoUserTypeResponse'/>
+ </operation>
+ </portType>
+ <binding name='HelloBinding' type='tns:Hello'>
+ <wsp:PolicyReference URI='#X509EndpointPolicy'/>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echoUserType'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.ws/samples/wssecuritypolicy' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.ws/samples/wssecuritypolicy' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='HelloService'>
+ <port binding='tns:HelloBinding' name='HelloPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Added: trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/wsse.keystore
===================================================================
(Binary files differ)
Property changes on: trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/wsse.keystore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/wsse.truststore
===================================================================
(Binary files differ)
Property changes on: trunk/jbossws-core/src/test/resources/jaxws/samples/wssecuritypolicy/wsse.truststore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbossws-core/src/test/resources/tools/jbws1645/BindingPolicy.txt
===================================================================
--- trunk/jbossws-core/src/test/resources/tools/jbws1645/BindingPolicy.txt (rev 0)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1645/BindingPolicy.txt 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,9 @@
+<wsp:Policy wsu:Id="X509EndpointPolicy" xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...' xmlns:wsp='http://schemas.xmlsoap.org/ws/2004/09/policy' xmlns:sp='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy'>
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <!-- Details omitted for readability -->
+ <sp:IncludeTimestamp />
+ <sp:OnlySignEntireHeadersAndBody />
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+</wsp:Policy>
Added: trunk/jbossws-core/src/test/resources/tools/jbws1645/PortPolicy.txt
===================================================================
--- trunk/jbossws-core/src/test/resources/tools/jbws1645/PortPolicy.txt (rev 0)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1645/PortPolicy.txt 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,3 @@
+<wsp:Policy wsu:Id="uselessPortPolicy" xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...' xmlns:wsp='http://schemas.xmlsoap.org/ws/2004/09/policy' xmlns:fab='http://www.fabrikam123.example.com/stock'>
+ <fab:useless>nothing again</fab:useless>
+</wsp:Policy>
Added: trunk/jbossws-core/src/test/resources/tools/jbws1645/PortTypePolicy.txt
===================================================================
--- trunk/jbossws-core/src/test/resources/tools/jbws1645/PortTypePolicy.txt (rev 0)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1645/PortTypePolicy.txt 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,8 @@
+<wsp:Policy wsu:Id='RmPolicy' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...' xmlns:rmp='http://schemas.xmlsoap.org/ws/2005/02/rm/policy' xmlns:wsp='http://schemas.xmlsoap.org/ws/2004/09/policy'>
+ <rmp:RMAssertion>
+ <rmp:InactivityTimeout Milliseconds='600000'/>
+ <rmp:BaseRetransmissionInterval Milliseconds='3000'/>
+ <rmp:ExponentialBackoff/>
+ <rmp:AcknowledgementInterval Milliseconds='200'/>
+ </rmp:RMAssertion>
+</wsp:Policy>
Added: trunk/jbossws-core/src/test/resources/tools/jbws1645/StandardJavaTypesServiceJBWS1645.wsdl
===================================================================
--- trunk/jbossws-core/src/test/resources/tools/jbws1645/StandardJavaTypesServiceJBWS1645.wsdl (rev 0)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1645/StandardJavaTypesServiceJBWS1645.wsdl 2007-05-23 14:51:22 UTC (rev 3217)
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='StandardJavaTypesService' targetNamespace='http://org.jboss.ws'
+ xmlns='http://schemas.xmlsoap.org/wsdl/'
+ xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+ xmlns:tns='http://org.jboss.ws'
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'
+ xmlns:wsp='http://schemas.xmlsoap.org/ws/2004/09/policy'>
+ <wsp:Policy wsu:Id='RmPolicy' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>
+ <rmp:RMAssertion xmlns:rmp='http://schemas.xmlsoap.org/ws/2005/02/rm/policy'>
+ <rmp:InactivityTimeout Milliseconds='600000' />
+ <rmp:BaseRetransmissionInterval Milliseconds='3000' />
+ <rmp:ExponentialBackoff />
+ <rmp:AcknowledgementInterval Milliseconds='200' />
+ </rmp:RMAssertion>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id='uselessPortPolicy' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>
+ <fab:useless xmlns:fab='http://www.fabrikam123.example.com/stock'>nothing again</fab:useless>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id='X509EndpointPolicy' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>
+ <sp:AsymmetricBinding xmlns:sp='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy'>
+ <wsp:Policy>
+ <!-- Details omitted for readability -->
+ <sp:IncludeTimestamp />
+ <sp:OnlySignEntireHeadersAndBody />
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ </wsp:Policy>
+ <types>
+ <schema targetNamespace='http://org.jboss.ws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://org.jboss.ws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <complexType name='echoCalendar'>
+ <sequence>
+ <element name='Calendar_1' nillable='true' type='dateTime'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoCalendarResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='dateTime'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoDate'>
+ <sequence>
+ <element name='Date_1' nillable='true' type='dateTime'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoDateResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='dateTime'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoDecimal'>
+ <sequence>
+ <element name='BigDecimal_1' nillable='true' type='decimal'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoDecimalResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='decimal'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoInteger'>
+ <sequence>
+ <element name='BigInteger_1' nillable='true' type='integer'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoIntegerResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='integer'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoQName'>
+ <sequence>
+ <element name='QName_1' nillable='true' type='QName'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoQNameResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='QName'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoString'>
+ <sequence>
+ <element name='String_1' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoStringResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoURI'>
+ <sequence>
+ <element name='URI_1' nillable='true' type='anyURI'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoURIResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='anyURI'/>
+ </sequence>
+ </complexType>
+ <element name='echoCalendar' type='tns:echoCalendar'/>
+ <element name='echoCalendarResponse' type='tns:echoCalendarResponse'/>
+ <element name='echoDate' type='tns:echoDate'/>
+ <element name='echoDateResponse' type='tns:echoDateResponse'/>
+ <element name='echoDecimal' type='tns:echoDecimal'/>
+ <element name='echoDecimalResponse' type='tns:echoDecimalResponse'/>
+ <element name='echoInteger' type='tns:echoInteger'/>
+ <element name='echoIntegerResponse' type='tns:echoIntegerResponse'/>
+ <element name='echoQName' type='tns:echoQName'/>
+ <element name='echoQNameResponse' type='tns:echoQNameResponse'/>
+ <element name='echoString' type='tns:echoString'/>
+ <element name='echoStringResponse' type='tns:echoStringResponse'/>
+ <element name='echoURI' type='tns:echoURI'/>
+ <element name='echoURIResponse' type='tns:echoURIResponse'/>
+ </schema>
+ </types>
+ <message name='StandardJavaTypes_echoCalendar' xmlns='http://schemas.xmlsoap.org/wsdl/'>
+ <part element='tns:echoCalendar' name='echoCalendar'/>
+ </message>
+ <message name='StandardJavaTypes_echoCalendarResponse'>
+ <part element='tns:echoCalendarResponse' name='echoCalendarResponse'/>
+ </message>
+ <message name='StandardJavaTypes_echoDate'>
+ <part element='tns:echoDate' name='echoDate'/>
+ </message>
+ <message name='StandardJavaTypes_echoDateResponse'>
+ <part element='tns:echoDateResponse' name='echoDateResponse'/>
+ </message>
+ <message name='StandardJavaTypes_echoDecimal'>
+ <part element='tns:echoDecimal' name='echoDecimal'/>
+ </message>
+ <message name='StandardJavaTypes_echoDecimalResponse'>
+ <part element='tns:echoDecimalResponse' name='echoDecimalResponse'/>
+ </message>
+ <message name='StandardJavaTypes_echoInteger'>
+ <part element='tns:echoInteger' name='echoInteger'/>
+ </message>
+ <message name='StandardJavaTypes_echoIntegerResponse'>
+ <part element='tns:echoIntegerResponse' name='echoIntegerResponse'/>
+ </message>
+ <message name='StandardJavaTypes_echoQName'>
+ <part element='tns:echoQName' name='echoQName'/>
+ </message>
+ <message name='StandardJavaTypes_echoQNameResponse'>
+ <part element='tns:echoQNameResponse' name='echoQNameResponse'/>
+ </message>
+ <message name='StandardJavaTypes_echoString'>
+ <part element='tns:echoString' name='echoString'/>
+ </message>
+ <message name='StandardJavaTypes_echoStringResponse'>
+ <part element='tns:echoStringResponse' name='echoStringResponse'/>
+ </message>
+ <message name='StandardJavaTypes_echoURI'>
+ <part element='tns:echoURI' name='echoURI'/>
+ </message>
+ <message name='StandardJavaTypes_echoURIResponse'>
+ <part element='tns:echoURIResponse' name='echoURIResponse'/>
+ </message>
+ <portType name='StandardJavaTypes' wsp:PolicyURIs='#RmPolicy'>
+ <operation name='echoCalendar' parameterOrder='echoCalendar'>
+ <input message='tns:StandardJavaTypes_echoCalendar'/>
+ <output message='tns:StandardJavaTypes_echoCalendarResponse'/>
+ </operation>
+ <operation name='echoDate' parameterOrder='echoDate'>
+ <input message='tns:StandardJavaTypes_echoDate'/>
+ <output message='tns:StandardJavaTypes_echoDateResponse'/>
+ </operation>
+ <operation name='echoDecimal' parameterOrder='echoDecimal'>
+ <input message='tns:StandardJavaTypes_echoDecimal'/>
+ <output message='tns:StandardJavaTypes_echoDecimalResponse'/>
+ </operation>
+ <operation name='echoInteger' parameterOrder='echoInteger'>
+ <input message='tns:StandardJavaTypes_echoInteger'/>
+ <output message='tns:StandardJavaTypes_echoIntegerResponse'/>
+ </operation>
+ <operation name='echoQName' parameterOrder='echoQName'>
+ <input message='tns:StandardJavaTypes_echoQName'/>
+ <output message='tns:StandardJavaTypes_echoQNameResponse'/>
+ </operation>
+ <operation name='echoString' parameterOrder='echoString'>
+ <input message='tns:StandardJavaTypes_echoString'/>
+ <output message='tns:StandardJavaTypes_echoStringResponse'/>
+ </operation>
+ <operation name='echoURI' parameterOrder='echoURI'>
+ <input message='tns:StandardJavaTypes_echoURI'/>
+ <output message='tns:StandardJavaTypes_echoURIResponse'/>
+ </operation>
+ </portType>
+ <binding name='StandardJavaTypesBinding' type='tns:StandardJavaTypes'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <wsp:PolicyReference URI='#X509EndpointPolicy' />
+ <operation name='echoCalendar'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='echoDate'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='echoDecimal'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='echoInteger'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='echoQName'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='echoString'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='echoURI'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='StandardJavaTypesService'>
+ <port binding='tns:StandardJavaTypesBinding' name='StandardJavaTypesPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ <wsp:PolicyReference URI='#uselessPortPolicy' />
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
17 years, 8 months
JBossWS SVN: r3216 - trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-23 08:31:03 -0400 (Wed, 23 May 2007)
New Revision: 3216
Removed:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/JAXWSBuilderTestCase.java
Log:
Fix namespace testcase
Deleted: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/JAXWSBuilderTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/JAXWSBuilderTestCase.java 2007-05-23 12:06:16 UTC (rev 3215)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/JAXWSBuilderTestCase.java 2007-05-23 12:31:03 UTC (rev 3216)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.namespace;
-
-// $Id: $
-
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-
-import junit.framework.Test;
-
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.JBossWSTestSetup;
-
-/**
- * Test the JAX-WS metadata builder.
- *
- * @author Heiko.Braun(a)jboss.org
- * @since 23.01.2007
- */
-public class JAXWSBuilderTestCase extends JBossWSTest
-{
-
- public static Test suite()
- {
- return JBossWSTestSetup.newTestSetup(JAXWSBuilderTestCase.class, "jaxws-namespace.war");
- }
-
- /**
- * If the @WebService.targetNamespace annotation is on a service implementation bean that does NOT reference a service
- * endpoint interface (through the endpointInterface annotation element), the targetNamespace is used for both the
- * wsdl:portType and the wsdl:service (and associated XML elements).
- *
- * If the @WebService.targetNamespace annotation is on a service implementation bean that does reference a service endpoint
- * interface (through the endpointInterface annotation element), the targetNamespace is used for only the wsdl:service (and
- * associated XML elements).
- */
- public void testSEIDerivedNamespaces() throws Exception
- {
- // Create the port
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-namespace?wsdl");
- QName qname = new QName("http://example.org/impl", "EndpointBeanService");
- Service service = Service.create(wsdlURL, qname);
- EndpointInterface port = service.getPort(EndpointInterface.class);
-
- String helloWorld = "Hello world!";
- String response = port.echo(helloWorld);
- assertEquals(helloWorld, response);
-
- }
-}
17 years, 8 months
JBossWS SVN: r3215 - in branches/jbossws-2.0/jbossws-core/src: resources/schema and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-23 08:06:16 -0400 (Wed, 23 May 2007)
New Revision: 3215
Added:
branches/jbossws-2.0/jbossws-core/src/resources/schema/swaref.xsd
Modified:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
Log:
Fix JBWS-1660
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java 2007-05-23 12:04:14 UTC (rev 3214)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java 2007-05-23 12:06:16 UTC (rev 3215)
@@ -56,6 +56,7 @@
registerEntity("http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd", "j2ee_web_services_client_1_1.xsd");
registerEntity("http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd", "j2ee_web_services_1_1.xsd");
registerEntity("http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd", "j2ee_jaxrpc_mapping_1_1.xsd");
+ registerEntity("http://ws-i.org/profiles/basic/1.1/swaref.xsd", "schema/swaref.xsd");
}
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
Added: branches/jbossws-2.0/jbossws-core/src/resources/schema/swaref.xsd
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/resources/schema/swaref.xsd (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/resources/schema/swaref.xsd 2007-05-23 12:06:16 UTC (rev 3215)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2002-2004 by The Web Services-Interoperability Organization (WS-I) and
+ Certain of its Members. All Rights Reserved.
+
+ Notice
+ The material contained herein is not a license, either expressly or impliedly, to any
+ intellectual property owned or controlled by any of the authors or developers of this
+ material or WS-I. The material contained herein is provided on an "AS IS" basis and to
+ the maximum extent permitted by applicable law, this material is provided AS IS AND WITH
+ ALL FAULTS, and the authors and developers of this material and WS-I hereby disclaim all
+ other warranties and conditions, either express, implied or statutory, including, but not
+ limited to, any (if any) implied warranties, duties or conditions of merchantability,
+ of fitness for a particular purpose, of accuracy or completeness of responses, of results,
+ of workmanlike effort, of lack of viruses, and of lack of negligence. ALSO, THERE IS NO
+ WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO
+ DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THIS MATERIAL.
+
+ IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR WS-I BE LIABLE TO ANY OTHER
+ PARTY FOR THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE,
+ LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES
+ WHETHER UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR
+ ANY OTHER AGREEMENT RELATING TO THIS MATERIAL, WHETHER OR NOT SUCH PARTY HAD ADVANCE
+ NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
+
+ WS-I License Information
+ Use of this WS-I Material is governed by the WS-I Test License and other licenses. Information on these
+ licenses are contained in the README.txt and ReleaseNotes.txt files. By downloading this file, you agree
+ to the terms of these licenses.
+
+ How To Provide Feedback
+ The Web Services-Interoperability Organization (WS-I) would like to receive input,
+ suggestions and other feedback ("Feedback") on this work from a wide variety of
+ industry participants to improve its quality over time.
+
+ By sending email, or otherwise communicating with WS-I, you (on behalf of yourself if
+ you are an individual, and your company if you are providing Feedback on behalf of the
+ company) will be deemed to have granted to WS-I, the members of WS-I, and other parties
+ that have access to your Feedback, a non-exclusive, non-transferable, worldwide, perpetual,
+ irrevocable, royalty-free license to use, disclose, copy, license, modify, sublicense or
+ otherwise distribute and exploit in any manner whatsoever the Feedback you provide regarding
+ the work. You acknowledge that you have no expectation of confidentiality with respect to
+ any Feedback you provide. You represent and warrant that you have rights to provide this
+ Feedback, and if you are providing Feedback on behalf of a company, you represent and warrant
+ that you have the rights to provide Feedback on behalf of your company. You also acknowledge
+ that WS-I is not required to review, discuss, use, consider or in any way incorporate your
+ Feedback into future versions of its work. If WS-I does incorporate some or all of your
+ Feedback in a future version of the work, it may, but is not obligated to include your name
+ (or, if you are identified as acting on behalf of your company, the name of your company) on
+ a list of contributors to the work. If the foregoing is not acceptable to you and any company
+ on whose behalf you are acting, please do not provide any Feedback.
+
+ Feedback on this document should be directed to wsi-test-comments(a)ws-i.org.
+-->
+<xsd:schema targetNamespace="http://ws-i.org/profiles/basic/1.1/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:simpleType name="swaRef">
+ <xsd:restriction base="xsd:anyURI"/>
+ </xsd:simpleType>
+</xsd:schema>
\ No newline at end of file
Property changes on: branches/jbossws-2.0/jbossws-core/src/resources/schema/swaref.xsd
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 8 months
JBossWS SVN: r3214 - trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-23 08:04:14 -0400 (Wed, 23 May 2007)
New Revision: 3214
Added:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/MultipleNamespacesTestCase.java
Log:
Rename test case
Copied: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/MultipleNamespacesTestCase.java (from rev 3213, trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/JAXWSBuilderTestCase.java)
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/MultipleNamespacesTestCase.java (rev 0)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/MultipleNamespacesTestCase.java 2007-05-23 12:04:14 UTC (rev 3214)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.namespace;
+
+// $Id: $
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+
+/**
+ * Test the JAX-WS metadata builder.
+ *
+ * @author Heiko.Braun(a)jboss.org
+ * @since 23.01.2007
+ */
+public class MultipleNamespacesTestCase extends JBossWSTest
+{
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(MultipleNamespacesTestCase.class, "jaxws-namespace.war");
+ }
+
+ /**
+ * If the @WebService.targetNamespace annotation is on a service implementation bean that does NOT reference a service
+ * endpoint interface (through the endpointInterface annotation element), the targetNamespace is used for both the
+ * wsdl:portType and the wsdl:service (and associated XML elements).
+ *
+ * If the @WebService.targetNamespace annotation is on a service implementation bean that does reference a service endpoint
+ * interface (through the endpointInterface annotation element), the targetNamespace is used for only the wsdl:service (and
+ * associated XML elements).
+ */
+ public void testSEIDerivedNamespaces() throws Exception
+ {
+ // Create the port
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-namespace?wsdl");
+ QName qname = new QName("http://example.org/impl", "EndpointBeanService");
+ Service service = Service.create(wsdlURL, qname);
+ EndpointInterface port = service.getPort(EndpointInterface.class);
+
+ String helloWorld = "Hello world!";
+ String response = port.echo(helloWorld);
+ assertEquals(helloWorld, response);
+
+ }
+}
17 years, 8 months
JBossWS SVN: r3213 - in trunk/jbossws-core: src/test/java/org/jboss/test/ws/jaxws and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-23 08:03:18 -0400 (Wed, 23 May 2007)
New Revision: 3213
Added:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/
trunk/jbossws-core/src/test/resources/jaxws/namespace/
Removed:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/
trunk/jbossws-core/src/test/resources/jaxws/metadata/
Modified:
trunk/jbossws-core/ant-import-tests/build-jars-jaxws.xml
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/EndpointBean.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/EndpointInterface.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/JAXWSBuilderTestCase.java
trunk/jbossws-core/src/test/resources/jaxws/namespace/WEB-INF/jboss-web.xml
trunk/jbossws-core/src/test/resources/jaxws/namespace/WEB-INF/web.xml
Log:
Fix namespace testcase
Modified: trunk/jbossws-core/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- trunk/jbossws-core/ant-import-tests/build-jars-jaxws.xml 2007-05-23 12:02:26 UTC (rev 3212)
+++ trunk/jbossws-core/ant-import-tests/build-jars-jaxws.xml 2007-05-23 12:03:18 UTC (rev 3213)
@@ -230,15 +230,14 @@
</metainf>
</jar>
- <!-- jaxws metadata -->
- <war warfile="${tests.output.dir}/libs/jaxws-metadata.war" webxml="${tests.output.dir}/resources/jaxws/metadata/WEB-INF/web.xml">
+ <!-- jaxws namespace -->
+ <war warfile="${tests.output.dir}/libs/jaxws-namespace.war" webxml="${tests.output.dir}/resources/jaxws/namespace/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
- <include name="org/jboss/test/ws/jaxws/metadata/EndpointBean.class"/>
- <include name="org/jboss/test/ws/jaxws/metadata/EndpointInterface.class"/>
+ <include name="org/jboss/test/ws/jaxws/namespace/EndpointBean.class"/>
+ <include name="org/jboss/test/ws/jaxws/namespace/EndpointInterface.class"/>
</classes>
- <webinf dir="${tests.output.dir}/resources/jaxws/metadata/WEB-INF">
+ <webinf dir="${tests.output.dir}/resources/jaxws/namespace/WEB-INF">
<include name="jboss-web.xml"/>
- <include name="wsdl/*"/>
</webinf>
</war>
Copied: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace (from rev 3199, trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata)
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/EndpointBean.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EndpointBean.java 2007-05-23 05:45:07 UTC (rev 3199)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/EndpointBean.java 2007-05-23 12:03:18 UTC (rev 3213)
@@ -19,22 +19,50 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.ws.jaxws.metadata;
+package org.jboss.test.ws.jaxws.namespace;
+import javax.annotation.Resource;
import javax.jws.WebService;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPException;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.utils.DOMWriter;
+
/**
* Test namespace differences at service and portType levels
*
* @author Thomas.Diesler(a)jboss.org
* @since 29-Apr-2005
*/
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.metadata.EndpointInterface", targetNamespace = "http://example.org/impl")
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.namespace.EndpointInterface", targetNamespace = "http://example.org/impl")
public class EndpointBean implements EndpointInterface
{
+ private static final Logger log = Logger.getLogger(EndpointBean.class);
+
+ @Resource
+ WebServiceContext context;
+
public String echo(String message)
{
- System.out.println(message);
+ log.info("echo:" + message);
+
+ try
+ {
+ SOAPMessageContext msgContext = (SOAPMessageContext)context.getMessageContext();
+ SOAPBody body = msgContext.getMessage().getSOAPBody();
+ String bodyStr = DOMWriter.printNode(body, false);
+ if (bodyStr.indexOf("http://example.org/sei") < 0)
+ throw new WebServiceException("Invalid body: " + bodyStr);
+ }
+ catch (SOAPException ex)
+ {
+ throw new WebServiceException(ex);
+ }
+
return message;
}
}
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/EndpointInterface.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/EndpointInterface.java 2007-05-23 05:45:07 UTC (rev 3199)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/EndpointInterface.java 2007-05-23 12:03:18 UTC (rev 3213)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.ws.jaxws.metadata;
+package org.jboss.test.ws.jaxws.namespace;
import javax.jws.WebMethod;
import javax.jws.WebParam;
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/JAXWSBuilderTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/metadata/JAXWSBuilderTestCase.java 2007-05-23 05:45:07 UTC (rev 3199)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/namespace/JAXWSBuilderTestCase.java 2007-05-23 12:03:18 UTC (rev 3213)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.ws.jaxws.metadata;
+package org.jboss.test.ws.jaxws.namespace;
// $Id: $
@@ -44,7 +44,7 @@
public static Test suite()
{
- return JBossWSTestSetup.newTestSetup(JAXWSBuilderTestCase.class, "jaxws-metadata.war");
+ return JBossWSTestSetup.newTestSetup(JAXWSBuilderTestCase.class, "jaxws-namespace.war");
}
/**
@@ -59,7 +59,7 @@
public void testSEIDerivedNamespaces() throws Exception
{
// Create the port
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-metadata?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-namespace?wsdl");
QName qname = new QName("http://example.org/impl", "EndpointBeanService");
Service service = Service.create(wsdlURL, qname);
EndpointInterface port = service.getPort(EndpointInterface.class);
Copied: trunk/jbossws-core/src/test/resources/jaxws/namespace (from rev 3199, trunk/jbossws-core/src/test/resources/jaxws/metadata)
Modified: trunk/jbossws-core/src/test/resources/jaxws/namespace/WEB-INF/jboss-web.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/metadata/WEB-INF/jboss-web.xml 2007-05-23 05:45:07 UTC (rev 3199)
+++ trunk/jbossws-core/src/test/resources/jaxws/namespace/WEB-INF/jboss-web.xml 2007-05-23 12:03:18 UTC (rev 3213)
@@ -3,5 +3,5 @@
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
<jboss-web>
- <context-root>/jaxws-metadata</context-root>
+ <context-root>/jaxws-namespace</context-root>
</jboss-web>
\ No newline at end of file
Modified: trunk/jbossws-core/src/test/resources/jaxws/namespace/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/metadata/WEB-INF/web.xml 2007-05-23 05:45:07 UTC (rev 3199)
+++ trunk/jbossws-core/src/test/resources/jaxws/namespace/WEB-INF/web.xml 2007-05-23 12:03:18 UTC (rev 3213)
@@ -7,7 +7,7 @@
<servlet>
<servlet-name>TestService</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxws.metadata.EndpointBean</servlet-class>
+ <servlet-class>org.jboss.test.ws.jaxws.namespace.EndpointBean</servlet-class>
</servlet>
<servlet-mapping>
17 years, 8 months
JBossWS SVN: r3212 - branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-23 08:02:26 -0400 (Wed, 23 May 2007)
New Revision: 3212
Added:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java
Modified:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
Log:
Added rpc/lit example
Added: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java (rev 0)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java 2007-05-23 12:02:26 UTC (rev 3212)
@@ -0,0 +1,19 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.ejb.Remote;
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import java.rmi.RemoteException;
+
+@Remote
+@WebService
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface RpcLitEndpoint
+{
+ @WebMethod
+ @XmlAttachmentRef
+ DataHandler echo(@XmlAttachmentRef DataHandler data) throws RemoteException;
+}
Property changes on: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java (rev 0)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java 2007-05-23 12:02:26 UTC (rev 3212)
@@ -0,0 +1,33 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import org.jboss.ws.annotation.WebContext;
+import org.jboss.ws.WSException;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+import javax.activation.DataHandler;
+import java.rmi.RemoteException;
+import java.io.IOException;
+
+@Stateless
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.swaref.RpcLitEndpoint")
+@WebContext(contextRoot = "jaxws-swaref")
+public class RpcLitEndpointImpl implements RpcLitEndpoint
+{
+
+ @WebMethod
+ public DataHandler echo(DataHandler data) throws RemoteException
+ {
+ try
+ {
+ System.out.println("Got " + data.getContent() );
+ return new DataHandler("Server data", "text/plain");
+ }
+ catch (IOException e)
+ {
+ throw new WSException(e);
+ }
+
+ }
+}
Property changes on: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2007-05-23 11:52:35 UTC (rev 3211)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2007-05-23 12:02:26 UTC (rev 3212)
@@ -3,7 +3,6 @@
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.core.StubExt;
import javax.xml.ws.Service;
import javax.xml.ws.BindingProvider;
@@ -18,17 +17,19 @@
{
private String bareEndpointURL = "http://" + getServerHost() + ":8080/jaxws-swaref/BareEndpointImpl";
private String wrappedEndpointURL = "http://" + getServerHost() + ":8080/jaxws-swaref/WrappedEndpointImpl";
+ private String rpclitEndpointURL = "http://" + getServerHost() + ":8080/jaxws-swaref/RpcLitEndpointImpl";
private QName bareServiceQName = new QName("http://swaref.samples.jaxws.ws.test.jboss.org/", "BareEndpointImplService");
- private QName wrappedServiceQName = new QName("http://swaref.samples.jaxws.ws.test.jboss.org/", "WrappedEndpointImplService");
+ private QName wrappedServiceQName = new QName("http://swaref.samples.jaxws.ws.test.jboss.org/", "WrappedEndpointImplService");
+ private QName rpcLitServiceQName = new QName("http://swaref.samples.jaxws.ws.test.jboss.org/", "RpcLitEndpointImplService");
private static DataHandler data = new DataHandler("Client data", "text/plain");
-
+
public static Test suite()
{
return JBossWSTestSetup.newTestSetup(SWARefTestCase.class, "jaxws-samples-swaref.jar");
}
-
+
public void testSubmitAttachment() throws Exception
{
Service service = Service.create(new URL(bareEndpointURL +"?wsdl"), bareServiceQName);
@@ -48,16 +49,22 @@
Service service = Service.create(new URL(wrappedEndpointURL+"?wsdl"), wrappedServiceQName);
WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
- // tweak endpoint URL
- BindingProvider provider = (BindingProvider)port;
- provider.getRequestContext().put(
- BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- wrappedEndpointURL
- );
-
- DocumentPayload response = port.myTest(new DocumentPayload(data), "Hello world");
+ DocumentPayload response = port.echo(new DocumentPayload(data), "Wrapped test");
assertTrue(response.getData().getContent().equals("Server data"));
}
+ public void testRpcLitEndpoint() throws Exception
+ {
+ System.out.println("FIXME [JBWS-1460]: @XmlMimeType and @XmlAttachmentRef on SEI parameter declarations");
+ /*Service service = Service.create(new URL(rpclitEndpointURL+"?wsdl"), rpcLitServiceQName);
+ RpcLitEndpoint port = service.getPort(RpcLitEndpoint.class);
+
+ DataHandler response = port.echo(data);
+ assertNotNull("Response was null", response);
+ assertTrue(response.getContent().equals("Server data"));
+ */
+ }
+
+
}
Modified: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java 2007-05-23 11:52:35 UTC (rev 3211)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java 2007-05-23 12:02:26 UTC (rev 3212)
@@ -1,7 +1,5 @@
package org.jboss.test.ws.jaxws.samples.swaref;
-import org.jboss.ws.annotation.WebContext;
-
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.ejb.Remote;
@@ -12,8 +10,8 @@
public interface WrappedEndpoint
{
/* (non-Javadoc)
- * @see org.jboss.ws.test.TestService#myTest(javax.activation.DataHandler)
+ * @see org.jboss.ws.test.TestService#echo(javax.activation.DataHandler)
*/
@WebMethod
- DocumentPayload myTest(DocumentPayload dhw, String test) throws RemoteException;
+ DocumentPayload echo(DocumentPayload dhw, String test) throws RemoteException;
}
Modified: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java 2007-05-23 11:52:35 UTC (rev 3211)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java 2007-05-23 12:02:26 UTC (rev 3212)
@@ -17,10 +17,10 @@
public class WrappedEndpointImpl implements WrappedEndpoint
{
/* (non-Javadoc)
- * @see org.jboss.ws.test.TestService#myTest(javax.activation.DataHandler)
+ * @see org.jboss.ws.test.TestService#echo(javax.activation.DataHandler)
*/
@WebMethod
- public DocumentPayload myTest(DocumentPayload dhw, String test) throws RemoteException
+ public DocumentPayload echo(DocumentPayload dhw, String test) throws RemoteException
{
DataHandler dh;
17 years, 8 months
JBossWS SVN: r3211 - branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/extensions/xop/jaxws.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-23 07:52:35 -0400 (Wed, 23 May 2007)
New Revision: 3211
Modified:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java
Log:
Docs and comments
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java 2007-05-23 11:29:47 UTC (rev 3210)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java 2007-05-23 11:52:35 UTC (rev 3211)
@@ -34,13 +34,13 @@
import java.util.List;
/**
- * Scans data types for MTOM and swaRef declarations.
+ * Scans java beans for MTOM and swaRef declarations.<br>
* It basically searches for
* <ul>
* <li><code>@XmlMimeType</code>
* <li><code>@XmlAttachmentRef</code>
* </ul>
- * and returns the appropriate mimetype.
+ * and returns the appropriate mimetype.<br>
* In order to re-use an instance of this class you need to invoke <code>reset()</code>
* in between scans.
*
@@ -73,8 +73,7 @@
*/
public AttachmentScanResult scan(Class xmlRoot)
{
- if( isJDKType(xmlRoot) ) // TODO: this fails with wrapper beans
- return null;
+ if( isJDKType(xmlRoot) ) return null;
AttachmentScanResult result = null;
17 years, 8 months
JBossWS SVN: r3210 - in trunk/build/hudson/hudson-home/jobs: AS-Tests-AS-5.0 and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-23 07:29:47 -0400 (Wed, 23 May 2007)
New Revision: 3210
Modified:
trunk/build/hudson/hudson-home/jobs/AS-Tests-AS-4.2/config.xml
trunk/build/hudson/hudson-home/jobs/AS-Tests-AS-5.0/config.xml
trunk/build/hudson/hudson-home/jobs/Core-Tests-AS-4.2/config.xml
trunk/build/hudson/hudson-home/jobs/Core-Tests-AS-5.0/config.xml
trunk/build/hudson/hudson-home/jobs/Integration-Native-AS-4.2/config.xml
trunk/build/hudson/hudson-home/jobs/Integration-Native-AS-5.0/config.xml
trunk/build/hudson/hudson-home/jobs/Integration-SunRI-AS-5.0/config.xml
trunk/build/hudson/hudson-home/jobs/Integration-XFire-AS-5.0/config.xml
Log:
clobber before doing anything
Modified: trunk/build/hudson/hudson-home/jobs/AS-Tests-AS-4.2/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/AS-Tests-AS-4.2/config.xml 2007-05-23 11:23:56 UTC (rev 3209)
+++ trunk/build/hudson/hudson-home/jobs/AS-Tests-AS-4.2/config.xml 2007-05-23 11:29:47 UTC (rev 3210)
@@ -18,7 +18,8 @@
#
cd $JBWSDIR/build
cp ant.properties.example ant.properties
-
+ant clobber
+
#
# stop jbossas
#
@@ -28,7 +29,7 @@
# deploy to jboss
#
cd $JBWSDIR/jbossws-core
-ant $ENVIRONMENT clobber deploy-jboss42
+ant $ENVIRONMENT deploy-jboss42
#
# start jbossas
Modified: trunk/build/hudson/hudson-home/jobs/AS-Tests-AS-5.0/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/AS-Tests-AS-5.0/config.xml 2007-05-23 11:23:56 UTC (rev 3209)
+++ trunk/build/hudson/hudson-home/jobs/AS-Tests-AS-5.0/config.xml 2007-05-23 11:29:47 UTC (rev 3210)
@@ -18,6 +18,7 @@
#
cd $JBWSDIR/build
cp ant.properties.example ant.properties
+ant clobber
#
# stop jbossas
@@ -28,7 +29,7 @@
# deploy to jboss
#
cd $JBWSDIR/jbossws-core
-ant $ENVIRONMENT clobber deploy-jboss50
+ant $ENVIRONMENT deploy-jboss50
#
# start jbossas
Modified: trunk/build/hudson/hudson-home/jobs/Core-Tests-AS-4.2/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/Core-Tests-AS-4.2/config.xml 2007-05-23 11:23:56 UTC (rev 3209)
+++ trunk/build/hudson/hudson-home/jobs/Core-Tests-AS-4.2/config.xml 2007-05-23 11:29:47 UTC (rev 3210)
@@ -18,6 +18,7 @@
#
cd $JBWSDIR/build
cp ant.properties.example ant.properties
+ant clobber
#
# stop jbossas
@@ -28,7 +29,7 @@
# deploy to jboss
#
cd $JBWSDIR/jbossws-core
-ant $ENVIRONMENT clobber deploy-jboss42
+ant $ENVIRONMENT deploy-jboss42
#
# start jbossas
@@ -38,7 +39,7 @@
#
# execute tests
#
-ant $ENVIRONMENT tests-clean tests 2>&1 | tee $WORKSPACE/tests.out
+ant $ENVIRONMENT tests 2>&1 | tee $WORKSPACE/tests.out
cat $WORKSPACE/tests.out | egrep FIXME\|FAILED | sort -u
#
Modified: trunk/build/hudson/hudson-home/jobs/Core-Tests-AS-5.0/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/Core-Tests-AS-5.0/config.xml 2007-05-23 11:23:56 UTC (rev 3209)
+++ trunk/build/hudson/hudson-home/jobs/Core-Tests-AS-5.0/config.xml 2007-05-23 11:29:47 UTC (rev 3210)
@@ -18,6 +18,7 @@
#
cd $JBWSDIR/build
cp ant.properties.example ant.properties
+ant clobber
#
# stop jbossas
@@ -28,7 +29,7 @@
# deploy to jboss
#
cd $JBWSDIR/jbossws-core
-ant $ENVIRONMENT clobber deploy-jboss50
+ant $ENVIRONMENT deploy-jboss50
#
# start jbossas
@@ -38,7 +39,7 @@
#
# execute tests
#
-ant $ENVIRONMENT tests-clean tests 2>&1 | tee $WORKSPACE/tests.out
+ant $ENVIRONMENT tests 2>&1 | tee $WORKSPACE/tests.out
cat $WORKSPACE/tests.out | egrep FIXME\|FAILED | sort -u
#
Modified: trunk/build/hudson/hudson-home/jobs/Integration-Native-AS-4.2/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/Integration-Native-AS-4.2/config.xml 2007-05-23 11:23:56 UTC (rev 3209)
+++ trunk/build/hudson/hudson-home/jobs/Integration-Native-AS-4.2/config.xml 2007-05-23 11:29:47 UTC (rev 3210)
@@ -18,6 +18,7 @@
#
cd $JBWSDIR/build
cp ant.properties.example ant.properties
+ant clobber
#
# stop jbossas
@@ -28,7 +29,7 @@
# Build jbws-jboss42
#
cd $JBWSDIR/integration/jbws
-ant $ENVIRONMENT clobber deploy-jboss42
+ant $ENVIRONMENT deploy-jboss42
#
# start jbossas
@@ -39,7 +40,7 @@
#
# execute tests
#
-ant $ENVIRONMENT tests-clean tests 2>&1 | tee $WORKSPACE/tests.out
+ant $ENVIRONMENT tests 2>&1 | tee $WORKSPACE/tests.out
cat $WORKSPACE/tests.out | egrep FIXME\|FAILED | sort -u
#
Modified: trunk/build/hudson/hudson-home/jobs/Integration-Native-AS-5.0/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/Integration-Native-AS-5.0/config.xml 2007-05-23 11:23:56 UTC (rev 3209)
+++ trunk/build/hudson/hudson-home/jobs/Integration-Native-AS-5.0/config.xml 2007-05-23 11:29:47 UTC (rev 3210)
@@ -18,6 +18,7 @@
#
cd $JBWSDIR/build
cp ant.properties.example ant.properties
+ant clobber
#
# stop jbossas
@@ -28,7 +29,7 @@
# Build deploy-jboss50
#
cd $JBWSDIR/integration/jbws
-ant $ENVIRONMENT clobber deploy-jboss50
+ant $ENVIRONMENT deploy-jboss50
#
# start jbossas
@@ -39,7 +40,7 @@
#
# execute tests
#
-ant $ENVIRONMENT tests-clean tests 2>&1 | tee $WORKSPACE/tests.out
+ant $ENVIRONMENT tests 2>&1 | tee $WORKSPACE/tests.out
cat $WORKSPACE/tests.out | egrep FIXME\|FAILED | sort -u
#
Modified: trunk/build/hudson/hudson-home/jobs/Integration-SunRI-AS-5.0/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/Integration-SunRI-AS-5.0/config.xml 2007-05-23 11:23:56 UTC (rev 3209)
+++ trunk/build/hudson/hudson-home/jobs/Integration-SunRI-AS-5.0/config.xml 2007-05-23 11:29:47 UTC (rev 3210)
@@ -18,6 +18,7 @@
#
cd $JBWSDIR/build
cp ant.properties.example ant.properties
+ant clobber
#
# stop jbossas
@@ -28,7 +29,7 @@
# Build sunri-jboss50
#
cd $JBWSDIR/integration/sunri
-ant $ENVIRONMENT clobber deploy-jboss50
+ant $ENVIRONMENT deploy-jboss50
#
# start jbossas
@@ -39,7 +40,7 @@
#
# execute tests
#
-ant $ENVIRONMENT tests-clean tests 2>&1 | tee $WORKSPACE/tests.out
+ant $ENVIRONMENT tests 2>&1 | tee $WORKSPACE/tests.out
cat $WORKSPACE/tests.out | egrep FIXME\|FAILED | sort -u
#
Modified: trunk/build/hudson/hudson-home/jobs/Integration-XFire-AS-5.0/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/Integration-XFire-AS-5.0/config.xml 2007-05-23 11:23:56 UTC (rev 3209)
+++ trunk/build/hudson/hudson-home/jobs/Integration-XFire-AS-5.0/config.xml 2007-05-23 11:29:47 UTC (rev 3210)
@@ -18,7 +18,8 @@
#
cd $JBWSDIR/build
cp ant.properties.example ant.properties
-
+ant clobber
+
#
# stop jbossas
#
@@ -28,7 +29,7 @@
# Build xfire
#
cd $JBWSDIR/integration/xfire
-ant $ENVIRONMENT clobber deploy-jboss50
+ant $ENVIRONMENT deploy-jboss50
#
# start jbossas
@@ -39,7 +40,7 @@
#
# execute tests
#
-ant $ENVIRONMENT tests-clean tests 2>&1 | tee $WORKSPACE/tests.out
+ant $ENVIRONMENT tests 2>&1 | tee $WORKSPACE/tests.out
cat $WORKSPACE/tests.out | egrep FIXME\|FAILED | sort -u
#
17 years, 8 months
JBossWS SVN: r3209 - trunk/build/ant-import.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-23 07:23:56 -0400 (Wed, 23 May 2007)
New Revision: 3209
Modified:
trunk/build/ant-import/build-testsuite.xml
Log:
Fix core jboss50 issues
Modified: trunk/build/ant-import/build-testsuite.xml
===================================================================
--- trunk/build/ant-import/build-testsuite.xml 2007-05-23 11:02:24 UTC (rev 3208)
+++ trunk/build/ant-import/build-testsuite.xml 2007-05-23 11:23:56 UTC (rev 3209)
@@ -108,11 +108,15 @@
<path id="tests.client.classpath">
<pathelement location="${jboss.client}/javassist.jar"/>
<pathelement location="${jboss.client}/jaxb-xjc.jar"/>
+ <pathelement location="${jboss.client}/jboss-jboss50.jar"/>
<pathelement location="${jboss.client}/jbossws-jboss50.jar"/>
<pathelement location="${jboss.client}/jbossall-client.jar"/>
<pathelement location="${jboss.client}/log4j.jar"/>
<pathelement location="${jboss.client}/wsdl4j.jar"/>
+ <pathelement location="${jboss.lib}/jboss-aop-jdk50.jar"/>
<pathelement location="${jboss.lib}/jboss-vfs.jar"/>
+ <pathelement location="${jboss.server.lib}/jboss.jar"/>
+ <pathelement location="${jboss.server.lib}/hibernate3.jar"/>
<pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi.jar"/>
<pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi-saaj.jar"/>
<pathelement location="${jboss.server.deploy}/juddi-service.sar/scout.jar"/>
17 years, 8 months
JBossWS SVN: r3208 - in trunk: integration/jbws/ant-import and 8 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-23 07:02:24 -0400 (Wed, 23 May 2007)
New Revision: 3208
Modified:
trunk/build/ant-import/build-testsuite.xml
trunk/integration/jbws/ant-import/build-deploy.xml
trunk/integration/sunri/ant-import/build-deploy.xml
trunk/integration/xfire/ant-import/build-deploy.xml
trunk/jbossws-core/src/test/resources/jaxrpc/jbws331/META-INF/jboss-client.xml
trunk/jbossws-core/src/test/resources/jaxrpc/jbws626/META-INF/ejb-jar.xml
trunk/jbossws-core/src/test/resources/jaxrpc/jbws626/META-INF/webservices.xml
trunk/jbossws-core/src/test/resources/jaxrpc/jbws626/wstools-config.xml
trunk/jbossws-core/src/test/resources/jaxrpc/jbws772/META-INF-ONE/jboss-client.xml
trunk/jbossws-core/src/test/resources/jaxrpc/samples/jsr109ejb/doclit/META-INF/jboss.xml
trunk/jbossws-core/src/test/resources/jaxrpc/samples/jsr109ejb/rpclit/META-INF/jboss.xml
Log:
Fix core jboss42 issues
Modified: trunk/build/ant-import/build-testsuite.xml
===================================================================
--- trunk/build/ant-import/build-testsuite.xml 2007-05-23 10:50:19 UTC (rev 3207)
+++ trunk/build/ant-import/build-testsuite.xml 2007-05-23 11:02:24 UTC (rev 3208)
@@ -107,9 +107,11 @@
</path>
<path id="tests.client.classpath">
<pathelement location="${jboss.client}/javassist.jar"/>
+ <pathelement location="${jboss.client}/jaxb-xjc.jar"/>
+ <pathelement location="${jboss.client}/jbossws-jboss50.jar"/>
+ <pathelement location="${jboss.client}/jbossall-client.jar"/>
+ <pathelement location="${jboss.client}/log4j.jar"/>
<pathelement location="${jboss.client}/wsdl4j.jar"/>
- <pathelement location="${jboss.client}/log4j.jar"/>
- <pathelement location="${jboss.client}/jbossall-client.jar"/>
<pathelement location="${jboss.lib}/jboss-vfs.jar"/>
<pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi.jar"/>
<pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi-saaj.jar"/>
@@ -139,9 +141,11 @@
<path id="tests.client.classpath">
<pathelement location="${jboss.client}/commons-logging.jar"/>
<pathelement location="${jboss.client}/javassist.jar"/>
+ <pathelement location="${jboss.client}/jaxb-xjc.jar"/>
<pathelement location="${jboss.client}/jboss-annotations-ejb3.jar"/>
<pathelement location="${jboss.client}/wsdl4j.jar"/>
<pathelement location="${jboss.client}/log4j.jar"/>
+ <pathelement location="${jboss.client}/jbossws-jboss42.jar"/>
<pathelement location="${jboss.client}/jbossall-client.jar"/>
<pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi.jar"/>
<pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi-saaj.jar"/>
Modified: trunk/integration/jbws/ant-import/build-deploy.xml
===================================================================
--- trunk/integration/jbws/ant-import/build-deploy.xml 2007-05-23 10:50:19 UTC (rev 3207)
+++ trunk/integration/jbws/ant-import/build-deploy.xml 2007-05-23 11:02:24 UTC (rev 3208)
@@ -34,6 +34,9 @@
<include name="wsdl4j.jar"/>
<include name="jbossws-wsconsume-impl.jar"/>
</fileset>
+ <fileset dir="${int.jboss50.dir}/output/lib">
+ <include name="jbossws-jboss50.jar"/>
+ </fileset>
</copy>
<copy todir="${jboss50.home}/lib" overwrite="true">
<fileset dir="${core.dir}/thirdparty">
@@ -78,11 +81,9 @@
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
<include name="jbossws-client.jar"/>
- <include name="wsdl4j.jar"/>
<include name="jbossws-wsconsume-impl.jar"/>
</fileset>
<fileset dir="${jboss50.home}/server/${jboss.server.instance}/lib">
- <include name="jbossws-jboss50.jar"/>
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
@@ -114,6 +115,9 @@
<include name="wsdl4j.jar"/>
<include name="jbossws-wsconsume-impl.jar"/>
</fileset>
+ <fileset dir="${int.jboss42.dir}/output/lib">
+ <include name="jbossws-jboss42.jar"/>
+ </fileset>
</copy>
<copy todir="${jboss42.home}/lib" overwrite="true">
<fileset dir="${spi.dir}/output/lib">
@@ -148,15 +152,12 @@
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
<include name="jbossws-client.jar"/>
- <include name="wsdl4j.jar"/>
<include name="jbossws-wsconsume-impl.jar"/>
</fileset>
<fileset dir="${jboss42.home}/lib">
<include name="jbossws-integration.jar"/> <!-- The old integration jar-->
- <include name="jbossws-spi.jar"/>
</fileset>
<fileset dir="${jboss42.home}/server/${jboss.server.instance}/lib">
- <include name="jbossws-jboss42.jar"/>
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
Modified: trunk/integration/sunri/ant-import/build-deploy.xml
===================================================================
--- trunk/integration/sunri/ant-import/build-deploy.xml 2007-05-23 10:50:19 UTC (rev 3207)
+++ trunk/integration/sunri/ant-import/build-deploy.xml 2007-05-23 11:02:24 UTC (rev 3208)
@@ -29,6 +29,9 @@
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
</fileset>
+ <fileset dir="${int.jboss50.dir}/output/lib">
+ <include name="jbossws-jboss50.jar"/>
+ </fileset>
</copy>
<copy todir="${jboss50.home}/lib" overwrite="true">
<fileset dir="${thirdparty.dir}">
Modified: trunk/integration/xfire/ant-import/build-deploy.xml
===================================================================
--- trunk/integration/xfire/ant-import/build-deploy.xml 2007-05-23 10:50:19 UTC (rev 3207)
+++ trunk/integration/xfire/ant-import/build-deploy.xml 2007-05-23 11:02:24 UTC (rev 3208)
@@ -29,6 +29,9 @@
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
</fileset>
+ <fileset dir="${int.jboss50.dir}/output/lib">
+ <include name="jbossws-jboss50.jar"/>
+ </fileset>
</copy>
<copy todir="${jboss50.home}/lib" overwrite="true">
<fileset dir="${thirdparty.dir}">
Modified: trunk/jbossws-core/src/test/resources/jaxrpc/jbws331/META-INF/jboss-client.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxrpc/jbws331/META-INF/jboss-client.xml 2007-05-23 10:50:19 UTC (rev 3207)
+++ trunk/jbossws-core/src/test/resources/jaxrpc/jbws331/META-INF/jboss-client.xml 2007-05-23 11:02:24 UTC (rev 3208)
@@ -7,7 +7,7 @@
<service-ref>
<service-ref-name>service/HelloService</service-ref-name>
- <wsdl-override>http://@jbosstest.host.name@:8080/jaxrpc-jbws331/HelloEndpoint?wsdl</wsdl-override>
+ <wsdl-override>http://@jbosstest.host.name@:8080/jaxrpc-jbws331/HelloBean?wsdl</wsdl-override>
</service-ref>
</jboss-client>
Modified: trunk/jbossws-core/src/test/resources/jaxrpc/jbws626/META-INF/ejb-jar.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxrpc/jbws626/META-INF/ejb-jar.xml 2007-05-23 10:50:19 UTC (rev 3207)
+++ trunk/jbossws-core/src/test/resources/jaxrpc/jbws626/META-INF/ejb-jar.xml 2007-05-23 11:02:24 UTC (rev 3208)
@@ -7,7 +7,7 @@
<enterprise-beans>
<session>
- <ejb-name>JBWS626TestBean</ejb-name>
+ <ejb-name>DemoBean</ejb-name>
<service-endpoint>org.jboss.test.ws.jaxrpc.jbws626.DemoEndpoint</service-endpoint>
<ejb-class>org.jboss.test.ws.jaxrpc.jbws626.DemoBean</ejb-class>
<session-type>Stateless</session-type>
Modified: trunk/jbossws-core/src/test/resources/jaxrpc/jbws626/META-INF/webservices.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxrpc/jbws626/META-INF/webservices.xml 2007-05-23 10:50:19 UTC (rev 3207)
+++ trunk/jbossws-core/src/test/resources/jaxrpc/jbws626/META-INF/webservices.xml 2007-05-23 11:02:24 UTC (rev 3208)
@@ -8,7 +8,7 @@
<wsdl-port>impl:DemoEndpointPort</wsdl-port>
<service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws626.DemoEndpoint</service-endpoint-interface>
<service-impl-bean>
- <ejb-link>JBWS626TestBean</ejb-link>
+ <ejb-link>DemoBean</ejb-link>
</service-impl-bean>
<!-- Manual -->
<handler>
Modified: trunk/jbossws-core/src/test/resources/jaxrpc/jbws626/wstools-config.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxrpc/jbws626/wstools-config.xml 2007-05-23 10:50:19 UTC (rev 3207)
+++ trunk/jbossws-core/src/test/resources/jaxrpc/jbws626/wstools-config.xml 2007-05-23 11:02:24 UTC (rev 3208)
@@ -19,7 +19,7 @@
<namespaces target-namespace="http://org.jboss.test.webservice/jbws626"
type-namespace="http://org.jboss.test.webservice/jbws626/types" />
<mapping file="jaxrpc-mapping.xml"/>
- <webservices ejb-link="JBWS626TestBean"/>
+ <webservices ejb-link="DemoBean"/>
</java-wsdl>
</configuration>
Modified: trunk/jbossws-core/src/test/resources/jaxrpc/jbws772/META-INF-ONE/jboss-client.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxrpc/jbws772/META-INF-ONE/jboss-client.xml 2007-05-23 10:50:19 UTC (rev 3207)
+++ trunk/jbossws-core/src/test/resources/jaxrpc/jbws772/META-INF-ONE/jboss-client.xml 2007-05-23 11:02:24 UTC (rev 3208)
@@ -14,7 +14,7 @@
<service-ref>
<service-ref-name>service/TestService</service-ref-name>
- <wsdl-override>http://@jbosstest.host.name@:8080/jaxrpc-jbws772/HelloSLSB?wsdl</wsdl-override>
+ <wsdl-override>http://@jbosstest.host.name@:8080/jaxrpc-jbws772/HelloEJBOne?wsdl</wsdl-override>
</service-ref>
</jboss-client>
Modified: trunk/jbossws-core/src/test/resources/jaxrpc/samples/jsr109ejb/doclit/META-INF/jboss.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxrpc/samples/jsr109ejb/doclit/META-INF/jboss.xml 2007-05-23 10:50:19 UTC (rev 3207)
+++ trunk/jbossws-core/src/test/resources/jaxrpc/samples/jsr109ejb/doclit/META-INF/jboss.xml 2007-05-23 11:02:24 UTC (rev 3208)
@@ -3,12 +3,17 @@
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
<jboss>
+
+ <webservices>
+ <context-root>/jaxrpc-samples-jsr109ejb-doc</context-root>
+ </webservices>
+
<enterprise-beans>
<session>
<ejb-name>TestService</ejb-name>
<port-component>
<port-component-name>TestServicePort</port-component-name>
- <port-component-uri>/jaxrpc-samples-jsr109ejb-doc/*</port-component-uri>
+ <port-component-uri>/*</port-component-uri>
</port-component>
</session>
</enterprise-beans>
Modified: trunk/jbossws-core/src/test/resources/jaxrpc/samples/jsr109ejb/rpclit/META-INF/jboss.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxrpc/samples/jsr109ejb/rpclit/META-INF/jboss.xml 2007-05-23 10:50:19 UTC (rev 3207)
+++ trunk/jbossws-core/src/test/resources/jaxrpc/samples/jsr109ejb/rpclit/META-INF/jboss.xml 2007-05-23 11:02:24 UTC (rev 3208)
@@ -5,6 +5,7 @@
<jboss>
<webservices>
+ <context-root>/jaxrpc-samples-jsr109ejb-rpc</context-root>
<webservice-description>
<webservice-description-name>TestService</webservice-description-name>
<wsdl-publish-location>file:@wsdl-publish-location@/jsr109ejb</wsdl-publish-location>
@@ -16,7 +17,7 @@
<ejb-name>TestService</ejb-name>
<port-component>
<port-component-name>TestServicePort</port-component-name>
- <port-component-uri>/jaxrpc-samples-jsr109ejb-rpc/*</port-component-uri>
+ <port-component-uri>/*</port-component-uri>
</port-component>
</session>
</enterprise-beans>
17 years, 8 months