wadl
  1. wadl
  2. WADL-33

Custom HTTP methods unsupported by Java but code still generated.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: 1.2
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      33

      Description

      Custom HTTP methods unsupported by Java but code still generated.

      Patch:
      — wadl-core/src/main/java/org/jvnet/ws/wadl2java/Wadl2Java.java Sun Jan 18
      23:14:16 1970
      +++ wadl-core/src/main/java/org/jvnet/ws/wadl2java/Wadl2Java.java Sun Jan 18
      23:14:16 1970
      @@ -696,6 +696,23 @@
      }

      /**
      + * Check if the supplied method is supported by java.net.HttpURLConnection.
      + * Custom HTTP methods are not supported by java.net.HttpURLConnection, but
      are supported by RFC2616.
      + * java.net.HttpURLConnection only supports: DELETE GET HEAD OPTIONS POST
      PUT TRACE
      + * @param method the method to validate
      + */
      + protected boolean isSupportedMethod(Method method)
      +

      { + return "DELETE".equals(method.getName()) || + "GET".equals(method.getName()) || + "HEAD".equals(method.getName()) || + "OPTIONS".equals(method.getName()) || + "POST".equals(method.getName()) || + "PUT".equals(method.getName()) || + "TRACE".equals(method.getName()); + }

      +
      + /**

      • Add a method to a resource.
      • Follow references to methods across WADL file boundaries
      • @param method the WADL method element to process
        @@ -710,7 +727,7 @@
        file = getReferencedFile(file, href);
        method = idMap.resolve(file, href, Method.class);
        }
      • if (method != null) {
        + if (method != null && isSupportedMethod(method)) {
        MethodNode n = new MethodNode(method, resource);
        Request request = method.getRequest();
        if (request != null) {

        Activity

        Hide
        gdavison added a comment -

        We now use the Jersey client which does support all the methods. (Using a reflection hack in my understanding.)

        Show
        gdavison added a comment - We now use the Jersey client which does support all the methods. (Using a reflection hack in my understanding.)
        Hide
        gdavison added a comment -

        This is no longer an issue since we moved to use Jersey as the client

        Show
        gdavison added a comment - This is no longer an issue since we moved to use Jersey as the client

          People

          • Assignee:
            gdavison
            Reporter:
            nexj
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: