Till few days ago I was never able to use EAI File Transport business service “Send” method in eScript. Every time I used it, I would get a blank document but the same thing worked without a problem in workflow.
“Send” method has two main input arguments
- FileName: which is actually a path where you want to create file
- <Value>: The data that you want to write in file
Here is the eScript code I tried:
var inpArg = TheApplication().NewPropertySet();
var outArg = TheApplication().NewPropertySet();
var svcObj = TheApplication().GetService(“EAI File Transport”);
var testString = “Test string that should be written in file”;
inpArg.SetProperty(“FileName”, “C:\temp.txt”);
inpArg.SetProperty(“<Value>”, testString);
svbObj.InvokeMethod(“Send”,inpArg,outArg);
This above code would create an empty file. I just couldn’t understand that if I provide exactly these two input arguments in a workflow that it worked without any problem.
I was able to find the reason and solution while trying to use XML Converter BS “XMLToPropSet” method which has similar input argument “<Value>” .
When I tried same approach to convert an XML string to property set I got an error that input is empty, which mean that it is not able to get value in <Value> input argument that we are supplying.
So, After searching Metalink I was able to find the below given code to make it work:
var inpArg = TheApplication().NewPropertySet();
var outArg = TheApplication().NewPropertySet();
var svcObj = TheApplication().GetService(“EAI File Transport”);
var testString = “Test string that should be written in file”;
inpArg.SetProperty(“FileName”, “C:\temp.txt”);
inpArg.SetValue(testString);
svbObj.InvokeMethod(“Send”,inpArg,outArg);
The only thing that has changed in the above code is using SetValue instead of SetProperty to pass the value. So, you should use SetValue instead of SetProperty to set the input argument of all the Business Services that expect a <Value> input argument.
I hope this will save somebody from hours of debugging.


(3 votes, average: 4.00 out of 5)