You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

This section contains .NET API examples, including setting up the Vendor SOAP API and example usage of the Vendor and End User SOAP API. 

To use the LAC SOAP API, you need to write a client application that will send a proper request to the webservice and receive the response that the service sends back. With a programming language like C#, you can write this application in a matter of minutes using the steps below. After following these steps, which are the same for both Vendor and End-user SOAP APIs, you can easily send requests and receive responses from the service.

The following example shows setup for the Vendor SOAP API. This example uses Visual Studio 2010, which is only one option. 

1. To start using the LAC SOAP API, create an empty Console Application project in Microsoft Visual Studio 2010. You can also change the application name to VendorAPIExample or EnduserAPIExample as appropriate.

2. To auto-generate classes representing LAC data structures and Vendor SOAP API methods, right-click on your project in the Solution Explorer and select Add Service Reference... from the list.

3. To get the SOAP API reference, enter the proper URL for the wsdl file (for the Vendor SOAP API: https://license.x-formation.com/soap/type/vendor/version/1?wsdl; for the End-user SOAP API: https://license.x-formation.com/soap/type/enduser/version/1?wsdl). You can also change the Namespace to LACVendorAPI or LACEnduserAPI as appropriate. Click Go to auto-generate all required classes.

Note: By default, the maximum size of the auto-generated SOAP binding received message is 65536. You should adjust this value as needed (for example, you may need to increase the maximum size for large license files) by setting the values of maxReceivedMessageSize and maxBufferSize binding parameters in the app.config file for the project. The set value should be identical for both parameters.

Vendor SOAP API example

For a Vendor SOAP API example, download the vendor.cs file attached to this page. This example shows how to remotely add new customers and create a new license order of an existing product in LAC. The only changes you need to make are to the credentials, the product and product template name, and the customer information.

Download file

vendor.cs

End user SOAP API example

Download the attached file, enduser.cs, to see an End user SOAP API example that implements license activation using the SOAP API and the web service reference classes generated as described above.

Download file

enduser.cs

Example of retrieving data using the SOAP API

Download the attached file, GetData.cs, to see an example of retrieving data using the SOAP API. This example shows how to retrieve customer and license order information. This type of program can also be used to synchronize LAC with external systems; for example, to send emails to customers when their license is nearing expiration.

Download file

GetData.cs

  • No labels