Creating and Testing the .NET 3.0 Client Using Sample Code

To reach the .NET 3.0 (and later) command shell and create the client, follow these steps:

  1. Go to Start > All Programs > Microsoft Windows SDK > CMD Shell.
  2. Change directory (cd) to find the sample code (sample_wcf.cs).
  3. Generate the proxy classes as follows:

    svcutil /config:sample_wcf.exe.config https://ics2wstesta.ic3.com/commerce/1.x/transactionProcessor/ CyberSourceTransaction_N.NN.wsdl

    where

    N.NN is the latest server API version. For the latest version, navigate to https://ics2wstesta.ic3.com/commerce/1.x/transactionProcessor

    Two files are generated:

    > The CyberSourceTransactionWS.cs file contains the proxy classes.

    > The sample_wcf.exe.config file is the configuration file for your application.

  4. In sample_wcf.exe.config, change the security mode from Transport to TransportWithMessageCredential.
    The security element should now read: <security mode="TransportWithMessageCredential">
  5. To write the code to process your transactions, use sample_wcf.cs
    1. Add your own values to MERCHANT_ID and TRANSACTION_KEY.
    2. Build the executable file as follows:

      csc /out:sample_wcf.exe /target:exe /reference:"C:\WINDOWS\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\System.ServiceModel.dll" CyberSourceTransactionWS .cs sample_wcf.cs

      csc /out:sample_wcf.exe /target:exe /reference:"C:\WINDOWS\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\System.ServiceModel.dll" CyberSourceTransactionWS .cs sample_wcf.cs

    The sample_wcf.exe file is created.
  6. Run the sample_wcf.exe file.
  7. The reply file contains the request result and all returned fields. When client testing is finished, write the code to use the client application.