Discussion:
Creating messages in a custom adapter
(too old to reply)
Waqar Sadiq
2008-04-17 16:59:26 UTC
Permalink
I am developing a receive adapter that has to publish message to BizTalk.
The message is of the following form:

<ns0:AttributeSets xmlns:ns0="http://xyz.MemberProcessing">
<Member Ipcode="">
<VirtualCard LoyaltyIdNumber="">
<TransactionSummary TransactionID="" TransactionType="" Company=""
TransactionNumber="" >
<TransactionDetail TransactionID="" LineNumber=""
Quantity=""></TransactionDetail>
</TransactionSummary>
</VirtualCard>
</Member>
</ns0:AttributeSets>

In this message under "AttributeSets" node, there may be repeated instances
of "Member" node. What is the best way to construct the BizTalk message
that can then be published to the message box.

Thanks in advance.

Waqar Sadiq
Richard Case
2008-05-20 12:42:00 UTC
Permalink
I have used code similar to this in the past (which i got from the adapter
wizard):

private IBaseMessage CreateMessage(Stream stream)
{
stream.Seek(0, SeekOrigin.Begin);
IBaseMessagePart part = _messageFactory.CreateMessagePart();
part.Data = stream;

IBaseMessage message = _messageFactory.CreateMessage();
message.AddPart("body", part, true);

// We must add these context properties
SystemMessageContext context = new SystemMessageContext(message.Context);
context.InboundTransportLocation = _uri;
context.InboundTransportType = _transportType;

return message;
}
Post by Waqar Sadiq
I am developing a receive adapter that has to publish message to BizTalk.
<ns0:AttributeSets xmlns:ns0="http://xyz.MemberProcessing">
<Member Ipcode="">
<VirtualCard LoyaltyIdNumber="">
<TransactionSummary TransactionID="" TransactionType="" Company=""
TransactionNumber="" >
<TransactionDetail TransactionID="" LineNumber=""
Quantity=""></TransactionDetail>
</TransactionSummary>
</VirtualCard>
</Member>
</ns0:AttributeSets>
In this message under "AttributeSets" node, there may be repeated instances
of "Member" node. What is the best way to construct the BizTalk message
that can then be published to the message box.
Thanks in advance.
Waqar Sadiq
Loading...