You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Abhishek Goel (JIRA)" <ji...@apache.org> on 2009/03/24 15:05:51 UTC

[jira] Created: (CXF-2132) @Oneway doesn't work with simple/bare element types

@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


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.


[jira] Updated: (CXF-2132) @Oneway doesn't work with simple/bare element types

Posted by "Abhishek Goel (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Resolved: (CXF-2132) @Oneway doesn't work with simple/bare element types

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-2132.
------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.2)
                   2.2.1
                   2.1.5

> @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
>            Assignee: Daniel Kulp
>             Fix For: 2.1.5, 2.2.1
>
>         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.


[jira] Updated: (CXF-2132) @Oneway doesn't work with simple/bare element types

Posted by "Abhishek Goel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: src.zip

Adding the source code that is used to replicate the problem.

> @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: 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.


[jira] Assigned: (CXF-2132) @Oneway doesn't work with simple/bare element types

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp reassigned CXF-2132:
--------------------------------

    Assignee: Daniel Kulp

> @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
>            Assignee: Daniel Kulp
>             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.