Background:
I have written a custom pipeline component to batch my data being returnd
from SQL Server 2005 to a BizTalk Orchestration. My sql stored procedure
returns one very large xml do***ent that contains hundreds of xml
'messages'
So, I have written a receive pipeline component to intercept the message
coming back from SQL Server, and Batch the information into much smaller
messages. The component appears to be working (No errors, and I can write
data out to a flat file durning processing and inspect it).
Problem:
The problem comes with routing the message back to the appropriate ****t
after I have intercepted it. I have promoted the "MessageType" property
(along with trying numerous other), and it always fails.
Error:
The published messaged could not be routed because no subscribers were
found
Event ID 5778
Code to Create Outgoing Message:
Private Sub CreateOutgoingMessage(ByVal pContext As IPipelineContext,
ByVal messageString As String, ByVal namespaceURI As String, ByVal
rootElement As String, ByVal counter As Integer, ByRef pInMsg As
IBaseMessage)
Dim outMsg As IBaseMessage
Dim systemPropertiesNamespace As String =
"http://schemas.microsoft.com/BizTalk/2003/system-properties"
Dim messageType As String = ""
messageType = namespaceURI + "#" + rootElement
Dim i As Integer
Dim strName As String = ""
Dim strNamespace As String = ""
Dim strProperties As String = ""
System.IO.File.WriteAllText("c:\abf\output\properties.txt",
strProperties)
Try
outMsg = pContext.GetMessageFactory.CreateMessage
outMsg.AddPart("Body",
pContext.GetMessageFactory.CreateMessagePart, True)
System.IO.File.WriteAllText("c:\abf\output\Message" & counter
&
".xml", messageType & " " & pInMsg.Context.Read("SPTrans****tID",
systemPropertiesNamespace) & " " & pInMsg.Context.Read("InterchangeID",
systemPropertiesNamespace))
outMsg.Context.Promote("MessageType",
systemPropertiesNamespace,
messageType)
'outMsg.Context.Promote("Receive****tName",
systemPropertiesNamespace, pInMsg.Context.Read("Receive****tName",
systemPropertiesNamespace))
outMsg.Context.Promote("WasSolicitResponse",
systemPropertiesNamespace, pInMsg.Context.Read("WasSolicitResponse",
systemPropertiesNamespace))
Dim bufferOutgoingMessage() As Byte =
System.Text.ASCIIEncoding.ASCII.GetBytes(messageString)
System.IO.File.WriteAllBytes("c:\abf\output\MessageBody" &
counter & ".xml", bufferOutgoingMessage)
outMsg.BodyPart.Data = New MemoryStream(bufferOutgoingMessage)
qOutputMsgs.Enqueue(outMsg)
System.IO.File.WriteAllText("c:\abf\output\MessageQueued" &
counter & ".txt", "Message Queued")
Catch ex As Exception
'Throw New ApplicationException("Error in queueing outgoing
messages: " & ex.Message)
System.IO.File.WriteAllText("c:\abf\output\CreateOutputMessageError" &
counter & ".txt", ex.Message)
End Try
Any Help would be appreciated!


|