| Hyderabad Jobs | Book Website | ![]() |
I Love Hyderabad | Hyderabad Colleges |
| Home | Business Emails | Hyderabad Classifieds | Contact Us | |
| 7 Wonders of Hyderabad | Web Hosting | Yellow Pages | Our Network | |
Mastering PowerBuilder
Testing Distributed ApplicationsOnce you complete both the client and server applications, create the executable file at least for the server application. Before you run the server application, you need to make an entry for your application in the 'services' file located under your MS-Windows installation directory. For our application make the following entry.
In case 11000 is already existing in the 'services' file on your system, use another number that is not in use. Make sure you hit ENTER button at the end of the above entry in the services file. Please note that, those two entries are separated by a TAB. Now, run the server application first and start the server and run the client application either from the development environment using RUN icon or create executable and run it. If you have just only one machine and want to test both the client and server applications on the same machine, then you have couple of options. The first one is being to use 'Local' driver in the Connection object. When you do this, Listen() and few other functions will fail and you need to comment them before testing starts. When you use 'Local' driver, PowerBuilder takes care of everything such as listening to the client requests and connecting to the server internally. I believe this may not be a perfect test at all. The next one is to use 'LocalHost' driver when you test under Windows 95/NT. These two operating systems do maintain a loop-back TCP/IP connection where the local machine acts as the host also. This option is really good for testing distributed PB applications and also when you use personal web servers to create and/or test web applications. To check whether loop-back service is setup or not, open 'hosts' file located under your MS-Windows installation directory and check whether it has the following entry:
If you decide to test using the LocalHost option, replace Winsock with LocalHost in all the code explained so far in this session or in the registry entries for the DPB. Once testing is done, then reverse that and deploy the application. While testing the server application please note that any MessageBox() dialog boxes that you fire in the server code will display on the server machine. Well, here you can see them since both the applications are running on the same machine, however, it will not be possible when you deploy the app. In that case, you may want to write a generic function to write a message to a log file and call that function instead of MessageBox() and check the log file later. The following listing is from the log file logged when the server started with All=1 trace option. You can see all the server options it is using when it started including the driver, server and service names.
The following listing is the server log created when the client application connected to the server. Recall that we have written code to connect to the server from the Application Open event. You can observe that the userid is logged but not the password.
The following listing is the server log created when we created ncst_product_master instance on the server.
The following listing is the server log created when we called of_Retrieve() on the remote object.
The first part in the above message has details about the called function and its arguments. You can observe the BLOB object sent to of_Retrieve() has zero bytes. The second part has details about the reply where the BLOB object has about 38K size. The last line has the result of the method invocation. The following listing is from the server log that was logged in response to the of_Update(). You can see from the listing that the object instance (id 316) is still the same since we haven't destoryed it.
This section concludes building Distributed PowerBuilder applications using DPB technology. The next section takes you to the next level of n-tier computing using Jaguar Application server, CORBA and SSL protocols.
|
| Copyright © 1996 - 2006 HamaraShehar.com Pvt. Ltd. All Rights Reserved.
Domain Registration, Website Design, Website Hosting by HamaraShehar.com |