Consuming WCF Service in BizTalk 2010 Orchestration
In this article I will show how to consume WCF Services in BizTalk 2010 Orchestration in a Step by Step manner, Before consuming WCF in BizTalk, you should be aware of how to create and host WCF services.
Consuming WCF Service in BizTalk 2010 Orchestration
First create the WCF service , this service takes a simple string as parameter and gives the response , as shown below, the below screen shots shows how to create a WCF application service and how to host it into IIS
Refer How to create and host WCF service for more detail
Below snapshots show basic idea of creating WCF and hosting it.
Copy the below code by opening the project in windows explorer, create a virtual directory under inetpub/wwwroot/WCFHelloWorld and paste it .
1. Create an empty BizTalk 2010 project
2. Right click the project
3. Create new Orchestration
3. Add Consume WCF Service
4. Click Next
5. Select Metadata Exchange (MEX) endpoint
6. Paste the metadata address and click Get and Next
7. Import the WCF service metadata summary
8. Click Finish
9. These files are created
10. The port type gets created
11. Create new configured port near the port surface
12. Click Next to create Port
13. Select 'Use an existing Port type'
14. Click next and Click Finish
15. Create input schema message
16. Create a Receive Port - which keeps listening to the input file message
17. Create a Receive Shape - to receive the input message
18. Create transform message to transform the input message to request message
19. Create a Send shape to send the Request message to WCF port
20. Create a Receive shape to get the Response message from WCF port
21. Create a Send shape to send the Response message to output File port
22. Before performing the above steps create these messages:
23. Build your project and deploy it
24. Configure your application in BizTalk Administrator console
25. Create folders: IN and OUT
26. Place this input file in IN folder (RecievePort1 in Orchestration)
27. You get this output response file in OUT folder