Skip to main content
Omnitracs Knowledge Base

Generate the Project and Add the Web Reference

Generating the Project

Start Microsoft Visual Studio .NET and generate a new C# Windows Application and a new solution. This will make a single blank Windows form.

1.jpg

Enable the Project for Web Services Enhancements

Enable the project for web service enhancements through the Solution Explorer. Right click on the project and select WSE Settings 2.0.

2.jpg

Check the box to enable the project for web services enhancements.

3.jpg

Adding or Updating the Web Reference

Go to the Solution Explorer. Expand the application, then right click References, and select Add Web Reference.

4.jpg

The IDE will allow you to browse for web services. This demonstration uses the Vehicle Management service on that is hosted Qualcomm's production server. The WSDL is at:
https://www.myqualcomm.com/qtracsWebWS/services/QTWebSvcs/wsdl/QTWebSvcs.wsdl

5.jpg

Enter this as the URL and click Go.
.NET will inspect the WSDL and show you a window containing a list of the methods that are exposed by the endpoint. Name the web reference (the demo uses qtref) as desired and click Add Reference.

6.jpg

You should now see the web reference in the Solution Explorer and you should see the classes for the qtref namespace in the Class View.

7.jpg

(info) Java projects sometimes need references to other Java projects. These are JAR dependencies. You can configure a Java project to "include" those dependencies so that they are available to the code. In .NET, the analogy is references. You specify the links to the external references you want to be available in the References section. In this case, it's not JAR files, but DLLs or other libraries.
One type of reference you can add is a web reference. When you select Add Web Reference, you are given the opportunity to add a link to a WSDL. Paste the link in the edit box, and press Go.

Add the following using clause to the Form1.cs file of your application:

// using application.webreferencename

using DemoGetVehInf.qtref;

and instantiate the web service object

private DemoGetVehInf.qtref.QTWebSvcsServiceWse svc = new qtref.QTWebSvcsServiceWse();

Modify reference.cs


 

  • Was this article helpful?