Step 7: Creating and Configuring Ports
In this step, you create and configure the ports you use to communicate with business processes. Each port has a type, direction, and binding property. These properties establish the direction and pattern of communication, the location of where the message is sent or received, and how the communication occurs.
To create a logical send port
In Visual Studio, from the Toolbox, drag the Port shape to the orchestration design surface and drop it on the Port Surface to open the Port Configuration Wizard.
On the Port Configuration Wizard page, click Next.
On the Port Properties page, in the Name box, type ContosoSQLReqResponsePort, and then click Next.
On the Select a Port Type page, in the Port Type Name box, type ContosoSQLReqResponsePortName.
For Communication Pattern, select Request-Response.
For Access Restrictions, select Internal - limited to this project, and then click Next.
On the Port Binding page, select I'll be sending a request and receiving a response, leave the Port Binding option set to Specify Later, and then click Next.
Click Finish to create the port.
To change the variable type for the orchestration ports
In Orchestration View, expand Types, expand Port Types, expand ContosoSQLReqResponsePortName, expand Operation_1, and then select Request.
In the Properties window, select the Message Type property, expand Schemas and then click <Select from referenced assembly>.
In the Select Artifact Type dialog box, click ContosoPriceAndAvailability.
In the right pane, select rootPriceRequest, and then click OK.
In Orchestration View, under Operation_1, select Response for the ContosoSQLReqResponsePortName port type.
In the Properties window, select the Message Type property, expand Schemas and then click <Select from referenced assembly>.
In the Select Artifact Type dialog box, click ContosoPriceAndAvailability.
In the right pane, select rootPriceResponse, and then click OK.
To connect the ports to the Receive shapes
On the orchestration design surface, select the Send_1 shape.
In the Properties window, select the Message property, and then select Contoso3A2RequestMessage from the drop-down list.
Connect the ContosoSQLReqResponsePort by selecting the green handle next to the Request label and dragging it to the green handle on the Send_1 shape.
On the orchestration design surface, select the Receive_1 shape.
In the Properties window, select the Message property, and then select Contoso3A2ResponseMessage from the drop-down list.
Connect the ContosoSQLReqResponsePort by selecting the green handle next to the Response label and dragging it to the green handle on the Receive_1 shape.
In the File Menu, click Save All.