Dec
07

Schema validation component

by Dan Gershony

In my latest project we had a requirement to validate schemas, In several locations within the process flow schemas needed validation.

Now I know validation can be performed in an xml pipeline, but then again when looking in to the pipeline code using reflection validation happens using an XmlReader against the XSD schema, there are several benefits in writing a custom component.

The XmlReader takes in its constructor an XmlReaderSettings component, the XmlReaderSettings exposes an event we can subscribe to which will trigger if the schema validation fails, This allows to create an ESB fault message(we where using the ESB Exception management portal) without running within a try catch block, which is more preferment. 

The XmlReaderSettings uses the XmlSchemaSet object to store the schemas it will validate against which allows the ability to cache the schemas and thus improve performance. Note that XmlSchemaSet is guaranteed to be thread safe only when used as a static field(singleton), all schemas that need validation must be loaded in to the XmlSchemaSet in the static constructor and thus create a caching effect.

The code is available here SchemaValidation.cs

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Oct
15

Broken project reference

by Dan Gershony

We had a very severe problem recently on our BizTalk environments when building the solution some of the projects lose the reference to other projects in the solution.

We are using BizTalk 2009 Visual studio 2008 SP1 on Windows Server 2008 (SQL Server 2008  though i don't think this has anything to do with the problem)

The references are lost randomly, one moment the solution compiles, or for that mater even when just building a single project, and after a small change (that does not generate an error) the next build VS looses references and can not recognise external components and thus build will fail.

We worked around using file reference and not project reference which seems to respond better but still generates build errors on occasion because of reference loss. 

Another detail which is probably worth mentioning is all BizTalk environments are on VPC’s, don't think this should matter.

 

Searching around we found that this problem was recently raised to Microsoft.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

BizTalk

Oct
15

Debug XSLT Error

by Dan Gershony

Lately I came across an annoying bug when debugging a map in the BizTalk map editor.

I used the Database Lookup Functoid testing the map, using the test map option worked fine.

Taking advantage of this new cool feature provided with BizTalk 2009 to debug the map, when the execution point reached the Database Lookup Functoid the debug step in produced this un unclear error.

Cannot find the script or external object that implements prefix 'http://schemas.microsoft.com/BizTalk/2003/ScriptNS0'.

in the debug trace output the following error showed:

 

XslTransformException
---------------------
Cannot find the script or external object that implements prefix 'http://schemas.microsoft.com/BizTalk/2003/ScriptNS0'.

Not sure about why or how this exception happened.

I started to debug the map (rather then test it first) only to find out some several long hours later that the map was in fact valid, hope this post will save some frustrated BT developer precious time.

Currently rated 2.0 by 2 people

  • Currently 2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

BizTalk

Case Studies

Available Case Studies  from Microsoft.

Contact

Set up a meeting or request a POC