BizTalk Server Orchestration - Receiving and distributing files of different formats

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > April 2005 > Receiving and distributing files of different formats





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Receiving and distributing files of different formats
njhudson

2005-04-25, 8:47 pm

I need to receive files containing data of various formats using the
file adapter and route them to different directories based on file
name extension. I can't seem to get this to work in an orchestration
because the send and receive ports and shapes want to examine the
message format . The orchestration designer wants me to specify a
message type which is defined by a schema. I have also tried to set
up a receive port using the default passthru pipeline to pick up all
the files in a directory and then have send ports filter using the
variable "FILE.ReceviedFileName". But I get the error "Could not
find a matching subscription for the message". Does anybody have
some advice?

Jake

2005-04-26, 2:48 am

I hope somebody else will have a better answer, but from what I can tell
you won't be able to use this approach. The reason it won't work because
the ReceivedFileName poperty is not promoted, it is just part of the
message context. I believe a property has to be promoted for the
MessageBox to use it for routing.

Jake Watkins
JakeW@nospam-guerillaprogrammer.com
EAI Architect - MCSD - C#, Web-Services, WSE, BizTalk 2004, SharePoint
2003, InfoPath
Cell - 469-855-5919




nhudson@ndc-inc-dot-com.no-spam.invalid (njhudson) wrote in
news:dcSdndqC8cL1FvDfRVn_vA@giganews.com:

> I need to receive files containing data of various formats using the
> file adapter and route them to different directories based on file
> name extension. I can't seem to get this to work in an orchestration
> because the send and receive ports and shapes want to examine the
> message format . The orchestration designer wants me to specify a
> message type which is defined by a schema. I have also tried to set
> up a receive port using the default passthru pipeline to pick up all
> the files in a directory and then have send ports filter using the
> variable "FILE.ReceviedFileName". But I get the error "Could not
> find a matching subscription for the message". Does anybody have
> some advice?
>
>


Jon Flanders[MVP]

2005-04-26, 2:48 am

Jake is correct - but you could use this to your advantage. The thing to do
would be to create a property schema and a custom property - you could call
it "FileExt" or whatever you;d like. (make sure to set the Property Schema
Base property to "MessageContextPropertyBase" so that if you do end up using
this from an orchestration the orchestration compiler doesn't complain about
it not being in a message).

Register the property schema. Then create a custom pipeline component that
detects the file extention (you can get the ReceivedFileName from the
context) and then promotes the value you want into the context. You can
then create send ports or use this in an orchestration to route the
messages.

Code might look something like this (likely this won't compile - it is off
the top of my head but hopefully will get you started ) :

IBaseMessage IComponent.Execute(IPipelineContext pc, IBaseMessage msg)
{
string fn =
msg.Context.Read("ReceivedFileName",http://schemas.microsoft.com/BizTal...stem-properties").ToString();
string ext = System.IO.Path.GetExtension(fn);
msg.Context.Promote("FileExt","http://mypropertyschemans",ext);
return msg;
}

--
Jon Flanders
http://www.masteringbiztalk.com/blogs/jon/

"Jake" <RunsInCirclesScreaming_MAPS_@msn.com> wrote in message
news:Xns9643DC509A838RunsInCirclesScream
i@207.46.248.16...
>I hope somebody else will have a better answer, but from what I can tell
> you won't be able to use this approach. The reason it won't work because
> the ReceivedFileName poperty is not promoted, it is just part of the
> message context. I believe a property has to be promoted for the
> MessageBox to use it for routing.
>
> Jake Watkins
> JakeW@nospam-guerillaprogrammer.com
> EAI Architect - MCSD - C#, Web-Services, WSE, BizTalk 2004, SharePoint
> 2003, InfoPath
> Cell - 469-855-5919
>
>
>
>
> nhudson@ndc-inc-dot-com.no-spam.invalid (njhudson) wrote in
> news:dcSdndqC8cL1FvDfRVn_vA@giganews.com:
>
>



Alan Smith

2005-04-26, 7:47 am

Hi,

If you only have a few file types to route, you could do the following:

1 Create a receive port for each file type, and a receive location with a
filter.
2 Create a send port for each fie type, and subscribe to the
BTS.ReceivePortName property.

You could export a binding file for one send-receive port group (BizTalk
Deployment Wizard), copy and paste to create a file for the other ports.

Jon's solution is more elegent if there's a lot of file types.

Regards,

Alan

"njhudson" wrote:

> I need to receive files containing data of various formats using the
> file adapter and route them to different directories based on file
> name extension. I can't seem to get this to work in an orchestration
> because the send and receive ports and shapes want to examine the
> message format . The orchestration designer wants me to specify a
> message type which is defined by a schema. I have also tried to set
> up a receive port using the default passthru pipeline to pick up all
> the files in a directory and then have send ports filter using the
> variable "FILE.ReceviedFileName". But I get the error "Could not
> find a matching subscription for the message". Does anybody have
> some advice?
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com