Hi,

If you had also read the SCA Policy spec you would see that it contains an 
algorithm in section 4.10 that describes how intents can be mapped to 
policySets at deployment time.  This alleviates the need to attach the 
conversation policySet to the binding explicitly.  The algorithm will see the 
conversation intent in the interface, look for a policySet that provides the 
intent (notice the provides attribute in the policySet definition) and then 
automatically and logically attach a policySet that will do the job.  I cannot 
comment on how much of this has been implemented by Tuscany, I've just lost 
track of it.  Luciano might be able to comment.

The SCA specs come as a group and you have to be somewhat familiar with them 
all in order to get a complete picture.

The Assembly spec is the one that describes attachment of intents directly into 
WSDL interface definitions.

Dave Booz

  ----- Original Message ----- 
  From: Sun Yang 
  To: [email protected] 
  Sent: Saturday, July 05, 2008 1:29 AM
  Subject: Tuscany policy implementation


  Hi, 

  I am confused with the policy intent regards to sca:conversation between 
specs (SCA assembly and SCA web services binding). I use a few days looking at 
the specs, examples and src code, but I cannot get an answer by myself. Pls 
advise me.

  1. In SCA assembly spec, it suggests to use sca:requires="sca:conversational" 
at the wsdl porttype. (Line 883-Line 925)
  2. In SCA web services binding spec, the example policyset applies to 
binding.ws as below:
  <policySet name="WSRM-Sequence-based-conversation" 
provides="sca:conversation" appliesTo="sca:binding.ws">
   <wsp:Policy>
     <wsrmp:RMAssertion 
xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200608"/>
   </wsp:Policy>
  </policySet>

  Does it mean we need to declare the WS-RM based conversation at two places 
simultaneously?
  1. composite file: (at the ws.bind tag since the example policy only applies 
to binding.ws) 
      for example:
      <binding.ws uri="http://localhost:8085/HelloWorldService"; 
sca:policySets="tuscany:conversation"/>
      when we declare the definitions.xml like the following:
      <sca:definitions xmlns="http://www.osoa.org/xmlns/sca/1.0";
               targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0";
               xmlns:sca="http://www.osoa.org/xmlns/sca/1.0";
               xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0";
               xmlns:wsp="http://www.w3.org/2006/07/ws-policy";>

      <sca:policySet name="WSRM-Sequence-based-conversation"
          provides="sca:conversation"
          appliesTo="sca:binding.ws">
          <wsp:Policy>
              <wsrmp:RMAssertion
                  xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200608"/>
              </wsp:Policy>
      </sca:policySet>
     </sca:definitions>

  2. wsdl file: (at the port type)
          <wsdl:portType name="HelloWorld" sca:requires="sca:conversational">
          <wsdl:operation name="getGreetings">
              <wsdl:input message="tns:getGreetingsRequest" 
name="getGreetingsRequest"/>
              <wsdl:output message="tns:getGreetingsResponse" 
name="getGreetingsResponse"/>
          </wsdl:operation>
          <wsdl:operation name="bye" sca:endsConversation="true">
              <wsdl:input message="tns:byeRequest" name="byeRequest"/>
              <wsdl:output message="tns:byeResponse" name="byeResponse"/>
          </wsdl:operation>
      </wsdl:portType>

  And another question I have is whether we should look at the 
"sca:conversational" literally at the wsdl porttype tag? I cannot find any 
reference to apply the policy to wsdl file in the policy framework spec. How to 
define an applicable tuscany policy which will apply to wsdl file?

  Best Regards,
  Yang Sun

Reply via email to