In this Blog I am going show how to expose BizTalk Server 2009 Schema as a WCF Service using BizTalk Server WCF publishing Wizard.
First we need to create Empty BizTalk 2009 Project and Add Schema to that project.
Here I created the Contacts XSD with the following Child Elements.
Now Build this project and deploy into BizTalk server DB.
Launch the BizTalk Server WCF Service Publishing Wizard
Enable metadata endpoint Checking check box causes the “httpGetEnabled” flag to be set to true, thus enabling Client application to retrieve the WSDL for this service.
Now select the BizTalk application name which you want to expose as WCF Service. here we need to select the project we deploy into BTS Server.
Now we asked whether we want “Publish orchestrations as WCF service” or “Publish schemas as WCF service.” This both options same as classic BizTalk Web Services Publishing Wizard. Now we will choose Publish schemas option.
Here we are going to Add method to our WCF Service .
Select the Schema type for the method we just created.
Provide the Namespace for the WCF Service.
Provide the IIS Server Location to create the WCF Service. check allow Anonymous Access.
Go to IIS Manger and you can see the WCF Service web application is created with .SVC file
Browse the WCF .SVC file. Now you created WCF service.
Configure the BizTalk server Receive and Send ports.
Now let's create the Windows Client and consume the BizTalkServiceInstance WCF Service.
Run the client Application , now you will see Message in BTS Send ports.