locked
Schema element Boolean type oddity. RRS feed

  • Question

  • Ok this ones driving me nuts! I have a Schema in a BizTalk project that contains an element which is a boolean type, Optional and has a Default Value of "true". I have exposed the schema as a web service and created the necessary receive location (SoapAdapter) to accept messages into Biztalk to a subscribing orchestration. The orchestrations recieve port accepts messages of this schema's type.

    Now, the wakky thing is that if the test message contains the value "true" in the element it is missing when it gets to the orchestration. If the message has a value of "false" the element is present.

    Whats going on?????

    Help.
    Wednesday, August 27, 2008 10:05 AM

Answers

  • I actually think this is the behavior of Xml Schema rather than BizTalk. I think the default in the Xml schema is minOccurs=0, so if the tag is not there then the Xml still validates with the Xml schema. I also think the approach with Xml schema is to reduce the amount of Xml necessary and still validate successfully so that a smaller payload of Xml is required for passing over the wire, etc. It is definitely an oddity or peculiarity, I agree.

     

    Thanks,

    Thursday, August 28, 2008 2:46 AM
    Moderator

All replies

  • So when the value is true it understands that because the schema has this default value it does not need to express it in the message. You could set minOccurs=1 for the field so it is always there.

     

    Thanks,

    Wednesday, August 27, 2008 12:31 PM
    Moderator
  • Thanks,

    That did the trick but still doesnt explain why, when the element is present with a value of true in the test message it is removed by bizTalk!

     

    Jody

     

    Wednesday, August 27, 2008 10:46 PM
  • I actually think this is the behavior of Xml Schema rather than BizTalk. I think the default in the Xml schema is minOccurs=0, so if the tag is not there then the Xml still validates with the Xml schema. I also think the approach with Xml schema is to reduce the amount of Xml necessary and still validate successfully so that a smaller payload of Xml is required for passing over the wire, etc. It is definitely an oddity or peculiarity, I agree.

     

    Thanks,

    Thursday, August 28, 2008 2:46 AM
    Moderator