From 28dd650c0957cdde5ffdd164dd4bd6fcd8a8d2f0 Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Fri, 17 Oct 2003 19:26:14 +0000 Subject: [PATCH] #220827 r=darin, sr=jst Code from doronr@us.ibm.com - allow empty headers in SOAP to work around Axis bug git-svn-id: svn://10.0.0.236/trunk@148073 18797224-902f-48f8-a5cc-f745e15eee43 --- .../soap/src/nsHTTPSOAPTransport.cpp | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/mozilla/extensions/webservices/soap/src/nsHTTPSOAPTransport.cpp b/mozilla/extensions/webservices/soap/src/nsHTTPSOAPTransport.cpp index 48fc8cbbbc6..a484ed99af2 100644 --- a/mozilla/extensions/webservices/soap/src/nsHTTPSOAPTransport.cpp +++ b/mozilla/extensions/webservices/soap/src/nsHTTPSOAPTransport.cpp @@ -377,7 +377,15 @@ NS_IMETHODIMP nsHTTPSOAPTransport::SyncCall(nsISOAPCall * aCall, nsISOAPResponse rv = aCall->GetActionURI(action); if (NS_FAILED(rv)) return rv; - if (!AStringIsNull(action)) { + + // Apache Axis web services WSDL files say to set soapAction to "" and require it to be sent. + // So only check if its not void instead of using AStringIsNull. + if (!action.IsVoid()) { + + //XXXdoron necko doesn't allow empty header values, so set it to " " + if (action.IsEmpty()) + action = NS_LITERAL_STRING(" "); + rv = request->SetRequestHeader("SOAPAction", NS_ConvertUCS2toUTF8(action).get()); if (NS_FAILED(rv)) @@ -577,7 +585,16 @@ NS_IMETHODIMP rv = aCall->GetActionURI(action); if (NS_FAILED(rv)) return rv; - if (!AStringIsNull(action)) { + + // Apache Axis web services WSDL files say to set soapAction to "" and require it to be sent. + // So only check if its not void instead of using AStringIsNull. + + if (!action.IsVoid()) { + + //XXXdoron necko doesn't allow empty header values, so set it to " " + if (action.IsEmpty()) + action = NS_LITERAL_STRING(" "); + rv = request->SetRequestHeader("SOAPAction", NS_ConvertUCS2toUTF8(action).get()); if (NS_FAILED(rv))