skip to main content
Corticon Server: Deploying Web Services with .NET : Consuming a Decision Service on .NET server : Path 2: Using bundled C# sample code to consume a Decision Service : Creating the WSDL and proxy files

Try Corticon Now
Creating the WSDL and proxy files
The WSDL and the proxy files are created as follows:
1. If your .NET Server and Studio are colocated, you have the Tutorial Ruleflow in the server's [CORTICON_WORK_DIR]\Samples\Rule Projects\Tutorial\Tutorial-Done.
If your .NET Server and Studio are on separate machines, copy and stage that file so that it can be accessed on the .NET server machine.
2. Launch the Deployment Console on the Corticon Server .NET machine by choosing the Start menu command All Programs > Progress > Corticon 5.7 > Corticon .NET Deployment Console
3. Click the ... button to the right of the Ruleflow on the one empty line listed, and the locate the tutorial_example.erf file.
4. In the lower section, click the Type dropdown, and then choose WSDL.
The window should now look like this:
Figure 398. Creating a new WSDL using the Deployment Console
5. Click Generate Service Contracts to save the service contract file, which is named Cargo_Cargo.wsdl. It may be convenient to generate this file into a separate directory. Here, we use directory [CORTICON_WORK_DIR].
Note: To generate a web service proxy, you need wsdl.exe. When you run wsdl.exe Cargo_Cargo.wsdl, the file CargoDecisionService.cs is created. Place that file in the .NET Server's [CORTICON_HOME]. Refer to the GenProxy.bat file located at [CORTICON_HOME_\Server .NET\samples\wcf-client for the WSDL options, typically /namespace: and /out:.
6. Write C# client code to call the web service. We provide a sample in CallCargoService.cs, which sets values of attributes used in the rules.
7. Compile CargoDecisionService.cs and CallCargoService.cs using the csc *.cs command. Generally, the compile process needs to occur in your .NET Framework root directory, so you may need to move both C# files to that directory prior to compilation. In our case, the .NET Framework is installed at C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319
This generates an executable file named CallCargoService-webservice.exe. Store the file in your [CORTICON_WORK_DIR].
8. If you have not already done so, deploy the tutorial_example Decision Service to Corticon Server for .NET on IIS. Follow the instructions for Creating and Installing a Deployment Descriptor File.
9. Run CallCargoService-webservice.exe to execute the call to Corticon Server. You will see the following output:
Figure 399. Invoking Corticon Server for .NET via C# Sample Code