[jboss-user] [JBossWS] - Re: WS-RM Exception: cannot be cast to org.jboss.ws.core.Stu

karypid do-not-reply at jboss.com
Mon Aug 11 04:50:56 EDT 2008


Ok, I've got WS-ReliableMessaging to work. The problem was that the WS-Policy information had to be removed from the WSDL and put into a separate file, using the @PolicyAttachment annotation to refer to it.

The tutorial at http://jbws.dyndns.org/mediawiki/index.php?title=Native_WS-ReliableMessaging_Tutorial imports the WS-Policy namespace in the WSDL file and embeds the policy there. But JBoss generates and publishes its own WSDL for the web service, using the information from the annotations.

The solution can be found at: http://jbws.dyndns.org/mediawiki/index.php?title=WS_Reliable_Messaging

You need to create a separate XML file (e.g. wsrm-exactly-once-in-order-policy.xml) containing the policy: <?xml version="1.0" encoding="UTF-8"?>
  | <wsp:Policy
  |    wsu:Id="exactly_one_in_order_rm_delivery"
  |    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
  |    xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200702"
  |    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  |    <wsrmp:DeliveryAssurance>
  |       <wsp:Policy>
  |          <wsrmp:ExactlyOnce/>
  |          <wsrmp:InOrder/>
  |       </wsp:Policy>
  |    </wsrmp:DeliveryAssurance>
  | </wsp:Policy>
  | 
Then, in the web service implementation, use annotations to link that policy to the web service:
@WebService
  | @EndpointConfig(
  |         configFile = "META-INF/wsrm-jaxws-endpoint-config.xml",
  |         configName = "Standard WSRM Endpoint"
  | )
  | @PolicyAttachment(@Policy(
  |         policyFileLocation = "META-INF/wsrm-exactly-once-in-order-policy.xml",
  |         scope = PolicyScopeLevel.WSDL_BINDING)
  | )
  | public class MyRMService { ...

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

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



More information about the jboss-user mailing list