When I run bat file on my local host it runs fine. After publishing it on the server it generates empty XML file this is the command I am running
im viewsegment --xmlapi > test.xml --user="user" --password="Pass" --fields=ID,"Text English" 1235545. I am not sure what needs to be done as I have given all the appropriate permissions on the folder.
Any help will be greatly appreciated.
Hello Muhammad Khan,
I would expect some sort of output, even if the ID is not a valid document item (in which case I'd expect an MKS150782 error).
What happens if you run im viewsegement -g --user="user" --password="Pass" --fields=ID,"Text English" 1235545 ?
it runs perfectly and produces the results. I am not sure what I have to do in order to Integrity commands runs under IIS because this seems to be only issue that's happening somehow empty xml get created.
what Version of Integrity are you running? Because since 10.7 the option --xmlapi is removed from all cli commands. This was only intended for debuging and was replaced by the mksAPIViewer.exe application. Maybe you use an older client, than the server version and this is why it is working on your local machine?
Look at Kael Lizak's answer to your question here https://www.ptcusercommunity.com/thread/134198. It might help you get xml output.
Hello Muhammad Khan,
Just be aware that what you're doing won't work when you upgrade. At that point you'll have to use the method Dominik Thierjung referred to, including possibly changing how the XML is parsed (the --xmlapi output doesn't always match out tot he actual XML produced by the API).
Does the user running IIS also have the Integrity client in its %PATH% variable? Even if it doesn't, I'd expect some sort of error to be returned. Is there an error logged somewhere by IIS explaining why the results returned are blank? If you run other CLI commands through IIS, do you get any results?
I change my bat file with the following which was running fine when I run it through command prompt. but when I tried and run the command from my website sometimes it give "unauthorized user" and sometimes nothing at all and generate empty xml file. I even enabled error logs and that's how I figured out.
mksAPIViewer.exe --iplocal --xml> %1test.xml im viewsegment --fields=ID,"Text English" 1235545