2 Replies Latest reply on Jul 14, 2009 9:35 AM by Neil McFarlane

    Streamlined tutorial on JBossWS w/ policies (WS-RM)?

    Neil McFarlane Novice


      I'm relatively new to Web Services (only done very simple clients) and I've been struggling to get a WS-RM service/client up for a few days now. Part of the problem is that I'm seeing many, many different ways on how this is done, to the point that I'm not sure what the "correct" way is.

      The service part is, thanks to the @Policy annotations, seemingly very simple for me to set up:

      package com.webService;
      import javax.jws.WebService;
      import org.jboss.ws.extensions.policy.PolicyScopeLevel;
      import org.jboss.ws.extensions.policy.annotation.Policy;
      import org.jboss.ws.extensions.policy.annotation.PolicyAttachment;
       policyFileLocation = "WEB-INF/wsrm-exactly-once-in-order-policy.xml",
       scope = PolicyScopeLevel.WSDL_BINDING
      public class Reliable {
       public String echo(String parameter){
       return "You reliably passed the string '"+parameter+"'";

      configuration XML file
      <?xml version="1.0" encoding="UTF-8"?>

      Now, I'm stuck. I gather that I need to somehow configure my client to use RM ("The RM Destination requires the use of WSRM" is the message I'm getting), but I am uncertain how to optimally do this.

      public void testReliable(){
       Reliable port = new ReliableService().getReliablePort();
       //I need some stuff here it seems
       port.echo("a test message");

      Could someone provide me with the simplest guidelines I need to follow that would work? I should mention that one of my goals is keep the XML configuration to an absolute minimum, centralizing as much as possible within the application itself.

      Thanks to anyone who can help me out.