Author: maeste
Date: 2007-05-16 16:47:45 -0400 (Wed, 16 May 2007)
New Revision: 3113
Added:
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/WEB-INF/PolicyAttachmentFragment.wsdl
Removed:
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/PolicyAttachmentFragment.wsdl
Modified:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
branches/JBWS-856/jbossws-tests/ant-import/build-samples-jaxws.xml
branches/JBWS-856/jbossws-tests/build.xml
branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java
Log:
wsprovide can use PolicyFragment file relative to current classpath
Modified:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java
===================================================================
---
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java 2007-05-16
19:58:28 UTC (rev 3112)
+++
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java 2007-05-16
20:47:45 UTC (rev 3113)
@@ -95,7 +95,13 @@
try
{
DOMPolicyReader reader = (DOMPolicyReader)
PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
- is = udi.getMetaDataFileURL(policy.policyFileLocation()).openStream();
+ 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());
Modified:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-16
19:58:28 UTC (rev 3112)
+++
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-16
20:47:45 UTC (rev 3113)
@@ -347,17 +347,24 @@
System.out.println("Policy Location:
###"+policyLocation+"###");
if (policyLocation==null || policyLocation.length()==0)
throw new WSException("Missing wsdlFragmentLocation for @Policy on
" + sepClass.getName());
- result.policyLocation = udi.getMetaDataFileURL(policyLocation);
- if (result.policyLocation==null) {
- try
- {
- result.policyLocation = new File(policyLocation).toURL();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
+ if (toolMode)
+ {
+ result.policyLocation =
Thread.currentThread().getContextClassLoader().getResource(policyLocation);
+ }else
+ {
+ result.policyLocation = udi.getMetaDataFileURL(policyLocation);
}
+
+// if (result.policyLocation==null) {
+// try
+// {
+// result.policyLocation = new File(policyLocation).toURL();
+// }
+// catch (Exception e)
+// {
+// e.printStackTrace();
+// }
+// }
System.out.println("Policy Location:
###"+result.policyLocation+"###");
}
Modified: branches/JBWS-856/jbossws-tests/ant-import/build-samples-jaxws.xml
===================================================================
--- branches/JBWS-856/jbossws-tests/ant-import/build-samples-jaxws.xml 2007-05-16 19:58:28
UTC (rev 3112)
+++ branches/JBWS-856/jbossws-tests/ant-import/build-samples-jaxws.xml 2007-05-16 20:47:45
UTC (rev 3113)
@@ -467,8 +467,12 @@
<webinf
dir="${tests.output.dir}/resources/jaxws/samples/wssecuritypolicy">
<include name="wsse.keystore"/>
<include name="wsse.truststore"/>
- <include name="PolicyAttachmentFragment.wsdl"/>
+
</webinf>
+ <webinf
dir="${tests.output.dir}/resources/jaxws/samples/wssecuritypolicy/WEB-INF">
+
+ <include name="PolicyAttachmentFragment.wsdl"/>
+ </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">
Modified: branches/JBWS-856/jbossws-tests/build.xml
===================================================================
--- branches/JBWS-856/jbossws-tests/build.xml 2007-05-16 19:58:28 UTC (rev 3112)
+++ branches/JBWS-856/jbossws-tests/build.xml 2007-05-16 20:47:45 UTC (rev 3113)
@@ -354,6 +354,7 @@
<classpath location="${thirdparty.dir}/concurrent.jar"/>
<classpath location="${thirdparty.dir}/commons-logging.jar"/>
<classpath location="${tests.output.dir}/classes"/>
+ <classpath
location="${tests.output.dir}/resources/jaxws/samples/wssecuritypolicy"/>
</taskdef>
<wsprovide
resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurity"
genwsdl="true"
sei="org.jboss.test.ws.jaxws.samples.wssecurity.HelloJavaBean"/>
Modified:
branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java
===================================================================
---
branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java 2007-05-16
19:58:28 UTC (rev 3112)
+++
branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java 2007-05-16
20:47:45 UTC (rev 3113)
@@ -32,7 +32,7 @@
@WebService(name = "Hello", targetNamespace =
"http://org.jboss.ws/samples/wssecuritypolicy")
//@PolicyWsdlFragment(wsdlFragmentLocation="WEB-INF/PolicyAttachmentFragment.wsdl")
-@PolicyWsdlFragment(wsdlFragmentLocation="/dati/jbws_JBWS-856/jbossws-tests/output/resources/jaxws/samples/wssecuritypolicy/WEB-INF/PolicyAttachmentFragment.wsdl")
+@PolicyWsdlFragment(wsdlFragmentLocation="WEB-INF/PolicyAttachmentFragment.wsdl")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class HelloJavaBean
{
Deleted:
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/PolicyAttachmentFragment.wsdl
===================================================================
---
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/PolicyAttachmentFragment.wsdl 2007-05-16
19:58:28 UTC (rev 3112)
+++
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/PolicyAttachmentFragment.wsdl 2007-05-16
20:47:45 UTC (rev 3113)
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<definitions name="TestService"
targetNamespace="http://org.jboss.ws/samples/wssecuritypolicy"
- xmlns:tns="http://org.jboss.ws/samples/wssecuritypolicy"
-
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:sp="http://www.jboss.com/ws-security/schema/jboss-ws-security_...
-
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
-
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
- <wsp:Policy wsu:Id="X509EndpointPolicy">
- <wsp:ExactlyOne>
- <wsp:All>
- <sp:jboss-ws-security
xmlns:sp="http://www.jboss.com/ws-security/schema/jboss-ws-security_...
- <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>
- <binding name='HelloBinding' type='tns:Hello'>
- <soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
- <wsp:PolicyReference URI="#X509EndpointPolicy"
wsdl:required="true" />
- </binding>
- <service name='HelloService'>
- <port binding='tns:HelloBinding' name='HelloPort'>
- <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
- </port>
- </service>
-</definitions>
Copied:
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/WEB-INF/PolicyAttachmentFragment.wsdl
(from rev 3112,
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/PolicyAttachmentFragment.wsdl)
===================================================================
---
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/WEB-INF/PolicyAttachmentFragment.wsdl
(rev 0)
+++
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/WEB-INF/PolicyAttachmentFragment.wsdl 2007-05-16
20:47:45 UTC (rev 3113)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<definitions name="TestService"
targetNamespace="http://org.jboss.ws/samples/wssecuritypolicy"
+ xmlns:tns="http://org.jboss.ws/samples/wssecuritypolicy"
+
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:sp="http://www.jboss.com/ws-security/schema/jboss-ws-security_...
+
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <wsp:Policy wsu:Id="X509EndpointPolicy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:jboss-ws-security
xmlns:sp="http://www.jboss.com/ws-security/schema/jboss-ws-security_...
+ <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>
+ <binding name='HelloBinding' type='tns:Hello'>
+ <soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <wsp:PolicyReference URI="#X509EndpointPolicy"
wsdl:required="true" />
+ </binding>
+ <service name='HelloService'>
+ <port binding='tns:HelloBinding' name='HelloPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>