axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Schuerig (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Created: (AXIS-1709) Client#setOperation(String) needs to take header params into account (Patch)
Date Thu, 09 Dec 2004 02:41:09 GMT
Client#setOperation(String) needs to take header params into account (Patch)
----------------------------------------------------------------------------

         Key: AXIS-1709
         URL: http://nagoya.apache.org/jira/browse/AXIS-1709
     Project: Axis
        Type: Bug
    Versions: current (nightly)    
    Reporter: Michael Schuerig


Currently Call#setOperation(String) erroneously adds every parameter as a body parameter.
Here's patch that checks whether is an IN or OUT header and adds it as a header parameter.

Michael


Index: Call.java
===================================================================
RCS file: /home/cvspublic/ws-axis/java/src/org/apache/axis/client/Call.java,v
retrieving revision 1.235
diff -u -3 -p -u -r1.235 Call.java
--- Call.java 30 Nov 2004 21:54:32 -0000 1.235
+++ Call.java 9 Dec 2004 02:27:56 -0000
@@ -1013,9 +1013,33 @@ public class Call implements javax.xml.r
         addParameter(new QName("", paramName), xmlType,
                      javaType, parameterMode);
     }
-
+        
+    /**
+     * Adds a parameter type as a soap:header.
+     * @param paramName - Name of the parameter
+     * @param xmlType - XML datatype of the parameter
+     * @param parameterMode - Mode of the parameter-whether IN, OUT or INOUT
+     * @param headerMode - Mode of the header.  Even if this is an INOUT
+     *                     parameter, it need not be in the header in both
+     *                     directions.
+     * @exception JAXRPCException - if isParameterAndReturnSpecRequired returns
+     *                              false, then addParameter MAY throw
+     *                              JAXRPCException....actually Axis allows
+     *                              modification in such cases
+     */
+    public void addParameterAsHeader(QName paramName, QName xmlType,
+            ParameterMode parameterMode,
+            ParameterMode headerMode) {
+        Class javaType = null;
+        TypeMapping tm = getTypeMapping();
+        if (tm != null) {
+            javaType = tm.getClassForQName(xmlType);
+        }
+        addParameterAsHeader(paramName, xmlType, javaType,
+            parameterMode, headerMode);
+    }
+    
     /**
-
      * Adds a parameter type as a soap:header.
      * @param paramName - Name of the parameter
      * @param xmlType - XML datatype of the parameter
@@ -1409,7 +1433,13 @@ public class Call implements javax.xml.r
             Parameter p = (Parameter) parameters.list.get(j);
             // Get the QName representing the parameter type
             QName paramType = Utils.getXSIType(p);
-            this.addParameter( p.getQName(), paramType, modes[p.getMode()]);
+            ParameterMode mode = modes[p.getMode()];
+            if (p.isInHeader() || p.isOutHeader()) {
+                this.addParameterAsHeader( p.getQName(), paramType,
+                        mode, mode);
+            } else {
+                this.addParameter( p.getQName(), paramType, mode);
+            }
         }
 
         Map faultMap = bEntry.getFaults();


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message