How to use WebCalls

  1. The OpenForms 360 service should be running.
  2. Create a project in Microsoft Visual Studio 2010.
  3. Add service reference to the project, type the following address in the Address field, and click Go.
    • http://OpenForms_server:8000/OpenForms/MEX
  4. Give the namespace a name.
    For example OFWebClient.
  5. Use the following code to connect and query the methods:
    using System; 
    using System.Collections.Generic;
    using System.ComponentModel; 
    using System.Data; 
    using System.Drawing; 
    using System.Linq; 
    using System.Text; 
    using System.Windows.Forms; 
    using System.ServiceModel; 
    namespace WebCallsTest { 
        public partial class Form1 : Form { 
            public const string 
            cDS_Classify = "DOKuStar_Classify", 
            cDS_Index_1_Field = "DOKuStar_Index_1_Field", 
            cDS_Index_3_Field = "DOKuStar_Index_3_Field", 
            cDS_Index_6_Field = "DOKuStar_Index_6_Field", 
            cDS_Index_10_Field = "DOKuStar_Index_10_Field", 
            cDS_Reader = "DOKuStar_Reader", 
            cDS_Option_Table = "DOKuStar_Option_Table", 
            cDS_Option_FuzzyDb = "DOKuStar_Option_FuzzyDb", 
            cDS_Option_HandPrint = "DOKuStar_Option_HandPrint", 
            cDS_Option_Address = "DOKuStar_Option_Address", 
            cDS_Option_Invoice = "DOKuStar_Option_Invoice", 
            cDS_Option_InvoiceLineItems = "DOKuStar_Option_InvoiceLineItems", 
            cDS_Validation = "DOKuStar_Validation", 
            cDS_ART = "DOKuStar_ART"; 
            public Form1() { 
                InitializeComponent(); 
            } 
            private void Form1_Load(object sender, EventArgs e) { 
                urlTextBox.Text = "net.tcp://nsi-sergeyr1.md.nsius.com:8081/OpenForms"; 
                licenseComboBox.Items.Add(cDS_Classify); 
                licenseComboBox.Items.Add(cDS_Index_1_Field); 
                licenseComboBox.Items.Add(cDS_Index_3_Field); 
                licenseComboBox.Items.Add(cDS_Index_6_Field); 
                licenseComboBox.Items.Add(cDS_Index_10_Field); 
                licenseComboBox.Items.Add(cDS_Reader); 
                licenseComboBox.Items.Add(cDS_Option_Table); 
                licenseComboBox.Items.Add(cDS_Option_FuzzyDb); 
                licenseComboBox.Items.Add(cDS_Option_HandPrint); 
                licenseComboBox.Items.Add(cDS_Option_Address); 
                licenseComboBox.Items.Add(cDS_Option_Invoice); 
                licenseComboBox.Items.Add(cDS_Option_InvoiceLineItems); 
                licenseComboBox.Items.Add(cDS_Validation); 
                licenseComboBox.Items.Add(cDS_ART); 
            } 
            private void licenseComboBox_SelectedIndexChanged(object sender, EventArgs e) { 
                NetTcpBinding netTcpBinding = new NetTcpBinding(); 
                netTcpBinding.TransferMode = TransferMode.Streamed; 
                OFWebClient.OpenFormsWCFServiceClient ws = new OFWebClient.OpenFormsWCFServiceClient(netTcpBinding, new EndpointAddress(urlTextBox.Text)); 
                regularCountTextBox.Text = ws.RegularVolume(licenseComboBox.SelectedItem.ToString()).ToString(); 
                batteryCountTextBox.Text = ws.BatteryVolume(licenseComboBox.SelectedItem.ToString()).ToString(); 
                ActiveClientsTextBox.Text = ws.ActiveClients(licenseComboBox.SelectedItem.ToString()).ToString(); 
                maxClientsTextBox.Text = ws.MaxClients(licenseComboBox.SelectedItem.ToString()).ToString(); 
                maxVolumeTextBox.Text = ws.MaxVolume(licenseComboBox.SelectedItem.ToString()).ToString(); 
            } 
        } 
    }