Hello All, I am trying to access the document schema properity of the disassimbler. I have looped thru the header context props and don't see that it is present. How and I get and set the document schema header in a custom componet before it's processed by the default disassimbler.
You are not able to "get" the document schema before the message is processed by a dissasembler. Retreival of this context property is exactly the task of the dissasembler component. You might be able to set it though...
Best regards, Christof -- Christof [Microsoft BizTalk Server MVP]
> Hello All, > I am trying to access the document schema properity of the > disassimbler. I have looped thru the header context props and don't see > that it is present. How and I get and set the document schema header in > a custom componet before it's processed by the default disassimbler.
Christof [MVP] wrote: > You are not able to "get" the document schema before the message is > processed by a dissasembler. Retreival of this context property is exactly > the task of the dissasembler component. You might be able to set it > though...
> Best regards, > Christof
Christof, I am able to retreave the document schema, but not sure how to set it or where? What interface would I use?
>> You are not able to "get" the document schema before the message is >> processed by a dissasembler. Retreival of this context property is exactly >> the task of the dissasembler component. You might be able to set it >> though...
[...]
> I am able to retreave the document schema, but not sure how to set it >or where? What interface would I use?
To set the schema, you can use the following code:
string systemPropertiesNamespace = "http://schemas.microsoft.com/BizTalk/2003/system-properties"; string messageType = "<your schema namespace here without the <>>#< your schema root node here>"; msg.Context.Promote("MessageType", systemPropertiesNamespace, messageType);
>>>You are not able to "get" the document schema before the message is >>>processed by a dissasembler. Retreival of this context property is exactly >>>the task of the dissasembler component. You might be able to set it >>>though...
> [...]
>> I am able to retreave the document schema, but not sure how to set it >>or where? What interface would I use?
> To set the schema, you can use the following code:
> string systemPropertiesNamespace = "http://schemas.microsoft.com/BizTalk/2003/system-properties"; > string messageType = "<your schema namespace here without the <>>#< your schema root node here>"; > msg.Context.Promote("MessageType", systemPropertiesNamespace, messageType);
Gilles, This sets the messageType properity on the message, Should that also set the pipeline's schema / message type too? I'm trying to read in many flat file types into one pipeline and route the data based on a generic header record. So I have to be able to change the pipeline's document schema at runtime via a custom pipeline. How can I change the Document schema at runtime?
>Gilles, > This sets the messageType properity on the message, Should that also >set the pipeline's schema / message type too? I'm trying to read in >many flat file types into one pipeline and route the data based on a >generic header record. So I have to be able to change the pipeline's >document schema at runtime via a custom pipeline. How can I change the >Document schema at runtime?
I assume you are currently using the flat file disassembler. In this case, you will have to write a custom disassembler that extends the out of the box, sniffs the content of the flat file and figure out the schema you want to use. Then promote the property.
I am in the process of writing an example of this on my blog but the roadmap above should get you going.
>>Gilles, >> This sets the messageType properity on the message, Should that also >>set the pipeline's schema / message type too? I'm trying to read in >>many flat file types into one pipeline and route the data based on a >>generic header record. So I have to be able to change the pipeline's >>document schema at runtime via a custom pipeline. How can I change the >>Document schema at runtime?
> I assume you are currently using the flat file disassembler. In this case, you will have > to write a custom disassembler that extends the out of the box, sniffs the content of the flat file > and figure out the schema you want to use. Then promote the property.
> I am in the process of writing an example of this on my blog but the roadmap above should > get you going.