When testing the POST call via Postman and a simple .NET console application I receive the result as expected.
When using the process flow using a http connector, it returns an error in the SF-Debugger:
The remote server returned an error: (411) Length Required.
This could indicate the Content-Length header must be applied, so I did:
(Please note this is a fixed length, because the Content is also fixed value for now.)
Unfortunately this results in an error:
The 'Content-Length' header must be modified using the appropriate property or method.
Parameter name: name
at System.Net.WebHeaderCollection.ThrowOnRestrictedHeader(String headerName)
at System.Net.WebHeaderCollection.Add(String name, String value)
at Thinkwise.Shared.ObjectModel.ProcessAction.NoContext.HttpConnector.PerformInternal(ActiveProcessFlow activeFlow, Pending pendingProcessAction, TSFController targetController)
at Thinkwise.Shared.ObjectModel.ProcessAction.Perform(ActiveProcessFlow activeFlow, Pending pendingProcessAction, TSFController sourceController)
at Thinkwise.Shared.ActiveProcessFlow.executeActiveProcessAction(IProcessActionStartParameters startParameters)
Looks like it's not allowed to add the Content-Length explicitly. Anyone any clue about what to do?
The .NET code for comparison that does work:
static void Test()
var bodyToSend = @"TestTest.csv0xbinaryContentstrippedaway";
var data = Encoding.ASCII.GetBytes(bodyToSend);
var url = "https://server/api/xmltozip";
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
request.Method = "POST";
// not necessary
// request.ContentType = "application/xml";
// request.ContentLength = data.Length;
// request.Expect = "application/json";
request.GetRequestStream().Write(data, 0, data.Length);
var response = request.GetResponse() as HttpWebResponse;
var stream = response.GetResponseStream();
var destination = new FileStream(@"C:\Temp\fromapi.zip", FileMode.Create);
Best answer by Vincent Doppenberg
I'm not entirely sure why the http connector gives the 411 Length Required response while the console application does not, even though it doesn't set the ContentLength property. You're right that this is pretty weird.
However, it is definitely an issue that it's entirely impossible to set the Content-Length header on the http connector and I do think that fixing this issue would give you the workaround needed to resolve the problem.