Skip to main content
Omnitracs Knowledge Base

Invoking the Web Service Method

Add a Button to your Solution

Put a button control onto the Windows form and set the following properties:
Text: GetVehicleInfo
Name: btnGetInfo.

Double click the button to generate a button event handler and be taken to the code window.

Add Button Handler Code to Invoke the Method

The getVehicleInformation method takes an AssetIdentifier as a parameter. The AssetIdentifier has two attributes: the scac and the id. The scac isn't used at this time so set it to blank. Set the id to a the identifier of a vehicle that exists in the database on the target server.

getVehicleInformation returns a VehicleInfo object. Instantiate the object and use it as the return value of the method.

Add the following code to the button handler to invoke the getVehicleInformation method.

private void btnGetInfo_Click(object sender, System.EventArgs e)

{

    qtref.AssetIdentifier ai = new qtref.AssetIdentifier();

    qtref.VehicleInfo vi = new qtref.VehicleInfo();

    ai.scac = "   ";

    ai.id = "CSI598";  // Replace with a vehicle in your fleet

    vi = svc.getVehicleInformation(ai);

}

You should still be able to build the solution without error.

Providing Credentials in the .NET Client

  • Was this article helpful?