Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Testing and Debugging a Web Service (Real-Time, Windows)

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Parent Topic: Overview: Web-based Communication with LabVIEW Applications

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.

Before you deploy 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.

Workflow for Debugging Web Services

Testing and debugging a Web service is typically an iterative process you complete in the LabVIEW project that contains the Web service files. The following steps describe a typical workflow for debugging a Web service in the Project Explorer window:

  1. If the Web service is part of a stand-alone application, open and run any startup VIs for the application from the project. Otherwise, go to step 2.
  2. Right-click the Web service project item in the project tree and select Start. 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. LabVIEW reserves the VIs for execution during a debugging session, so you can 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, right-click the Web service project item in the project tree and select Stop. If VIs for a LabVIEW stand-alone application are running from step 1, you do not have to stop them.
    Note Note  You cannot edit HTTP method VIs until you stop the debugging session because they are reserved 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. This dialog box allows you to view and copy the URL for accessing HTTP method VIs from a client.
  2. In the Available Servers drop-down menu, select the item that contains Local Debugging, and then click the Copy URL button. The Web service is running in the debugging environment, so you access it on a different server and port than if you had published it to a target.
  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

Configuring the Debugging Server Port and Other Options


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit