tags:

views:

1971

answers:

3

I'm trying to figure out how to consume a WCF service in BizTalk 2006 R2 (sending a request and receiving a response).

I've gotten as far as going through the "Add Generated Items" wizard. Now I am trying to find out how to use the items it generated in an orchestration.

I'm a beginner at BizTalk and don't have the experience to infer how the request should be made.

A: 

BizTalk is overkill if you are just using it to orchestrate WCF services. You can use WCF services in .NET 3.5 inside of Windows Workflow Foundation a bit more easily.

That said, here is a screencast that should help:

http://www.pluralsight.com/community/blogs/aaron/archive/2007/11/15/49172.aspx

jezell
+3  A: 

Hi,

Below is a description of how to do this - I'm going to presume at least basic knowledge of things like BizTalk mapping, please let me know if you need any more detail and I'll update.

After generating the items in BizTalk you should have (at the least):

  • An orchestration file with Messages and Port Types created
  • A schema that describes the messages you send and receive from and to your WCF service
  • A .Binding.xml file that describes the service contract exposed by the WCF service and allows easy configuration in BizTalk

    1. Open the orchestration file. This should be empty.
  • Drag a Port from the toolbox onto the orchestration designer surface.

  • Name the port appropriately.
  • Select "Use an existing Port Type" - one of the existing port types will be your WCF service (created by the Add Generated Items wizard)
  • Specify that you will be sending and receiving messages
  • Specify Bind Later

This port should have Request and Response operation messages and they should have been automatically configured to use the messages for your WCF service. If your service exposes multiple operations, you will see that reflected here.

  1. Using standard BizTalk mapping methods, map the data you want to send to the WCF service into the request message for the WCf port. (you may want the change the message names in the orchestration designer to be something better than the default message_1, message_2...)

  2. Drag Receive and Send shapes onto the orchestration designer and connect them to the right Port messages.

  3. Wire up the rest of the BizTalk orchestration to take data from appropriate source systems (this is just basic BizTalk, not WCF)

  4. Deploy the BizTalk application.

    The application is now ready to go, you can deploy it to BizTalk.

  5. Configure the BizTalk application

    • Open the BizTalk Server 2006 Administration Console and find the application containing the orchestration you just deployed.
    • The orchestraion will be unenlisted, you need to bind all of its ports
      For most of the ports this is just like any other BizTalk application - only the ports that deal with the WCF service differ.

For the WCF ports you have (at least to begin with) two main options:

  1. Import the bindings file made by the BizTalk Generate Items wizard (right click on the applicaiton and import - navigate to the .xml binding file) - Perhaps advisable until you have an idea of how Biztalk represents all the WCF binding options.
  2. Configure your own WCF send port.

    • For this the port needs to be Solicit-Response to match the WCF service.
    • Choose one of the WCF Send Port types to match the binding type of your WCF service.
      To begin with (for a basic Webservice) this will often be WCF-BasicHttp.
      Once you have the basics working you might want to return here and experiment with the options available in the Custom binding - there is a LOT there!
    • Configure the send port.

With your WCF port now created you can bind the orchestration ports to it.

Once all this is done, you should be able to start the BizTalk application and things should work.

One thing that may help - errors will be written to the event log, they may not be helpful, but you should also be able to see any soap fault messages returned from the service in the suspended message view.

Good luck!

David Hall
I believe what webdtc wants is an odx to _pull_ data from external WCF service, not exposing its own WCF receive location for others to _push_ data into the odx receive port.
icelava
Thanks - I never descrived publishing a WCF service from BizTalk, it was always consuming a service, but since Solicit-Response and Request-Reponse are so similar for this scenario, I mentioned receive locations when I should have said Send Ports.
David Hall
A: 

Hi, Its is very simple as other Service development in BizTalk. Let make it more simpler. (1) Just Develop you desire Work Flow (Orchestration) and Service. (2) Open WCF Web publishing Wizard and Check (a) Enable Metadata Endpoint , (b) Create BizTalk Receive Location in the in ur application. (3) Go to you BizTalk console and Enable the Receive location and Start your Application from Biztalk Console. (4) Then Browse it from IE or Fire Fox to check that either Service is running or Not. Now Service has been Develop. Lets do something for its Client. (5) Go to the Patah "c:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\" and Write SVCUTL and your url of your service i.e. c:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\svcutil localhost:axix//axx.svx?wsdl, this will copy the two files, one is output.config and other is BizTalkServiceInstance. cut and paste both files to your ciletn and then See you service desp for its consumption. I Think this is the most simplest which i tried to make. Thanks Abdul Aziz Farooqi.