Receiving and distributing files of different formats
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server Orchestration > Receiving and distributing files of different formats




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Receiving and distributing files of different formats  
njhudson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-26-05 01:47 AM

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?






[ Post a follow-up to this message ]



    Re: Receiving and distributing files of different formats  
Jake


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-26-05 07: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?
>
>






[ Post a follow-up to this message ]



    Re: Receiving and distributing files of different formats  
Jon Flanders[MVP]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-26-05 07: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...
em-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:
> 
>







[ Post a follow-up to this message ]



    RE: Receiving and distributing files of different formats  
Alan Smith


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-26-05 12:47 PM

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?
>
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:33 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register