Search code examples
c#wcfsoapjobsbiztalk

Sending (pushing) Soap WS messages trough biztalk at given time


I would like to know if someone could provide example or a link on some tutorial which would show how to send messages using soap as a job (at given time) trough biztalk. I have expirience doing this with in java enviroment with JMS, but Im doing it for the first time in .net and its technologies.

What I need to do could be broken into steps.

  1. Create WCF SOAP service that would have one method for sending collection of data from our system to a vendors system trough BizTalk.
  2. Do this at given time - create a job(timer) that would do this once a day. What is the best way? Should I program this job by myself or is it common to use some windows scheduler on server?

Thanx a lot for any suggestions.

Edit: Concept of comunication: app1-client(here is the timing job)->sends data->biztalk-server(WS)->sends data ->app2-server(WS)


Solution

  • Typically it make sense to have the system that owns the data also own the scheduling of sending out the data. For example, if the data is coming out of SQL Server, use SQL Server's built-in functionality for scheduling (SQL Jobs) as your trigger to kick off the whole process. Then, have the SQL Job dump the data to a file, in a folder monitored by a BizTalk receive location using the file adapter. BizTalk sucks in the file and a send port, which subscribes to the messages coming in from the receive port that pulled in the file, uses a WCF or SOAP adapter to send the data to your web service on the external server.

    If you don't want to or can't do things that way, I have seen people use:

    • The Scheduled Task Adapter on CodePlex (as @tomasr referenced)
    • A Windows Scheduled Task (more difficult to manage, especially prior to Windows Server 2008)
    • Third-party job scheduling software (particularly if already in use)

    If the triggering mechanism does not have access to the data that needs to flow through BizTalk, BizTalk can certainly go and get the data (e.g., from SQL Server), before sending it to the server's web service. In that case the scheduled job could drop a file in the folder monitored by BizTalk with some content in it that BizTalk doesn't care about - just make sure that there is something in the file, because BizTalk likes to discard empty, 0 byte files.

    BizTalk is not a job scheduler. So, though you can use something like the scheduled task adapter, BizTalk's sweet spot is really the transformation, routing, and/or business process orchestration of messages, along with a pluggable architecture (using adapters). Typically you want to let BizTalk handle all of those functions and use some other system (if available) for scheduling.