0 Replies Latest reply: Nov 30, 2009 8:13 AM by Matthias Hueller RSS

    PolicyAttachment with custom assertions

    Matthias Hueller Novice

      Hello,

      I'm trying to implement a custom policy assertion with JBossWS. When I use @PolicyAttachment with my custom policy XML I get the log message "Unknown namespace:http://www.hfu.de/server/service/calculator/CalculatorPolicy...Assertion not supported".

      Is the usage of PolicyAttachment limited to standard policies like WS-SecurityPolicy or is there anything wrong with my custom assertion?

      2009-11-30 14:01:41,857 DEBUG [org.jboss.ws.extensions.policy.deployer.PolicyDeployer] (main) ####class org.apache.ws.policy.XorCompositeAssertion
      2009-11-30 14:01:41,857 DEBUG [org.jboss.ws.extensions.policy.deployer.PolicyDeployer] (main) ####[org.apache.ws.policy.AndCompositeAssertion@aeb11d]
      2009-11-30 14:01:41,858 DEBUG [org.jboss.ws.extensions.policy.deployer.PolicyDeployer] (main) alternative
      2009-11-30 14:01:41,858 DEBUG [org.jboss.ws.extensions.policy.deployer.PolicyDeployer] (main) Unknown namespace:http://www.hfu.de/server/service/calculator/CalculatorPolicy...Assertion not supported
      2009-11-30 14:01:41,858 DEBUG [org.jboss.ws.extensions.policy.deployer.PolicyDeployer] (main) Unsupported Alternative
      2009-11-30 14:01:41,858 DEBUG [org.jboss.ws.extensions.policy.deployer.PolicyDeployer] (main) XorComposite zero element...Policy not supported
      2009-11-30 14:01:41,858 WARN [org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder] (main) Policy Not supported:null


      @Stateless
      @WebService(name = "Calculator", targetNamespace = "http://calculator.service.server.hfu.de/")
      @PolicyAttachment( { @Policy(policyFileLocation = "CalculatorPolicy.xml", scope = PolicyScopeLevel.WSDL_PORT) })
      public class Calculator implements CalculatorRemote, CalculatorLocal {
      
       public double add(double num1, double num2) {
       return num1 + num2;
       }
      
      }


      <?xml version="1.0" encoding="UTF-8"?>
      
      <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
       xmlns:cp="http://www.hfu.de/server/service/calculator/CalculatorPolicy"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <wsp:ExactlyOne>
       <wsp:All>
       <cp:maxNumber>10.0</cp:maxNumber>
       <cp:minNumber>0.0</cp:minNumber>
       </wsp:All>
       </wsp:ExactlyOne>
      </wsp:Policy>


      Any help is appreciated.

      altes-kind