Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2132

@Oneway doesn't work with simple/bare element types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2
    • 2.1.5, 2.2.1
    • Soap Binding
    • None
    • Win XP, CXF 2.2, Java 5

    • Moderate

    Description

      If the service interface is specified to have a parameter style of bare/simple by using the @SOAPBinding annotation, a method that has been annotated with @Oneway does not behave as expected. The method still acts as a two way method in that the client is not free'd up immediately. The client waits for method to finish processing.

      Interface:
      @WebService
      @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
      public interface HelloWorld
      {
      @WebMethod
      @Oneway
      void sayHiOneWay(String text);
      }

      Impl:
      @WebService(endpointInterface = "demo.hw.server.HelloWorld", serviceName = "HelloWorld")
      public class HelloWorldImpl implements HelloWorld
      {
      @Oneway
      public void sayHiOneWay(String text)
      {
      System.out.println("sayHiOneWay called");
      System.out.println("sleeping for 10 secs");
      try

      { Thread.sleep(10000); }


      catch (InterruptedException e)

      { e.printStackTrace(); }

      System.out.println("woke up after 10 secs");
      System.out.println("accepted: " + text);
      }
      }

      Client:
      public final class Client
      {
      private static final QName SERVICE_NAME = new QName("http://server.hw.demo/", "HelloWorld");
      private static final QName PORT_NAME = new QName("http://server.hw.demo/", "HelloWorldPort");

      private Client()
      {
      }

      public static void main(String args[]) throws Exception

      { Service service = Service.create(SERVICE_NAME); // Endpoint Address String endpointAddress = "http://localhost:9090/Hello"; // Add a port to the Service service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING, endpointAddress); HelloWorld hw = service.getPort(HelloWorld.class); System.out.println("Invoke sayHiOneWay()...."); long startTime = System.currentTimeMillis(); hw.sayHiOneWay(System.getProperty("user.name")); System.out.println("Time taken to call sayHiOneWay(): " + (System.currentTimeMillis()-startTime) + " ms"); }

      }

      Attachments

        1. screenshot-1.jpg
          17 kB
          Abhishek Goel
        2. src.zip
          4 kB
          Abhishek Goel

        Activity

          People

            dkulp Daniel Kulp
            goelshek Abhishek Goel
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: