Skip to content

Usage with .NET (#C)

The consumption of the Infor Web Service in C# (.NET) is very easy. First the Proxy Classes must be generated. In Visual Studio, create (for example) a new console project and add a service reference.

Image title

Figure 1: Creation of Proxy Classes - Adding Service Reference

In the window that will pop up after clicking in the previous option, add the address of the Web Service, in this case https://cmmsx.cern.ch/WSHub/SOAP?wsdl

Image title

Figure 2: Creation of Proxy Classes - Parameters for Service Reference

After the Service Reference has been created in the Project, the following Code can be used to invoke the Infor Web Services for instance to update the Description of a Work Order.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace InforWSClient {

    class Program {

        static void Main(string[] args) {

            // Get Client for Web Service
            InforWS.WSHubClient client = new InforWS.WSHubClient();

            // Credentials
            InforWS.credentials credentials = new InforWS.credentials();
            credentials.username = "LPATER";
            credentials.password = "NICE_PASSOWRD";

            // Create the Work Order object
            InforWS.workOrder workorer = new InforWS.workOrder();
            workorer.number = "1235429";
            workorer.description = "New Description";

            // Call the Web Service
            try {
                client.updateWorkOrder(workorer, credentials, null);
            }

            catch (Exception e) {
                Console.WriteLine("Error: {0}", e.Message);
            }
        }
    }
}

Comments from Sara

Show what happens when we use this functions maybe??


Last update: July 8, 2022