Web Connection
ConvertAndCompileScript Error
Gravatar is a globally recognized avatar based on your email address. ConvertAndCompileScript Error
  Steve
  All
  Apr 12, 2025 @ 07:22am

Hi Rick,
I am getting back to an old project and trying to get things moving again. I am using WWWC v6.15, the last version that I purchased/upgraded to. I have encountered this problem with my project as well as the TimeTrakker Sample, I'm thinking I have a config/security issue somewhere. Also, I think I moved this project from an old laptop, so that's why I suspect a possible config/security issue.

When I try to call a new Process that I just added via the Console.exe, it works when I call the TestPage() function. However, when I call one of my added functions, WWWC tries to create the .Prg and .Fxp as well as the Script file, in this case RepairOrdersList.rwp. I get an error from the wwScripting.prg and specifically in the ConvertAndCompileScript function: Script file doesn't exist: RepairOrdersList.rwp
So, the .prg, .fxp, and .rwp files are not getting created.

I ran the same test against the TimeTrakker Sample app by temporarily removing the Customers.prg, Customers.fxp. and Customers.ttk from the TimeTrakker\Web\ folder and then clicking on the Customers Link from within the TimeTrakker Web App. Got the same error as above: ConvertAndCompileScript function: Script file doesn't exist: Customers.ttk

NOTE: Other processes that I created previously in my Web App (from the old laptop), such as GetCustomers, which already have the associated .prg, .fxp, and script file in the \Web folder are working. But, it will not recreate these files in the \Web folder if I remove them.

So, it appears the ConvertAndCompileScript function is not able to create the files. Any idea what could cause this?

TIA,
Steve

Gravatar is a globally recognized avatar based on your email address. re: ConvertAndCompileScript Error
  Rick Strahl
  Steve
  Apr 12, 2025 @ 09:09am

No idea. I think you'll have to step through the code to see where it breaks.

The only thing I can think what could be happening is that the file can't be written due to permissions in which case you won't get a compilation or runtime error, but this odd semi-completed state.

But what exactly are you doing to cause code to compile? Is it via the default mapping of an extension? If so what's the code in yourAppServer::Process() method? To me it almost sounds like you're trying to compile pages with the Web Control framework parser when the pages most likely are not using that framework. What exactly are you doing?

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: ConvertAndCompileScript Error
  Steve
  Rick Strahl
  Apr 12, 2025 @ 04:38pm

Well, it's been a while and I'm still trying to regain my footing with this project. I don't think I'm doing anything out of the ordinary. I setup a Process Object and Business Object for the Repairs table. I assigned a specific extension of .rwp for this process. This is the same approach I use for the Customer table, a Process Object, a Business Object, and an extension of .cwp. The WebAppMain.prg calls the specific Process Object based on the .cwp or .rwp extension. The process object then calls the associated Business Object.

Each Process Object is added to the WebAppMain.Process() method:

     CASE lcExtension == "CWP"					&&Customer Web Process  
        DO po_Customer WITH THIS  
     CASE lcExtension == "RWP"					&&Repair Orders Web Process  
        DO po_RepairOrders WITH THIS  

Each Business Object procedure is added to the WebAppMain.OnLoad() method:

*** Add any SET CLASSLIB or SET PROCEDURE code here  
SET PROCEDURE TO bo_Customer ADDITIVE					&&Business Object for: Customer Table  
SET PROCEDURE TO bo_RepairOrders ADDITIVE				&&Business Object for: RO Table  

I am using the webpage templates that come with v6.x. Doesn't WWWC compile the Process Object functions for better performance? Even the TimeTrakker sample app has these files (and others) in the \Web folder: Customers.prg, Customers.fxp, Customers.ttk, EntryBrowser.prg, EntryBrowser.fxp, EntryBrowser.ttk, etc... Doesn't the wwScripting.prg utility create these files?

I hope this is making sense. I will test this again and continue to dig. I think my old laptop where this was originally setup (and worked) is still functional, so I can try it there as well.

Thanks Rick!

Gravatar is a globally recognized avatar based on your email address. re: ConvertAndCompileScript Error
  Rick Strahl
  Steve
  Apr 12, 2025 @ 08:36pm

While you're building the app you shouldn't have to run Convert and Compile scripts. That should be automatic when you run the application if you're not forcing pre-compiled mode. If the PRG and FXP files don't exist they will be created unless you run in pre-compiled mode (which frankly I don't recommend unless you rarely update scripts/templates).

I think the processing modes were the same in 6.0 as they are now in 8.0 - but basically for development, run with Script mode of 1:

Also check your PageParseMode in your YourApp.ini file. You want to make sure that you're not running it for the Web Control Framework (value of 2) for missing process methods (ie. auto-script execution). You'll want 1 (Templates) or 3 (Scripts) for headless pages (pages that don't have a Process method).

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: ConvertAndCompileScript Error
  Steve
  Rick Strahl
  Apr 14, 2025 @ 11:53am

Thanks Rick! I just figured it out. All of the settings are as you mention. I guess I had forgotten that when I add a new process, such as GetRepairOrdersList(), I need a script template file with the appropriate extension to display the info, in this case GetRepairOrdersList.rwp. Once I created the script template file in Visual Studio and placed it in the WebApp\Web folder, it worked. I also get the associated GetRepairOrdersList.prg and GetRepairOrdersList.fxp files, I think when the Response.ExpandScript() function is called via the po_RepairOrders process object.

Thanks again!
Steve

Gravatar is a globally recognized avatar based on your email address. re: ConvertAndCompileScript Error
  Rick Strahl
  Steve
  Apr 14, 2025 @ 11:56am

Well yes - you can either automatically render a page, or go through a process method in which case you're likely to call Response.Expandtemplate() or Response.ExpandScript(). If you don't specify a file name it'll use the name of the current request (ie. SomePage.rsx or whatever). And yeah, that file needs to exist at that point 😄

+++ Rick ---

© 1996-2025