0

I started with the solution here http://social.technet.microsoft.com/wiki/contents/articles/20547.biztalk-server-dynamic-schema-resolver-real-scenario.aspx which matches my scenario perfectly except for the send port, but that isn't necessary. I need the receive port to choose the file and apply a schema to disassemble. From their the orchestration does the mapping, some of it custom, etc.

I've done everything in the tutorial but I keep getting the following error. "There was a failure executing the receive pipeline... The body part is NULL"

The things I don't get from the tutorial but don't believe they should be an issue are:

  1. I created a new solution and project to make the custompipeline component (reference figure 19) and thus the dll file. Meaning it is on it's own namespace. However, it looks like from the tutorial they created the project within the main biztalk solution (ie the one with the pipeline and the orchestration) and thus the namespace has "TechNetWiki.SchemaResolver." in it. Should I make the custompipeline component have the namespace of my main solution? I'm assuming this shouldn't matter because I should be able to use this component in other solutions as it is meant to be generic to the business rules that are associated with the biztalk application.

  2. The other piece I don't have is Figure 15 under the "THEN Action" they have it equal the destination schema they would like to disassemble to but then they put #Src1 at the end of "http://TechNetWiki.SchemaResolver.Schemas.SRC1_FF#Src1". What is the #Src1 for?

2 Answers2

0

In the sample you've linked to, the probe method of the pipeline component is pushing the first 4 characters from the filename into a typed message that is then passed into the rules engine. Its those 4 characters that match the "SRC1" in the example.

string srcFileName = pInMsg.Context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties This link is external to TechNet Wiki. It will open in a new window. ").ToString();
srcFileName = Path.GetFileName(srcFileName);

//Substring the first four digits to take source code to use to call BRE API
string customerCode = srcFileName.Substring(0, 4);

//create an instance of the XML object
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(string.Format(@"<ns0:Root xmlns:ns0='http://TechNetWiki.SchemaResolver.Schemas.SchemaResolverBRE This link is external to TechNet Wiki. It will open in a new window. '>
    <SrcCode>{0}</SrcCode>
    <MessageType></MessageType>
    </ns0:Root>", customerCode));
//retreive source code in case in our cache dictionary
if (cachedSources.ContainsKey(customerCode))
{
   messageType = cachedSources[customerCode];
}
else
{
TypedXmlDocument typedXmlDocument = new TypedXmlDocument("TechNetWiki.SchemaResolver.Schemas.SchemaResolverBRE", xmlDoc);
Microsoft.RuleEngine.Policy policy = new Microsoft.RuleEngine.Policy("SchemaResolverPolicy");
                    policy.Execute(typedXmlDocument);

So the matching rule is based on the 1st 4 characters of the filename. If one isn't matched, the probe returns a false - i.e. unrecognised.

The final part is that the message type is pushed into the returned message - this is made up of the namespace and the root schema node with a # separator - so your #src1 is the root node.

Jason Hyland
  • 719
  • 1
  • 7
  • 21
  • Thanks for the response Jason. Unfortunately it didn't seem to do the trick. I have the filename rule correct and the #src1 refers to my root not of the schema that I'd like to disassemble to. It's weird that the rule doesn't pickup. Seems pretty straight forward. – user3086028 Dec 14 '13 at 01:03
  • 1
    Have you tried connecting to the pipeline component with the debugger ? Stick a break point on the probe method and see what's happening. Should be able to work out the issue. – Jason Hyland Dec 14 '13 at 15:36
0
  • You need to implement IProbeMessage near to class I forgot to add IProbeMessage in the code of article. It is updated now. but it is there in sample source code

  • Src1 is the the root node name of schema. I mentioned that in article that message type is TargetNamespace#Root

I recommend to download the sample code

I hope this will help you