dims 2003/07/11 08:54:19
Modified: java/src/org/apache/axis/soap SOAPConnectionImpl.java
Log:
Fix for Bug 14636 - SOAPAction MIME header set through SAAJ not being passed on
Revision Changes Path
1.16 +23 -0 xml-axis/java/src/org/apache/axis/soap/SOAPConnectionImpl.java
Index: SOAPConnectionImpl.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/soap/SOAPConnectionImpl.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- SOAPConnectionImpl.java 11 Jul 2003 13:58:21 -0000 1.15
+++ SOAPConnectionImpl.java 11 Jul 2003 15:54:19 -0000 1.16
@@ -61,6 +61,7 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.MimeHeaders;
import java.util.Iterator;
/**
@@ -118,6 +119,11 @@
call.addAttachmentPart(attachment);
}
}
+
+ String soapActionURI = checkForSOAPActionHeader(request);
+ if (soapActionURI != null)
+ call.setSOAPActionURI(soapActionURI);
+
call.setTimeout(timeout);
call.setReturnClass(SOAPMessage.class);
call.invoke(env);
@@ -131,6 +137,23 @@
}
}
+ /**
+ * Checks whether the request has an associated SOAPAction MIME header
+ * and returns its value.
+ * @param request the message to check
+ * @return the value of any associated SOAPAction MIME header or null
+ * if there is no such header.
+ */
+ private String checkForSOAPActionHeader(SOAPMessage request) {
+ MimeHeaders hdrs = request.getMimeHeaders();
+ if (hdrs != null) {
+ String[] saHdrs = hdrs.getHeader("SOAPAction");
+ if (saHdrs != null && saHdrs.length > 0)
+ return saHdrs[0];
+ }
+ return null;
+ }
+
/**
* Closes this <CODE>SOAPConnection</CODE> object.
* @throws SOAPException if there is a SOAP error