You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2012/03/07 17:48:26 UTC

svn commit: r807769 - in /websites/production/cxf/content: cache/ docs/ docs/how-it-works.data/ docs/ws-policy.data/

Author: buildbot
Date: Wed Mar  7 16:48:25 2012
New Revision: 807769

Log:
Production update by buildbot for cxf

Added:
    websites/production/cxf/content/docs/how-it-works.data/
    websites/production/cxf/content/docs/how-it-works.data/cxf-ws-policies.jpg   (with props)
    websites/production/cxf/content/docs/how-to-define-policies.html
    websites/production/cxf/content/docs/ws-policy.data/
    websites/production/cxf/content/docs/ws-policy.data/WS-policies.jpg   (with props)
Modified:
    websites/production/cxf/content/cache/docs.pageCache
    websites/production/cxf/content/docs/how-it-works.html
    websites/production/cxf/content/docs/ws-policy.html

Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Added: websites/production/cxf/content/docs/how-it-works.data/cxf-ws-policies.jpg
==============================================================================
Binary file - no diff available.

Propchange: websites/production/cxf/content/docs/how-it-works.data/cxf-ws-policies.jpg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Modified: websites/production/cxf/content/docs/how-it-works.html
==============================================================================
--- websites/production/cxf/content/docs/how-it-works.html (original)
+++ websites/production/cxf/content/docs/how-it-works.html Wed Mar  7 16:48:25 2012
@@ -186,10 +186,19 @@ The effective policy for a (input | outp
 </div>
 
 
-<p>The main purpose of these policy interceptors is to add further interceptors that are required to support the effective policy of the underlying message - even if that policy is not yet known at the time the policy interceptor executes (because the operation is not yet known at that time).  <br clear="none">
+<p>The main purpose of these policy interceptors is to add further interceptors that are required to support the effective policy of the underlying message - even if that policy is not yet known at the time the policy interceptor executes (because the operation is not yet known at that time).<br clear="none">
 If the effective message policy is known, the assertions of its selected alternative are inserted into the message in the form of an AssertionInfoMap. This is a map, keyed by assertion type name, of collections of AssertionInfo objects, the latter being stateful (asserted/not asserted) representations of Assertion objects. <br clear="none">
 When the effective message policy is not known, not only the assertions for the selected alternative in the effective endpoint policy are included in the AssertionInfoMap, but also all assertions in all alternatives of all of the operation and message specific policies. Not all of these will be asserted at the end of the chain, but that is fine if it turns out the unasserted assertions apply to operation sayHi when in fact the chain has been processing the message for a greetMe request!</p>
 
+
+<p>You can see how it designed on the following figure:</p>
+
+<p><span class="image-wrap" style=""><img src="how-it-works.data/cxf-ws-policies.jpg" style="border: 0px solid black"></span></p>
+
+<p>Briefly, policy interceptors make following steps:</p>
+<ol><li>Check message property <em>PolicyConstants.POLICY_OVERRIDE</em>.</li><li>If <em>PolicyConstants.POLICY_OVERRIDE</em> contains policy, it will be taken for further processing.</li><li>If property is empty, policy will be asked from ServiceModel. Here CXF loads policies attached to WSDL or provided via Spring configuration.</li><li>If any policy on step 2 or step 3 is found, <em>EffectivePolicy</em> will be created. Appropriate WS-policies will be merged for the current message and built into Neethi <em>Policy</em> object.</li><li>All interceptors registered for result policy assertions will be added to message interceptor chain.</li></ol>
+
+
 <h2><a shape="rect" name="HowItWorks-PolicyAwareInterceptors"></a>Policy Aware Interceptors</h2>
 
 <p>Policy-aware interceptors extract the collection of AssertionInfo objects for the assertion types they understand from the AssertionInfoMap in the message. They can then use the wrapped Assertion objects to fine tune their behaviour, possibly exhibiting message specific behaviour. They can also express whether or not they could support these assertions. <br clear="none">
@@ -220,12 +229,7 @@ On the outbound chain the effective mess
 
 <p>On the inbound paths a little bit more work is necessary: If the message is a fault, we know by now what type of fault it is and what operation it applies to. If the message is not a fault message, knowing the underlying operation we can, from the location of the interceptor (client or server side), infer the message subject (input or output message). Either way, all information is now available to obtain the effective message policy. To check if any of is alternatives is supported, the policy verification interceptors then simply check if for each of its assertions  the associated AssertionInfo object in the map is in the asserted state. If no alternative is supported, the interceptor throws a Fault (wrapping a PolicyException).</p>
 
-<p>One thing worth noting is that - both on outbound and inbound chains - there may be assertions that only the conduit or destination can support. Although conduit or destination could access Assertion objects and tailor their behaviour when sending or receiving the current message, it is not knoan at this point whether this "tailoring" actually succeeded for the underlying message,  i.e. whether the assertions in questions could actually be supported. For this reason, the policy verification interceptors check if the conduit or destination implements the Assertor interface. It it does, they pass it the Message object so they confirn their support (or the lack thereof) for these assertions. The above described traveral of the AssertionInfo map only takes place after the conduit or destination had a chance to m ake their contribution. </p>
-
-
-
-
-</div>
+<p>One thing worth noting is that - both on outbound and inbound chains - there may be assertions that only the conduit or destination can support. Although conduit or destination could access Assertion objects and tailor their behaviour when sending or receiving the current message, it is not knoan at this point whether this "tailoring" actually succeeded for the underlying message,  i.e. whether the assertions in questions could actually be supported. For this reason, the policy verification interceptors check if the conduit or destination implements the Assertor interface. It it does, they pass it the Message object so they confirn their support (or the lack thereof) for these assertions. The above described traveral of the AssertionInfo map only takes place after the conduit or destination had a chance to m ake their contribution. </p></div>
            </div>
            <!-- Content -->
          </td>

Added: websites/production/cxf/content/docs/how-to-define-policies.html
==============================================================================
--- websites/production/cxf/content/docs/how-to-define-policies.html (added)
+++ websites/production/cxf/content/docs/how-to-define-policies.html Wed Mar  7 16:48:25 2012
@@ -0,0 +1,240 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+  <head>
+    <link type="text/css" rel="stylesheet" href="http://cxf.apache.org/resources/site.css">
+    <script src="http://cxf.apache.org/resources/space.js" type="text/javascript"></script>
+    
+<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
+<meta name="keywords" content="business integration, EAI, SOA, Service Oriented Architecture, web services, SOAP, JBI, JMS, WSDL, XML, EDI, Electronic Data Interchange, standards support, integration standards, application integration, middleware, software, solutions, services, CXF, open source">
+<meta name="description" content="Apache CXF, Services Framework - How to Define Policies">
+    <title>
+Apache CXF -- How to Define Policies
+    </title>
+  </head>
+<body onload="init()">
+
+
+<table width="100%" cellpadding="0" cellspacing="0">
+  <tr>
+    <td id="cell-0-0" colspan="2">&nbsp;</td>
+    <td id="cell-0-1">&nbsp;</td>
+    <td id="cell-0-2" colspan="2">&nbsp;</td>
+  </tr>
+  <tr>
+    <td id="cell-1-0">&nbsp;</td>
+    <td id="cell-1-1">&nbsp;</td>
+    <td id="cell-1-2">
+      <div style="padding: 5px;">
+        <div id="banner">
+          <!-- Banner -->
+<div id="banner-content">
+<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left" colspan="1" nowrap>
+<a shape="rect" href="http://cxf.apache.org/" title="Apache CXF"><span style="font-weight: bold; font-size: 170%; color: white">Apache CXF</span></a>
+</td><td align="right" colspan="1" nowrap>
+<a shape="rect" href="http://www.apache.org/" title="The Apache Sofware Foundation"><img border="0" alt="ASF Logo" src="http://cxf.apache.org/images/asf-logo.png"></a>
+</td></tr></table>
+</div>
+          <!-- Banner -->
+        </div>
+      </div>
+      <div id="top-menu">
+        <table border="0" cellpadding="1" cellspacing="0" width="100%">
+          <tr>
+            <td>
+              <div align="left">
+                <!-- Breadcrumbs -->
+<a href="index.html">Index</a>&nbsp;&gt;&nbsp;<a href="ws-support.html">WS-* Support</a>&nbsp;&gt;&nbsp;<a href="ws-policy.html">WS-Policy</a>&nbsp;&gt;&nbsp;<a href="how-to-define-policies.html">How to Define Policies</a>
+                <!-- Breadcrumbs -->
+              </div>
+            </td>
+            <td>
+              <div align="right">
+                <!-- Quicklinks -->
+<div id="quicklinks"><p><a shape="rect" href="http://cxf.apache.org/download.html">Download</a> | <a shape="rect" href="http://cxf.apache.org/docs/index.html">Documentation</a></p></div>
+                <!-- Quicklinks -->
+              </div>
+            </td>
+          </tr>
+        </table>
+      </div>
+    </td>
+    <td id="cell-1-3">&nbsp;</td>
+    <td id="cell-1-4">&nbsp;</td>
+  </tr>
+  <tr>
+    <td id="cell-2-0" colspan="2">&nbsp;</td>
+    <td id="cell-2-1">
+      <table>
+        <tr valign="top">
+          <td height="100%">
+            <div id="wrapper-menu-page-right">
+              <div id="wrapper-menu-page-top">
+                <div id="wrapper-menu-page-bottom">
+                  <div id="menu-page">
+                    <!-- NavigationBar -->
+<div id="navigation"><ul class="alternate" type="square"><li><a shape="rect" href="overview.html" title="Overview">Overview</a></li><li><a shape="rect" href="how-tos.html" title="How-Tos">How-Tos</a></li><li><a shape="rect" href="frontends.html" title="Frontends">Frontends</a></li><li><a shape="rect" href="databindings.html" title="DataBindings">DataBindings</a></li><li><a shape="rect" href="transports.html" title="Transports">Transports</a></li><li><a shape="rect" href="configuration.html" title="Configuration">Configuration</a></li><li><a shape="rect" href="debugging-and-logging.html" title="Debugging and Logging">Debugging and Logging</a></li><li><a shape="rect" href="tools.html" title="Tools">Tools</a></li><li><a shape="rect" href="restful-services.html" title="RESTful Services">RESTful Services</a></li><li><a shape="rect" href="wsdl-bindings.html" title="WSDL Bindings">WSDL Bindings</a></li><li><a shape="rect" href="service-routing.html" title="Service Routing">Service 
 Routing</a></li><li><a shape="rect" href="dynamic-languages.html" title="Dynamic Languages">Dynamic Languages</a></li><li><a shape="rect" href="ws-support.html" title="WS-* Support">WS-* Support</a></li><li><a shape="rect" href="advanced-integration.html" title="Advanced Integration">Advanced Integration</a></li><li><a shape="rect" href="deployment.html" title="Deployment">Deployment</a></li><li><a shape="rect" href="schemas-and-namespaces.html" title="Schemas and Namespaces">Use of Schemas and Namespaces</a></li></ul>
+
+
+<hr>
+<ul class="alternate" type="square"><li>Search
+
+<form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
+  <div>
+    <input type="hidden" name="cx" value="002890367768291051730:o99qiwa09y4">
+    <input type="hidden" name="ie" value="UTF-8">
+    <input type="text" name="q" size="21">
+    <input type="submit" name="sa" value="Search">
+  </div>
+</form>
+<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>
+</li></ul>
+
+
+<hr>
+<ul class="alternate" type="square"><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest/">API (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/">CXF Website</a></li></ul>
+
+</div>
+                    <!-- NavigationBar -->
+                  </div>
+              </div>
+            </div>
+          </div>
+         </td>
+         <td height="100%">
+           <!-- Content -->
+           <div class="wiki-content">
+<div id="ConfluenceContent"><p>There are basically 3 main possibilities to define WS-Policy in CXF projects:</p>
+<ol><li>WSDL Policy attachment</li><li>Spring configuration</li><li>Dynamically via message context property</li></ol>
+
+
+<p>Let look into them in details. </p>
+
+<h4><a shape="rect" name="HowtoDefinePolicies-WSDLPolicyattachment"></a>WSDL Policy attachment</h4>
+<p>WS-Policies can be attached and referenced in WSDL elements. <a shape="rect" class="external-link" href="http://www.w3.org/TR/ws-policy-attach/" rel="nofollow">Web Services Policy 1.5 - Attachment </a> standard describes all possible alternatives. WS-Policies can be placed inside WSDL itself or referenced as external documents. CXF will automatically recognize, read and use policies defined or referenced in WSDL. Sample of attached policy is shown below:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-xml">
+&lt;wsdl:definitions name=<span class="code-quote">"HelloWorld"</span> targetNamespace=<span class="code-quote">"http://apache.org/hello_world_soap_http"</span> 
+&#8230;
+<span class="code-tag">&lt;wsdl:service name=<span class="code-quote">"SOAPService"</span>&gt;</span>
+    <span class="code-tag">&lt;wsdl:port binding=<span class="code-quote">"tns:Greeter_SOAPBinding"</span> name=<span class="code-quote">"SoapPort"</span>&gt;</span>
+        <span class="code-tag">&lt;soap:address location=<span class="code-quote">"http://localhost:9000/SoapContext/SoapPort"</span>/&gt;</span>
+        <span class="code-tag">&lt;wsp:Policy <span class="code-keyword">xmlns:wsp</span>=<span class="code-quote">"http://www.w3.org/ns/ws-policy"</span>&gt;</span>
+             <span class="code-tag">&lt;wsam:Addressing <span class="code-keyword">xmlns:wsam</span>=<span class="code-quote">"http://www.w3.org/2007/02/addressing/metadata"</span>&gt;</span>
+                 <span class="code-tag">&lt;wsp:Policy/&gt;</span>
+              <span class="code-tag">&lt;/wsam:Addressing&gt;</span>
+         <span class="code-tag">&lt;/wsp:Policy&gt;</span>
+    <span class="code-tag">&lt;/wsdl:port&gt;</span>
+<span class="code-tag">&lt;/wsdl:service&gt;</span>
+<span class="code-tag">&lt;/wsdl:definitions&gt;</span>
+</pre>
+</div></div>
+
+<h4><a shape="rect" name="HowtoDefinePolicies-Springconfiguration"></a>Spring configuration</h4>
+<p>It is possible to define policies directly in Spring configuration of client and service as jaxws feature. CFX will recognize and use configured WS-Policies:<br clear="none">
+Client:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-xml">
+&lt;jaxws:client id=<span class="code-quote">"CRMServiceClient"</span> name=<span class="code-quote">"{http://services.talend.org/CRMService}CRMServiceProvider"</span>
+        <span class="code-keyword">xmlns:serviceNamespace</span>=<span class="code-quote">"http://services.talend.org/CRMService"</span>
+        serviceClass=<span class="code-quote">"org.talend.services.crmservice.CRMService"</span>
+        serviceName=<span class="code-quote">"serviceNamespace:CRMServiceProvider"</span>
+        endpointName=<span class="code-quote">"serviceNamespace:CRMServicePort"</span>
+        address=<span class="code-quote">"${endpoint.prefix}/CRMServiceProvider"</span>&gt;
+        <span class="code-tag">&lt;jaxws:features&gt;</span>
+            <span class="code-tag">&lt;p:policies&gt;</span>
+                <span class="code-tag">&lt;wsp:PolicyReference URI=<span class="code-quote">"classpath:/saml.policy"</span>/&gt;</span>
+            <span class="code-tag">&lt;/p:policies&gt;</span>
+        <span class="code-tag">&lt;/jaxws:features&gt;</span>
+<span class="code-tag">&lt;/jaxws:client&gt;</span>
+</pre>
+</div></div>
+
+<p>Service:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-xml">
+&lt;jaxws:endpoint id=<span class="code-quote">"CRMService"</span>
+        <span class="code-keyword">xmlns:serviceNamespace</span>=<span class="code-quote">"http://services.talend.org/CRMService"</span>
+        serviceName=<span class="code-quote">"serviceNamespace:CRMServiceProvider"</span>
+        endpointName=<span class="code-quote">"serviceNamespace:CRMServicePort"</span>
+        implementor=<span class="code-quote">"#CRMServiceBean"</span>
+        address=<span class="code-quote">"/CRMServiceProvider"</span>&gt;
+        <span class="code-tag">&lt;jaxws:features&gt;</span>
+            <span class="code-tag">&lt;p:policies&gt;</span>
+                <span class="code-tag">&lt;wsp:PolicyReference URI=<span class="code-quote">"classpath:/saml.policy"</span>/&gt;</span>
+            <span class="code-tag">&lt;/p:policies&gt;</span>
+        <span class="code-tag">&lt;/jaxws:features&gt;</span>
+<span class="code-tag">&lt;/jaxws:endpoint&gt;</span>
+</pre>
+</div></div>
+
+<h4><a shape="rect" name="HowtoDefinePolicies-Dynamicallyviamessageproperty"></a>Dynamically via message property</h4>
+<p>Sometimes policies cannot be configured statically, because they are obtained or calculated dynamically for concrete message (for example using Policy Server or Service Registry). For such cases CXF provide a possibility to load policy dynamically and set it into the message context property. It can be done for example in custom interceptor that fulfils the following:</p>
+<ol><li>Get policy from external location and build it for current message.</li><li>Parse WS-Policy XML using Neethi library.</li><li>Store result Policy object into <em>PolicyConstants.POLICY_OVERRIDE</em> message content property.<br clear="none">
+Important is that this custom policy interceptor is called before CXF <em>PolicyInInterceptor</em> or <em>PolicyOutInterceptor</em>. Than CXF will automatically recognize Policy stored into this property and use it with highest priority.</li></ol>
+
+</div>
+           </div>
+           <!-- Content -->
+         </td>
+        </tr>
+      </table>
+   </td>
+   <td id="cell-2-2" colspan="2">&nbsp;</td>
+  </tr>
+  <tr>
+   <td id="cell-3-0">&nbsp;</td>
+   <td id="cell-3-1">&nbsp;</td>
+   <td id="cell-3-2">
+     <div id="footer">
+       <!-- Footer -->
+       <div id="site-footer">
+         <a href="http://cxf.apache.org/privacy-policy.html">Privacy Policy</a> - 
+         (<a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=27840374">edit page</a>) 
+	 (<a href="https://cwiki.apache.org/confluence/display/CXF20DOC/How+to+Define+Policies?showComments=true&amp;showCommentArea=true#addcomment">add comment</a>)<br>
+	Apache CXF, CXF, Apache, the Apache feather logo are trademarks of The Apache Software Foundation.<br>
+        All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+       </div>
+       <!-- Footer -->
+     </div>
+   </td>
+   <td id="cell-3-3">&nbsp;</td>
+   <td id="cell-3-4">&nbsp;</td>
+  </tr>
+  <tr>
+    <td id="cell-4-0" colspan="2">&nbsp;</td>
+    <td id="cell-4-1">&nbsp;</td>
+    <td id="cell-4-2" colspan="2">&nbsp;</td>
+  </tr>
+</table>
+
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+try {
+var pageTracker = _gat._getTracker("UA-4458903-1");
+pageTracker._trackPageview();
+} catch(err) {}</script>
+
+</body>
+</html>
+

Added: websites/production/cxf/content/docs/ws-policy.data/WS-policies.jpg
==============================================================================
Binary file - no diff available.

Propchange: websites/production/cxf/content/docs/ws-policy.data/WS-policies.jpg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Modified: websites/production/cxf/content/docs/ws-policy.html
==============================================================================
--- websites/production/cxf/content/docs/ws-policy.html (original)
+++ websites/production/cxf/content/docs/ws-policy.html Wed Mar  7 16:48:25 2012
@@ -123,7 +123,7 @@ Apache CXF -- WS-Policy
            <div class="wiki-content">
 <div id="ConfluenceContent"><h1><a shape="rect" name="WS-Policy-WSPolicy"></a>WS-Policy</h1>
 
-<ul><li><a shape="rect" href="ws-policy-framework-overview.html" title="WS-Policy Framework Overview">WS-Policy Framework Overview</a></li><li><a shape="rect" href="how-it-works.html" title="How It Works">How It Works</a></li><li><a shape="rect" href="developing-assertions.html" title="Developing Assertions">Developing Assertions</a></li></ul>
+<ul><li><a shape="rect" href="how-to-define-policies.html" title="How to Define Policies">How to Define Policies</a></li><li><a shape="rect" href="ws-policy-framework-overview.html" title="WS-Policy Framework Overview">WS-Policy Framework Overview</a></li><li><a shape="rect" href="how-it-works.html" title="How It Works">How It Works</a></li><li><a shape="rect" href="developing-assertions.html" title="Developing Assertions">Developing Assertions</a></li></ul>
 </div>
            </div>
            <!-- Content -->