Uploaded image for project: 'Axis'
  1. Axis
  2. AXIS-2881

Reduce coupling between org.apache.axis.client.Stub and generated code

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • 1.5
    • Basic Architecture
    • None

    Description

      org.apache.axis.client.Stub has several protected attributes that are set using methods declared by Stub and that are used in the generated code to configure the Call. The generated code looks as follows (see the createCall method):

      org.apache.axis.client.Call _call = super._createCall();
      if (super.maintainSessionSet)

      { _call.setMaintainSession(super.maintainSession); }

      if (super.cachedUsername != null)

      { _call.setUsername(super.cachedUsername); }

      if (super.cachedPassword != null)

      { _call.setPassword(super.cachedPassword); }

      if (super.cachedEndpoint != null)

      { _call.setTargetEndpointAddress(super.cachedEndpoint); }

      if (super.cachedTimeout != null)

      { _call.setTimeout(super.cachedTimeout); }

      if (super.cachedPortName != null)

      { _call.setPortName(super.cachedPortName); }

      java.util.Enumeration keys = super.cachedProperties.keys();
      while (keys.hasMoreElements())

      { java.lang.String key = (java.lang.String) keys.nextElement(); _call.setProperty(key, super.cachedProperties.get(key)); }

      This code could actually be included in Stub#_createCall (as noted in a TODO item in that method), and the attributes in the Stub class could be made private. This would reduce the coupling between the Stub class and the generated code. E.g. the usage of java.net.URL as the type of the cachedEndpoint attribute causes issues for non-HTTP URLs because of the requirement to configure a custom URLStreamHandler. This could be easily fixed by replacing java.net.URL with java.net.URI (or String). However, because of the strong coupling with the generated code, this is not possible without breaking compatibility with code generated by previous Axis versions. Therefore this can only be changed in the next major release.

      Attachments

        Activity

          People

            Unassigned Unassigned
            veithen Andreas Veithen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: