Running XMLport via code in RTC

Shaggs
Member Posts: 36
I'm using 2009 R2 RTC, and I'm trying to run an xmlport via code. I have some code that runs just fine, so long as I'm running it from the same machine the service tier resides on. When I run it from a different machine, it does not work.
The code I am trying is:
TF is a File
IS is an instream
It is failing at the line TF.OPEN(tmpSourceFile);
Can anyone offer assistance here?
The code I am trying is:
TF.WRITEMODE(FALSE); TF.TEXTMODE(TRUE); TF.OPEN(tmpSourceFile); TF.CREATEINSTREAM(IS); ImportXMLP.SETSOURCE(IS); ImportXMLP.IMPORT;
TF is a File
IS is an instream
It is failing at the line TF.OPEN(tmpSourceFile);
Can anyone offer assistance here?
0
Comments
-
deV.ch; Is the 'SilentUpload' thing needed if the file is located in a shared folder that everybody has access to (including the service tier) (eg. the same path for all users/machines)?0
-
Ok, thanks deV.ch.
I will do some testing...
I guess using 'SilentUpload' would be considered 'best practice'.0 -
My codeunit 419 doesnt have a function SilentUpload. I have checked a few versions of 2009:
2009-R2 (NAVW16.00.01)
2009-SP1 (NAVW16.00.01)
2009 (NAVW16.00)
And none of them have it.
I'm going to try File.UPLOADINTOSTREAM. It prompts the user, but I might just restructure the code around it to compensate.0 -
Heres the function from the CU
SilentUpload(ClientFilePath : Text[1024];VAR ServerFilePath : Text[1024]) Status : Boolean // DACH0001.begin IF ISCLEAR(FileObject) THEN CREATE(FileObject, TRUE, TRUE); Ext := FileObject.GetExtensionName(ClientFilePath); ClientTempFilePath := ClientTempFileName('',Ext); ClientTempFile := FileObject.GetFileName(ClientTempFilePath); FileObject.CopyFile(ClientFilePath,ClientTempFilePath,TRUE); ServerFilePath := ServerTempFileName('',Ext); Status := UPLOAD('',Magicpath,'',ClientTempFile,ServerFilePath); // DACH0002.begin //IF FileObject.FileExists(ClientTempFilePath) THEN // FileObject.DeleteFile(ClientTempFilePath); // DACH0002.end EXIT(Status); // DACH0001.end
and Magitpath:Magicpath() : Text[1024] EXIT('<TEMP>'); // MAGIC PATH makes sure we don't get a prompt
0 -
Just downloaded the DE database. Those are nice functions. =D>0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions