Integrating With WCF Services
  • Updated on 13 Jul 2016
  • 3 minutes to read
  • Print
  • Dark
    Light

Integrating With WCF Services

  • Print
  • Dark
    Light

Overview

This tutorial demonstrates how to integrate with a WCF Service in Decisions and use this service in a workflow.
For more information on WCF bindings, please visit https://msdn.microsoft.com/en-us/library/dd936243.aspx

  • Note : If your bindings do not show up automatically in the drop down this is because the WCF service you are attempting to use does not publish or expose bindings that Decisions can use automatically. If this is the case, try a standard Web Service Integration or use our SDK .

Example

In this example, integrate with Bing’s Geocode WCF Service and use this integration in a workflow. Begin with creating a Reference to the WCF Service in the Decisions Studio .
Navigate to the project's designer folder and, at the bottom of the panel, select Datatypes/Integrations > Add WCF Service Reference.
new-wcf.jpg

For this example we will need the URL of the Bing Geocode Service as shown in-browser below:
service.png

In the Studio, we name our service referencein the Add WCF Service Reference menu (in this example "BingGeocode"), and paste the URL (http://dev.virtualearth.net/webservices/v1/Geocodeservice/Geocodeservice.svc) in the URL field. We should then be able to pick an Endpoint for our service from the drop down menu.
3_WcfConfigMenu.png

Click OK to save our WCF Service Reference*.*

4_OkToSave-1.png

Decisions Studio creates a WCF service reference in our External Services folder.
5_WcfServiceAdded.png

Next, we are going to use thiss ervice in a flow . In the Designer Folder, at the bottom of the panel we click Create Flow.
cf.jpg

We name it (in this case "Bing GeoCode Service Flow") and click OK.
name-flow1.jpg

The Flow Designer opens. From the Steps tab on the right, the first step we add is Show Form (in the Favorite Steps category).
flow-step.jpg

Name the form (in this case "User Inputs Form") and click Create. .
2018-08-03_124433.jpg

The Forms Designer opens. We want to design this form to get two user inputs: ZIP Code and Country. To design this form as shown below, add and configure LabelText Box, andButton controls from the Form Controls tab on the right.
When finished, we can save the form and close the Form Designer.
form1.jpg

Back in the Flow Designer, we want to call our Geocode Service . When we created the WCF service reference in the beginning of this example, the Decisions Engine analyzed this new service method and generated new steps for us to use. The new steps are in the Steps tab on the right under Integrations > My Integrations > WCF Services > [WCF Service Reference Name] category.
11_AddGeoCodeStep.png

From this location we drag a GeoCode step onto the workspace and connect its Failed outcome path to the red end step. Next we drag a Show Form step onto the workspace and connect the Done outcome.

12_Add2ndForm.png

We double-click this new form to edit it. We name it (in this case "Results Form") and click Create to proceed to the Form Designer .
13_ResultsForm-1.png

We want to design this form to display some of the information the GeoCode service will output based on the inputs provided by the user. From the Form Controls tab on the right, add and configure the form using the highlighted controls. When finished, save and close Forms Designer.
14_AddLabels.png

Back in the Flow Designer, we connect the Done outcome path from the "Results Form" to thered end step.
Next, double-click the GeoCode step to configure it. Under Inputs, we use Build Data mapping type and clickShow Mapping Editor.
15_EditGeoCodeStep.png

In the Mapping Editor we drag over the mapping arrows as shown below. We click Build Data for the Address property, clickSelect Value for Country/Region, and click Select Value of ZIP for PostalCode property. Then, we click Build Data for the Credentials property, use Text Merge.Plain mapping type for Token property and click Show Editor.
16_InputMapping.png

In the Merge Text Editor we paste our Bing Key and click OK to save and continue.
17_GeoCodeKey.png

Next, we save and close the Mapping Editor. This completes our Flow . Back in the Flow Designer, to test our flowwe click Debug Flow at the top of the panel.
18_DebugFlow.png

In the Debugger, click the play arrow to start the test. The first form ("User Input Form") opens and we provide inputs for ZIP code and country then click Done .
19_EnterTestData.png

Our second form opens ("Results Form") and we can see what is returned by the GeoCode service method. Click Done .
20_Results.png

Our flow executes with no issues.
21_DebuggerResults.png

Was this article helpful?