3-tier mgt, magic path, and WEB SERVICE tier

Reinhard
Member Posts: 249
Hello,
First of all, yes, I have read all the posts about magic path, <TEMP>, 3 tier automation, etc. I'm comfortable with this.
My problem is that the same code behaves differently from the "Web Service Tier" than the regular service tier.
When I call BLOBExport from the service tier it says "Callback functions are not allowed."
When I run it from RTC, there is no callback functions though. (No prompt to save file, etc.) so everything from web service should be good, right?
Any hints would be appreciated. I'm running it as the same user in both instances. The only difference as far as I can tell is the web vs nav tier.
This is in NAV 2009 build 33729.
- Reinhard
First of all, yes, I have read all the posts about magic path, <TEMP>, 3 tier automation, etc. I'm comfortable with this.
My problem is that the same code behaves differently from the "Web Service Tier" than the regular service tier.
When I call BLOBExport from the service tier it says "Callback functions are not allowed."
When I run it from RTC, there is no callback functions though. (No prompt to save file, etc.) so everything from web service should be good, right?
Any hints would be appreciated. I'm running it as the same user in both instances. The only difference as far as I can tell is the web vs nav tier.
This is in NAV 2009 build 33729.
- Reinhard
fileLoc := tierMgt.BLOBExport(tmpBlob,'',FALSE); /////////////// BLOBExport(VAR BLOBRef : TEMPORARY Record TempBlob;Name : Text[1024];CommonDialog : Boolean) : Text[1024] IF NOT ISSERVICETIER THEN EXIT(BLOBRef.Blob.EXPORT(Name,CommonDialog)) ELSE BEGIN BLOBRef.Blob.CREATEINSTREAM(NVInStream); IF STRPOS(Name,'*') = 0 THEN ToFile := Name ELSE BEGIN ToFile := INSSTR(Name,Text001,1); ToFile := DELCHR(ToFile,'=','*'); END; WHILE STRPOS(ToFile,'\')<>0 DO BEGIN p := STRPOS(ToFile,'\'); ToFile := COPYSTR(ToFile, p+1); END; Path := 'C:\TEMP'; IF NOT CommonDialog THEN Path := Magicpath; DOWNLOADFROMSTREAM(NVInStream,Text006,Path,Text009,ToFile); EXIT(ToFile); END
0
Comments
-
I think that this is "nonsense", because if you are using webservice, you cannot download the file. To be able to download the file, there must be NAV client, which is "called-back" to download the file. If there is webservice, you cannot transfer file in this way. You need to return the content as part of the webservice call. As content of BigData parameter, or encoded as Base64 in some string parameter etc. But you cannot DOWNLOAD it (the client must save it somewhere, but when the client is your own C# code, how it will "take the file and save it"?).0
-
kine: I should have specified that the web service is NOT trying to download the file. the server is just supposed to export the file (and then ftp it but I haven't gotten that far...) I do appreciate that you are trying to point me in the right direction; regardless though that wouldn't explain the error I'm getting, right?
ppavuk: yes, that's correct. the web service presents itself as service tier, since it is.
In 2009 there are four environments: Classic, RTC, NAS, and Web. Using a cominbation of GUIALLOWED and ISSERVICETIER you can identify which one you are on. Web is ISSERVICETIER AND (NOT GUIALLOWED)
To verify, I have given your suggestion a try, but it gives the error "The EXPORT() method is obsolete" which is as expected.
I think I'm going to convert this to run from NAS.
But the code works fine running from RTC, it's even using the same user, so I figured web service should work as well, so that is still bugging me.
- Reinhard0 -
Reinhard, you cannot use DOWNLOADFROMSTREAM under WebService (IsServiceTier = true and GUIALLOWED = false). As I wrote, to be able to DOWNLOAD (it includes the DOWNLOADFROMSTREAM) you must use client. In case of webservices, you need to save the data to file directly on the server (createoutstream on file variable). Than you need to proces the file, but without the download functions, because there is no "where" to download...0
-
hi kine
ah I see. I have taken a closer look at the definition of DOWNLOADFROMSTREAM and it specifies that it is to the client.u need to save the data to file directly on the server (createoutstream on file variable)
viewtopic.php?f=5&t=36646&start=0
It describes how to take a blob, create an outstream, and create a file and create an instream. Then COPYSTREAM will do the trick.
I guess it might be nice to work this function into the 3-tier blob export function under a "if not guiallowed" section inside the ISSERVICETIER
then the function would work in all four of the possible setups, rather than just 3.
thanks for your help! (sorry too much coffee the last couple of days, wasn't thinking straight!)
- Reinhard0
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