Testing and Debugging a Web Service on the Application Web Server (Real-Time, Windows)

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 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 Application Web Server:

Note Note  In this topic, you test and debug a Web service on the Application Web Server. You can also test your Web service on the NI Web Server, refer to Testing and Debugging a Web Service on the NI Web Server.
  1. If the Web service is part of a stand-alone application, open and run any startup VIs for the application from the project.
  2. (Windows) Right-click the Web service project item under My Computer�in the project tree and select�Application Web Server»Start (Debug Server).

    (Real-Time) Right-click the Web service project item the RT target�in the project tree and select Start (Debug Server).

    LabVIEW places the Web service on a debugging server, where it behaves as if published on a target.
  3. 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.
  4. 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.
  5. If you notice an error or finish testing the Web service, (Windows) right-click the Web service project item in the project tree and select�Application Web Server»Stop (Debug Server). (Real-Time) Right-click the Web service project item�and select Stop (Debug Server). If startup VIs for a LabVIEW stand-alone application are running, you do not have to stop them.
    Note Note  You cannot edit HTTP method VIs until you stop the debugging session because LabVIEW reserves HTTP method VIs for execution during debugging.
  6. Edit the VIs to correct any issues you noticed.
  7. (Optional) Repeat steps 2-6 to validate your changes to the Web service files.

Accessing HTTP Method VIs in Debugging Mode

Complete the following steps to determine the URL of an HTTP method VI during a debugging session:

  1. Right-click an HTTP method VI and select Show Method URL to display the HTTP Method URL dialog box.
  2. In the Available Servers pull-down menu, select the item that contains Local Debugging, and then click Copy URL. The Web service runs in the debugging environment, so you access it on a different server and port than if you had published it to a target.
    Note Note  The Web service does not respond to any requests from the client if the HTTP Method URL dialog box is open.
  3. Paste the URL into a standard web browser and replace the {value} variables with numeric values, such as: http://127.0.0.1:8001/TutorialService/Add?b=2&a=3.

Related Information

Developing Web Services

Debugging Server