I just downloaded the WebConnection 6 Shareware version. I want to see if I can create e JSON/REST service. I:
- Installed IIS Express (followed the tutorial).
- Installed Web Connection (followed the tutorial).
- When I start IIS from the WC-menu my browser (IE) opens with the 'Feature Samples' page.
- When I click the button [Hello Web Connection] 'Waiting for localhost' appears and 'Request timed out'.
Also I:
- Created a new project called 'crs' with process class 'CrsRestService' and scriptmap 'csvc' (followed the tutorial).
- Start Web Connection via the project-icon on my desktop.
- 'DO crsmain.prg' and see the server window.
- Tried to go to http://localhost:8080/crsrestservice/default.htm but 'Cannot find webpage' appears.
- Tried to go to http://localhost/crsrestservice/default.htm but 'Cannot find webpage' appears.
I realize I am a beginner in this stuff. Can you help me get started?
Not quite sure, but you have to make sure the FoxPro server is running (ie. DO MyApp.prg) and that you navigate to the IIS Express URL (http://localhost:someport) that points at your generated application. It looks to me you have IIS pointed at the Web Connection Sample page, not at your new application.
To do this click on the Web Connection menu and open the Launch IIS Express dialog and then change the path to the Web folder of the generated project:
c:\webconnectionprojects\MyProject\Web
Then launch IIS Express again and you should now see the Test page that has a hello world link in it.
You can also do this from the FoxPro Command Window:
DO WCONNECT
DO CONSOLE WITH "LAUNCHIISEXPRESS","c:\webconnectionprojects\MyProject\web",8082
gourl("http://localhost:8082/")
Note that each 'application' has to run on a separate port, so either make sure there are no other apps running, or shut down the IIS Express host on the Task Tray by exiting the application.
There's more info on IIS Express configuration, launching and management here:
+++ Rick ---
Thank you for your answer. Unfortunately I still seem to do something wrong. Here's what I do:
- Click on the generated Icon on my desktop for the project 'Crs'.
- This opens VFP in the folder c:\webconnectionprojects\crs\deploy.
- I 'Do crsmain.prg', this opens the server window.
- I select "Start IIS Express Web Server" from the WebConnection menu.
- I immeadeately get an error-message: "Alias name is already in use"
When I try to start IIS Expres from the command-window, the same error appears.
FYI: I am really interested in Web Connection. I have studied a lot of the tutorials, video's etc. and also made a detailed plan for my JSON/REST-restservice. It would be really nice to have the first steps working 😃.
Yeah that's a known problem due to the fact that the Console.exe loads the same libraries from the CONSOLE.exe that your application tries to load when you run your application. The trick is to clear your loaded libs before running your application.
Start IIS Express before you start your server from the menu (or the command).
Then clear the Console.exe loaded libraries with:
CLEAR ALL
CLOSE ALL
RELEASE ALL
DO CrcMain.prg
Now the libraries are loaded from wconnect.app instead and no conflicts.
The problem only occurs really if you run DO CONSOLE
(which includes most menu commands on the Web Connection Menu) before any of the Web Connection libraries are loaded. If you load the Web Connection libraries first console will use those and then there's usually no problem.
Still as a general rule of thumb it's a good idea to do:
CANCEL
CLEAR ALL
CLOSE ALL
RELEASE ALL
CLEAR PROGRAM
CLEAR
before you run any application in Foxpro. I have the above tied to a Macro (F4) so it's easy to run.
I think this is mentioned in the walk-throughs and getting started guides.
+++ Rick ---