[jboss-user] [JBoss Web Services Users] - PolicyAttachment with custom assertions

altes-kind do-not-reply at jboss.com
Mon Nov 30 08:13:46 EST 2009


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 at 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

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4268073#4268073

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4268073



More information about the jboss-user mailing list