XML-RPC
  1. XML-RPC
  2. XMLRPC-149

customizable user agent header for the client

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Gentoo / jdk 1.6

      Description

      Our client sets the user agent to an application string + version information. The user agent field can be easily read out at the web server and is an important information for the support and for statistics (how many old clients are still out there? how many customer have upgraded? is it true that the customer is using the new client or is he really using an old client, lying somewhere hidden in the classpath? etc.)

      Now we want to upgrade the xmlrpc lib to 3.1 and noticed that the user agent field is set by the library. Unfortunately it's not possible to customize this setting to our needs. I've added a patch that is allowing us to set the user agent to a string we are choosing. The code should be 100% compatible and there should be no negative side effects. Please consider to put this into the upstream as soon as possible. Thanks a lot!

      1. xmlrpc-ua2.patch
        3 kB
        Andreas Sahlbach

        Activity

        Hide
        Jochen Wiedmann added a comment -

        Closing issues which have been released.

        Show
        Jochen Wiedmann added a comment - Closing issues which have been released.
        Hide
        Bogdan Sumanariu added a comment -

        Hi, I'm interested in the same patch. We are using the 3.1 library to connect to a server that requires a special User Agent.
        Unfortunately the snapshot build is not available at the specified link. Please, can you republish it?

        Thanks!

        Show
        Bogdan Sumanariu added a comment - Hi, I'm interested in the same patch. We are using the 3.1 library to connect to a server that requires a special User Agent. Unfortunately the snapshot build is not available at the specified link. Please, can you republish it? Thanks!
        Hide
        Jochen Wiedmann added a comment -

        Snapshot available from http://people.apache.org/repo/m2-snapshot-repository/org/apache/xmlrpc
        No plans for another release soon.

        Show
        Jochen Wiedmann added a comment - Snapshot available from http://people.apache.org/repo/m2-snapshot-repository/org/apache/xmlrpc No plans for another release soon.
        Hide
        Kent Narling added a comment - - edited

        Can anyone assist me on where to get this or a latest snapshot?
        As a pre-built I mean...

        Actually, I tried building the latest build, but get errors when trying to compile, probably beccause I only use the 1.5 SDK.... (and the build seems to require 1.3??)

        And as a polite query: Is there an official 3.1.1 release planned soon? there doesn't seem to be much activity...

        Show
        Kent Narling added a comment - - edited Can anyone assist me on where to get this or a latest snapshot? As a pre-built I mean... Actually, I tried building the latest build, but get errors when trying to compile, probably beccause I only use the 1.5 SDK.... (and the build seems to require 1.3??) And as a polite query: Is there an official 3.1.1 release planned soon? there doesn't seem to be much activity...
        Hide
        Jochen Wiedmann added a comment -

        Applied, and snapshot deployed. Thank you!

        Show
        Jochen Wiedmann added a comment - Applied, and snapshot deployed. Thank you!
        Hide
        Andreas Sahlbach added a comment -

        Is this ok this way now?

        Show
        Andreas Sahlbach added a comment - Is this ok this way now?
        Hide
        Andreas Sahlbach added a comment -

        Ok, I see and fully agree. I've attached a new patch in which I modified the configuration instead.

        Show
        Andreas Sahlbach added a comment - Ok, I see and fully agree. I've attached a new patch in which I modified the configuration instead.
        Hide
        Andreas Sahlbach added a comment -

        Modified the XmlRpcHttpClientConfig and Impl to have an customizable user agent string. Modifed the XmlRpcHttpTransport to use it if it is set.

        Show
        Andreas Sahlbach added a comment - Modified the XmlRpcHttpClientConfig and Impl to have an customizable user agent string. Modifed the XmlRpcHttpTransport to use it if it is set.
        Hide
        Jochen Wiedmann added a comment -

        Because we wouldn't want to introduce new constructors for any new configurable value and because the *Config objects are made exactly for the purpose of configuration. And setting the user-agent is a configuration, isn't it?

        Show
        Jochen Wiedmann added a comment - Because we wouldn't want to introduce new constructors for any new configurable value and because the *Config objects are made exactly for the purpose of configuration. And setting the user-agent is a configuration, isn't it?
        Hide
        Andreas Sahlbach added a comment -

        Could you tell me why? No offence, I just want to understand.

        The transport factories already had an argument (XmlRpcClient) and they are instantiated by the user. Therefore I thought it's a good place to put it in.

        Show
        Andreas Sahlbach added a comment - Could you tell me why? No offence, I just want to understand. The transport factories already had an argument (XmlRpcClient) and they are instantiated by the user. Therefore I thought it's a good place to put it in.
        Hide
        Jochen Wiedmann added a comment -

        The transport factories must not have constructor arguments.

        If you want to bring your patch in, use XmlRpcHttpClientConfig, or whatever class comes close.

        Show
        Jochen Wiedmann added a comment - The transport factories must not have constructor arguments. If you want to bring your patch in, use XmlRpcHttpClientConfig, or whatever class comes close.
        Hide
        Andreas Sahlbach added a comment -

        Adds a ctor to the http transport factories to allow the user to set the user agent header to a value he has chosen.

        Show
        Andreas Sahlbach added a comment - Adds a ctor to the http transport factories to allow the user to set the user agent header to a value he has chosen.

          People

          • Assignee:
            Jochen Wiedmann
            Reporter:
            Andreas Sahlbach
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development