I’m using pub.file:stringToFile to write file to my /opt/files/ directory. Is It possible to change this file name using built-in webMethods services? I want to create file with “.tmp” extension and remove this extension if file:stringToFile is done. There is an external service (not WM) configured on /opt/files/ which retrieves created files. I want to be sure that external service gets whole file data (pub.file:stringToFile is done). Or maybe pub.file:stringToFile provides me with this?
You need to create a file with extension .tmp (say sample.tmp) under /opt/files/. So fileName= /opt/files/sample.tmp
should be passed as the input pub.file:stringToFile with data that you want to create.
Also make sure that this fileName path should be in list of allowedWritePaths values specified in the FileAccessControl configuration file. After updating the path reload the WmPublic package. IS restart is not required.
If you want to rename the file try writing a java service.
It’s sort of difficult to understand your question. Do you want to rename the file once after the file is created and prepared with its content if it so then you have to write some customized service to achieve that functionality as we don’t have any built-in service. Please try the options given by various members and update us which worked in your case.