cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abhishek Goel (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CXF-2132) @Oneway doesn't work with simple/bare element types
Date Tue, 24 Mar 2009 14:13:50 GMT

     [ https://issues.apache.org/jira/browse/CXF-2132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Abhishek Goel updated CXF-2132:
-------------------------------

    Attachment: screenshot-1.jpg

This screenshot shows that the client takes more than 10 seconds to invoke a oneway method.
There is a 10 second sleep inside the method.

> @Oneway doesn't work with simple/bare element types
> ---------------------------------------------------
>
>                 Key: CXF-2132
>                 URL: https://issues.apache.org/jira/browse/CXF-2132
>             Project: CXF
>          Issue Type: Bug
>          Components: Soap Binding
>    Affects Versions: 2.2
>         Environment: Win XP, CXF 2.2, Java 5
>            Reporter: Abhishek Goel
>             Fix For: 2.2
>
>         Attachments: screenshot-1.jpg, src.zip
>
>
> 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");
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message