XSD Restrictions (maxLength) not working.

Home Page Forums BizTalk 2004 – BizTalk 2010 XSD Restrictions (maxLength) not working.

Viewing 1 reply thread
  • Author
    • #15093

      Nope, the map doesn’t do any validation.

      There are a few ways to do this. You can enable validation inside the Orchestration using the config file (look for schema validation inside the help guide). Not sure if this will do true validation though.

      The pipeline validation component will check for these types of problems.

      You can also call a .net component inside the Orchestration after the map.

      Another way is to code your map to support this but trimming the field.

      I’d probably try to code my maps to handle that case. But it depends on your exact requirements.

    • #15094

      I see an other solution!
      On mapping feed a scripting functoid with the field. then you can see if the stringlenght is lower than 10 (with C# code), if it is.. returns the string if it’s not, return \”Error\” or whatever!

      • #15095

        The map wont do validation but the pipeline should. I recall that this would through a messaging error into the msgbox.

        now when you test, it may not throw an error if you have output validation turned off… go to the .btm file in your solution and go to properties, (where you would specify the test instance file and type) and make sure that you have output validation turned on…. BUT it may still output a file with the faulty data but will have an error in our output box in VS.

        go ahead and deploy your solution and give it a shot… i may be totally off.

        • #15096

          Hello and thanks for any assistance.

          I have a schema with an Attribute defined as such:

          <xs:attribute name=\”FirstName\”>
          <xs:simpleType final=\”restriction\”>
          <xs:restriction base=\”xs:string\”>
          <xs:maxLength value=\”10\” />

          When i use biztalk map to map another schema to the schema with the above defined attribute (maxLength=10), if the length is greater then 10 NO error is generated and the value will be transformed over into the schema.

          So in other words it’s like no validation occurs and any value can be mapped into the field regardless of size.

          What gives? Why would this be allowed, am I missing something? Has anyone run into something like this before?

          — Steven

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.