Building and running the C# sample SOAP client

Some of the details in the steps in the ReadMe.txt file for C# are outdated. The procedure below has file paths that match those that are installed with M-Business Server version 7.0.

Note

The <M-Business_Home> directory referred to in the steps below is the M-Business home directory that is created under the location that you specify during installation. For more information, see The M-Business home directory.

To build and run the C# sample SOAP client
  1. Make sure M-Business SOAP Server is running on the default port 8093, and vending WSDL on the default port 8094.

  2. From your agsoap.conf file, copy the AuthKey into line 68 in Main.cs.

  3. Save a copy of the <M-Business_Home>/samples/csharp/Web References/SoapRef/Reference.cs file somewhere, in case Visual Studio overwrites it.

    This is the file that Visual Studio generates for you. The version installed with M-Business Server has been modified so that it will interact with standard SOAP Web services, like those in the M-Business SOAP API.

  4. Open the <M-Business_Home>/samples/csharp/console.sln file in Visual Studio .NET.

  5. In Visual Studio .NET, choose Build » Build Solution.

    The SOAP client built is <M-Business_Home>/samples/csharp/bin/Debug/console.exe

  6. Copy <M-Business_Home>/bin/soap_crypt.dll to <M-Business_Home>/samples/csharp/bin/Debug.

  7. From a command prompt, change directories to the directory above:

    cd <M-Business_Home>/samples/csharp/bin/Debug

  8. From the same command prompt, enter the following commands—replace <password> with your current admin user password.:

    console admin "<password>" "select now()"

    console admin "<password>"

    This will run all the API tests.

Note

Currently, the SOAP message that is generated by .NET is incorrect. The XML SOAP header is wrong.

To work around this .NET bug, we have edited a generated file (Reference.cs).