CSUN#35991 Naar Axxerion sturen wel (hardcoded) multipart/form-data

svn path=/Website/branches/v2016.1/; revision=29509
This commit is contained in:
Jos Groot Lipman
2016-05-24 13:49:28 +00:00
parent 3b370aece8
commit 77acdd6bfb

View File

@@ -45,15 +45,39 @@ function submitHTTP( p_connect
// secu = XMLhttp.getOption(SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS)
// secu = secu Or SXH_SERVER_CERT_IGNORE_UNKNOWN_CA
// Call XMLhttp.setOption(SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, secu)
XMLhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
if (p_bedrijfadres.username)
{
var base64 = new Base64Cls();
XMLhttp.setRequestHeader("Authorization", "Basic " + base64.encode(p_bedrijfadres.username + ":" + p_bedrijfadres.password));
}
// Patch voor CSU -> KPMG (Axxerion) koppeling
//debugger;
if (endpoint.indexOf("www.axxerion.com") > -1 || endpoint.indexOf("lokalhost") > -1)
{
boundary = "eWmWdiyWZVsqRAlEjgwicQsLnvXBJAVw"; // random genoeg, als het maar niet voorkomt in de data
XMLhttp.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + boundary);
var oStream = new ActiveXObject("ADODB.Stream");
oStream.charset = "utf-8";
oStream.Open();
oStream.Type = 2; // adTypeText
oStream.WriteText( "--" + boundary);
oStream.WriteText('\r\nContent-Disposition: form-data; name="soapfile"; filename="facilitor.xml"');
oStream.WriteText( "\r\nContent-Type: text/xml; charset=utf-8" );
oStream.WriteText( "\r\n\r\n" );
oStream.WriteText( p_textstream.ReadText() );
oStream.WriteText( "\r\n--" + boundary + "--\r\n");
oStream.Position = 0; //
XMLhttp.send(oStream.ReadText()); // Zonder de readtext krijg ik een ongewenste BOM ervoor
// Ik snap niet waarom ik die bij p_textstream niet krijg
}
else // Gewoon
{
XMLhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
XMLhttp.send(p_textstream);
}
XMLhttp.send(p_textstream);
Log2File(1, "XMLhttp.status: " + XMLhttp.status);
if (XMLhttp.status < 200 || XMLhttp.status > 299)
{