Before you publish a Web service to a target, you might want to test that clients can invoke and communicate with HTTP method VIs and static content as expected. If you notice unexpected behavior or errors, you can correct them and then test the Web service again.
Note For more information about concepts in this topic, refer to the�Web services introduction�and�tutorial. LabVIEW Web services are available only in the LabVIEW Full Development System and the LabVIEW Professional Development System.
Workflow for Debugging a Web Service
Testing and debugging a Web service�is typically an iterative process you complete in the LabVIEW project that contains the Web service files. Complete the following steps to test and debug a Web service on the NI Web Server:
If the Web service is part of a stand-alone application, open and run any startup VIs for the application from the project.
Right-click the Web service project item� in the project tree and select�Start. LabVIEW places the Web service on the NI Web Server, where it behaves as if published to a target.
If you are using the NI Web Server for the first time on your computer, complete the following steps to enable and configure the NI Web Server:
Click Configure NI Web Server in the Start Web Service dialog box to launch NI Web Server Configuration.
For testing and debugging, choose the Simple local access configuration preset and click Next.
On the Authentication page, select Log in using an admin user for server administration and create your own password. Click Next.
Click Finish to apply this configuration.
Switch back to the LabVIEW project and repeat step 2.
Open HTTP method VIs from the project. Use standard LabVIEW debugging techniques, such as probes, breakpoints, and execution highlighting, to observe their behavior when the client invokes them.
Invoke an HTTP method VI from a client, such as a web browser, using the URL mapped to the VI. You can find and copy the appropriate URL directly from the project.
Complete the following steps to access an HTTP Method VI:
In the�Available Servers�pull-down menu, select the item that contains NI Web Server, and then click Copy URL.
Close the dialog box.
Note The Web service does not respond to any requests from the client if the HTTP Method URL dialog box is open.
Paste the URL into a web browser and replace the�{value}�variables with numeric values, such as�http://127.0.0.1:80/TutorialService/Add?b=2&a=3.
Note NI Web Server uses 80/443 as the default port in accordance with HTTP/HTTPS protocol. However, the port number might change if another application occupies the port. You can customize the port number in NI Web Server Configuration. Refer to Configuring NI Web Server in the NI Web Server Manual for more information on server settings like authentication, port, and remote connections.
Browse to the URL.
If you notice an error or finish testing the Web service, right-click the Web service project item in the project tree and select�Stop. If startup VIs for a LabVIEW stand-alone application are running, you do�not�have to stop them.
Note You cannot edit HTTP method VIs until you stop the debugging session because LabVIEW reserves them for execution during debugging.
Edit the VIs to correct any issues you noticed.
(Optional) Repeat steps 2-7 to validate your changes to the Web service files.