Discussion:
Setting message properties
(too old to reply)
Waqar Sadiq
2009-05-14 23:11:17 UTC
Permalink
After having a lot of problems with large flat files, I decided to basically
process my flat files through a .NET program and then submit messages using
the SubmitDirect adapter that comes with BizTalk SDK samples. I did not
want to change my receive side adapter. However, things did not workout as
I was hoping to.

In my .net program (that could replace the receive side processing), I am
reading the flatfile and based and then constructing an xml message. I am
then submitting that message using the API with SubmitDirect adapter. The
messages get published but they do not have some key properties that might
be needed.

First, when I look at the published message, it has no type. So in the
context, I was expecting the type to be something like
http://LWTestOrgDA.MemberProcessing.Schemas.Certificate#Certificates but is
empty. The I would like to setup some other properties as well such as the
receive file name and so forth. On the Send side, I have a map which is not
being applies and I suspect it is so because the type of the message is not
set.

My question is how can I set message properties in a .net program and then
also promote them?

Any help is greatly appreciated?

Thanks.

Waqar
Tomas Restrepo [MVP]
2009-05-15 11:10:00 UTC
Permalink
Post by Waqar Sadiq
After having a lot of problems with large flat files, I decided to basically
process my flat files through a .NET program and then submit messages using
the SubmitDirect adapter that comes with BizTalk SDK samples. I did not
want to change my receive side adapter. However, things did not workout as
I was hoping to.
In my .net program (that could replace the receive side processing), I am
reading the flatfile and based and then constructing an xml message. I am
then submitting that message using the API with SubmitDirect adapter. The
messages get published but they do not have some key properties that might
be needed.
First, when I look at the published message, it has no type. So in the
context, I was expecting the type to be something like
http://LWTestOrgDA.MemberProcessing.Schemas.Certificate#Certificates but is
empty. The I would like to setup some other properties as well such as the
receive file name and so forth. On the Send side, I have a map which is not
being applies and I suspect it is so because the type of the message is not
set.
My question is how can I set message properties in a .net program and then
also promote them?
Any help is greatly appreciated?
Thanks.
Waqar
The message type is not usually set by the adapter, but by the pipeline.
Are you using the right receive pipeline?
In any case, the message type is set through the BTS.MessageType property:

BTS.MessageType == http://MyNamespace#MyRootNodeTypeName
--
Tomas Restrepo
http://winterdom.com/
Waqar Sadiq
2009-05-22 14:17:23 UTC
Permalink
I am actually using a pass through pipeline. However, I was ablt to set the
message properties using the following in my code that calls the API for
SUbmitDirect adapter.

msg.Context.Write("MessageType",
"http://schemas.microsoft.com/BizTalk/2003/system-properties", nsUri);

msg.Context.Write("InterchangeID",
"http://schemas.microsoft.com/BizTalk/2003/system-properties", iid);

msg.Context.Write("ReceivedFileName",
"http://schemas.microsoft.com/BizTalk/2003/file-properties", _inputFile);



Thanks.
Post by Tomas Restrepo [MVP]
Post by Waqar Sadiq
After having a lot of problems with large flat files, I decided to
basically process my flat files through a .NET program and then submit
messages using the SubmitDirect adapter that comes with BizTalk SDK
samples. I did not want to change my receive side adapter. However,
things did not workout as I was hoping to.
In my .net program (that could replace the receive side processing), I am
reading the flatfile and based and then constructing an xml message. I
am then submitting that message using the API with SubmitDirect adapter.
The messages get published but they do not have some key properties that
might be needed.
First, when I look at the published message, it has no type. So in the
context, I was expecting the type to be something like
http://LWTestOrgDA.MemberProcessing.Schemas.Certificate#Certificates but
is empty. The I would like to setup some other properties as well such
as the receive file name and so forth. On the Send side, I have a map
which is not being applies and I suspect it is so because the type of the
message is not set.
My question is how can I set message properties in a .net program and
then also promote them?
Any help is greatly appreciated?
Thanks.
Waqar
The message type is not usually set by the adapter, but by the pipeline.
Are you using the right receive pipeline?
BTS.MessageType == http://MyNamespace#MyRootNodeTypeName
--
Tomas Restrepo
http://winterdom.com/
Loading...