jersey
  1. jersey
  2. JERSEY-1653

@BeanParam with proxy client does not work

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.0-m11
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:

      Glassfish 4.0 b72

    • Sprint:
      Team Drosera

      Description

      @BeanParam with proxy client does not work

      It does not send through the @HeaderParam's in the request... and the SmsResponse from the proxy method call is null.

      For example...

      @Path( "/" )
      public interface ZengMessagingService
      {
          @GET
          @Path( "/sms" )
          @BeanParam
          SmsResponse sendSms( @BeanParam SmsRequest request );
      
      }
      
      public class SmsRequest
      extends OneTimePasswordRequest
      {
          @HeaderParam( "delivery-mode" )
          private int deliveryMode;
      
          @HeaderParam( "categ" )
          private String subscriptionCategory;
      
      ...
      
      public class SmsResponse
      extends OneTimePasswordResponse
      {
          @HeaderParam( "provisioning-code" )
          private String provisioningCode;
      
      ...
      
      Client client = ClientFactory.newClient();
      WebTarget target = client.target( "http://localhost:" + port + "/" );
      ZengMessagingService zengMessagingService = WebResourceFactory.newResource( ZengMessagingService.class, target );
      SmsResponse smsResponse = zengMessagingService.sendSms( smsRequest );
      

        Activity

        Hide
        aaronjwhiteside added a comment -

        Probably related to JERSEY-1654

        Show
        aaronjwhiteside added a comment - Probably related to JERSEY-1654
        Hide
        aaronjwhiteside added a comment -

        Even if I change the sendSms() method from @GET to @POST in my example, it still does not pass through the @HeaderParam's in SmsRequest.

        Show
        aaronjwhiteside added a comment - Even if I change the sendSms() method from @GET to @POST in my example, it still does not pass through the @HeaderParam's in SmsRequest.
        Hide
        walec51 added a comment - - edited

        @BeanParam support is simply not implemented yet in Jersey Proxy Client
        https://github.com/jersey/jersey/blob/master/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java

        generally Jersey Proxy Client seams pretty week compared to RESTEasy's Client framework and adding @BeanParam will require a big refactoring of that WebResourceFactory

        Show
        walec51 added a comment - - edited @BeanParam support is simply not implemented yet in Jersey Proxy Client https://github.com/jersey/jersey/blob/master/ext/proxy-client/src/main/java/org/glassfish/jersey/client/proxy/WebResourceFactory.java generally Jersey Proxy Client seams pretty week compared to RESTEasy's Client framework and adding @BeanParam will require a big refactoring of that WebResourceFactory
        Hide
        Stepan Vavra added a comment -

        Hi,
        while it seems to be a valid issue, it is not critical to core functionality and we do not plan to dedicate resources to fixing the issue at the moment. In case you feel strongly about the issue, please consider contributing a fix by submitting a Github pull request.

        Thanks!
        Stepan

        Show
        Stepan Vavra added a comment - Hi, while it seems to be a valid issue, it is not critical to core functionality and we do not plan to dedicate resources to fixing the issue at the moment. In case you feel strongly about the issue, please consider contributing a fix by submitting a Github pull request. Thanks! Stepan
        Hide
        lucastsa added a comment -

        I implemented this functionality on pull request https://github.com/jersey/jersey/pull/235
        Not really sure if it will get merged, but you can use it to build your `jersey-proxy-client` artifact.

        Show
        lucastsa added a comment - I implemented this functionality on pull request https://github.com/jersey/jersey/pull/235 Not really sure if it will get merged, but you can use it to build your `jersey-proxy-client` artifact.

          People

          • Assignee:
            Stepan Vavra
            Reporter:
            aaronjwhiteside
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Agile