dims 02/05/23 12:57:54
Modified: java/src/org/apache/axis/client Call.java
Log:
- Consolidate the location for adding SOAP Headers for fixing Bugzilla Bug 9327
- Cleanup the imports a bit.
Revision Changes Path
1.123 +15 -15 xml-axis/java/src/org/apache/axis/client/Call.java
Index: Call.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -r1.122 -r1.123
--- Call.java 16 May 2002 12:54:36 -0000 1.122
+++ Call.java 23 May 2002 19:57:54 -0000 1.123
@@ -85,14 +85,22 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.wsdl.*;
+import javax.wsdl.Binding;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.Definition;
+import javax.wsdl.Input;
+import javax.wsdl.Operation;
+import javax.wsdl.Output;
+import javax.wsdl.Part;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
import javax.wsdl.extensions.soap.SOAPAddress;
import javax.wsdl.extensions.soap.SOAPBody;
import javax.wsdl.extensions.soap.SOAPOperation;
import javax.xml.rpc.JAXRPCException;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.namespace.QName;
-import java.beans.IntrospectionException;
import java.io.StringWriter;
import java.net.MalformedURLException;
import java.net.URL;
@@ -1142,9 +1150,6 @@
/******************************************************/
env = new SOAPEnvelope();
- for ( i = 0 ; myHeaders != null && i < myHeaders.size() ; i++ )
- env.addHeader((SOAPHeaderElement)myHeaders.get(i));
-
if ( !(params[0] instanceof SOAPEnvelope) )
for ( i = 0 ; i < params.length ; i++ )
env.addBodyElement( (SOAPBodyElement) params[i] );
@@ -1216,9 +1221,6 @@
Message msg = null ;
int i ;
- for ( i = 0 ; myHeaders != null && i < myHeaders.size() ; i++ )
- env.addHeader((SOAPHeaderElement)myHeaders.get(i));
-
msg = new Message( env );
setRequestMessage( msg );
invoke();
@@ -1669,13 +1671,6 @@
outParams = new HashMap();
outParamsList = new ArrayList();
- // If we have headers to insert, do so now.
- if (myHeaders != null) {
- for (int i = 0; i < myHeaders.size(); i++) {
- reqEnv.addHeader((SOAPHeaderElement)myHeaders.get(i));
- }
- }
-
// Set both the envelope and the RPCElement encoding styles
try {
body.setEncodingStyle(encodingStyle);
@@ -1851,6 +1846,11 @@
// No direct config, so try the namespace of the first body.
reqMsg = msgContext.getRequestMessage();
reqEnv = reqMsg.getSOAPEnvelope();
+
+ // If we have headers to insert, do so now.
+ for (int i = 0 ; myHeaders != null && i < myHeaders.size() ; i++ )
+ reqEnv.addHeader((SOAPHeaderElement)myHeaders.get(i));
+
SOAPBodyElement body = reqEnv.getFirstBody();
// Does this make any sense to anyone? If not, we should remove it.