pub.file:getfile is not working

I placed file in my local box, i used built in service pub.file:getfile, at filename in service in i have given complete path (location of file). when i tried to run this service am getting following error mesage

com.wm.app.b2b.server.ServiceException: [ISS.0086.9020] C:\work\product.xml does not exist

Is the Integration Server running on your local machine as well?
The service can only access files which are accessable from the machine hosting IS process.

r uworking in remote desktop or ur local one? when you used remote desktop on that time you dont have rights to access your local desktop. i guess your facing same problem. try to create file in integration server.you can access that file using get file in xml folder.

regards
sagar

Even we have faced the problem once. I think the problem is the system is not identifying the “.xml” file check it with “.txt” first. if you face the same problem with “.txt” then we can go for another solution.

confirm urself whether u r using remote or local system? when you use remote system while writing service you should not access ur local file system. This may be ur problem.

Hello Everyone,

May I ask what should be the extension on getting PDF files? I am using getFile service as well. I have access on the folder where my files are located. I can get .txt files, however for .pdf, it is getting an error “does not exist”. I also tried to get it without extension but no luck. Anyone experienced this issue? (FYI, pdf I am using is nuance pdf) Thank you!

Kind regards,
Mor

Hi Mor,

did you check your fileAccessControl.cnf in the WmPublic package if pdfs are allowed here or only txt files?
Or is just the complete folder specified here?

Additionally check in the filesystem if the folder and the files have correct permissions to be able to be retrieved by IS.

Regards,
Holger

Hello Holger,

Thank you for your inputs. I was able to resolve the issue by giving the correct access rights and setting up the correct file path (network drive). However, I have another question. I am still new to wM and exploring solutions. I need to get the content of this PDF. I am getting PDF by getFile (loading as stream) → StreamToBytes → bytesToString → xml:documentToXMLString. Wasn’t able to get the correct format…

I can see some solution advised by experts to download PDF libraries. To be honest, I am not really good at java coding. Is there a way to handle this by using service flows only? I am using version SAG 9.12.

Thank you in advance for your help.

Kind regards,
Mor

Hi Mor,

in pub.xml folder there are 3 services which can be invoked in a circle to convert data between document, node and string.

Dependent on present and planned source and target format you might have to invoke one or two of them.
When converting String to Document you need to use stringToNode and nodeToDocument as there is no direct stringToDocument service.
DocumentToString is the third service in this circle.

Most likely you will have to download an API like Apache PDFBox to retrieve the contents from the PDF and make it available to the flow service.

Regards,
Holger