Binary message creation in BizTalk Server
From: Christof ("Christof")
Date: 05/01/04
- Previous message: Christof: "Re: Develop Pivot-Web Parts with BAS/BAM-Data"
- In reply to: Arun: "Distribution in BTS 2004"
- Next in thread: Arun: "RE: Binary message creation in BizTalk Server"
- Reply: Arun: "RE: Binary message creation in BizTalk Server"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 1 May 2004 22:34:39 +0200
Ok Arun... let' s go :-)))
- Define your XML schema
- Deploy it
- Setup a new orchestration and drop a rcv shape and port in there in order
to receive your input message
- Iterate through each of the vendors in your inbound XML message
- Create .NET class like you see in "snippet 1" below. Doing this will
allow you to load binary messages like pdf etc into your orchestration.
- For each iteration, please do following:
- construct a BizTalk Server Orchestration Message of type
"System.Xml.XmlDocument"
- initialise it by calling the MyMessageCreator.CreateMyMessage in a
"construct message" shape, give the message as parameter
- drop a send shape
- connect it to a dynamic send port
- set the destination of the send port in an expression shape (like
this: ftp://myserver/mydirectory/myfilename.pdf)
- assign the FTP username and password to use in the construct message
shape, like you can see in snippet 2 below.
Hope this helps!
Best regards,
Christof
========= snippet 1 ===============
Option Explicit On
Option Strict On
Imports System
Imports System.Runtime.InteropServices
Imports Microsoft.XLANGs.BaseTypes
Namespace CLAESSENS.BTS2004.SAMPLES
<Serializable()> _
Public Class MyStreamFactory
Implements Microsoft.XLANGs.BaseTypes.IStreamFactory
Private m_mystringdata As String = ""
Public Sub New(ByVal stringdata As String)
m_mystringdata = stringdata
End Sub
Public Overridable Function CreateStream() As System.IO.Stream _
Implements
Microsoft.XLANGs.BaseTypes.IStreamFactory.CreateStream
return New IO.MemoryStream( _
System.Text.ASCIIEncoding.ASCII.GetBytes(m_mystringdata ))
End Function
End Class
<Serializable()> _
Public Class MyMessageCreator
Public Sub CreateMyMessage(ByVal mydestmsg As XLANGMessage)
mydestmsg(0).LoadFrom(New MyStreamFactory("this
is my binary test data to construct message from"))
End Sub
End Class
End Namespace
===============================
========= snippet 2 ===============
//configure your dynamic FTP port:
orchprtSndMyMessagePort(Microsoft.XLANGs.BaseTypes.Address) =
ftp://myserver/mydirectory/myfilename.xml;
//set context on the message you want to send:
msgMyMessage(FTP.UserName) = "myFTPUsername";
msgMyMessage(FTP.Password) = "myFTPPassword";
msgMyMessage(BTS.RetryCount) = 20;
msgMyMessage(BTS.RetryInterval) = 2;
===============================
"Arun" <anonymous@discussions.microsoft.com> wrote in message
news:137EDBDB-8C10-439D-A1F5-4052C48CD8BE@microsoft.com...
> Hi All
>
> I would like to distribute non-XML files to different vendors using BTS
2004 FTP Adapter
> My vendor names would be part of my input XML message
>
> I would iterate through XML message and get the vendor list and pick up
the Non-XML files (such as .doc, .pdf, .xls etc.,)
> from a pre-defined location (location also will be part of input message)
and ftp these files along with input XML to
> different locations.
- Previous message: Christof: "Re: Develop Pivot-Web Parts with BAS/BAM-Data"
- In reply to: Arun: "Distribution in BTS 2004"
- Next in thread: Arun: "RE: Binary message creation in BizTalk Server"
- Reply: Arun: "RE: Binary message creation in BizTalk Server"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|