SchemaValidator
You use the SchemaValidator utility to troubleshoot problems with a message instance. If you receive a message that fails validation, you can run the SchemaValidator utility to determine the source of the failure.
You use this utility if you are using an assembly that includes a schema .dll file, and you do not have a schema .xsd file. The SchemaValidator utility lets you validate using the schema .dll file.
Location in SDK
<drive>\Program Files (x86)\Microsoft BizTalk <version> Accelerator for RosettaNet\SDK\SchemaValidator
Building and Running SchemaValidator
To build the SchemaValidator utility
Open a command prompt.
Move to <drive>\Program Files (x86)\Microsoft BizTalk <version> Accelerator for RosettaNet\SDK\SchemaValidator.
At the command prompt, type sn -k SchemaValidator.snk, and then press ENTER.
Start Microsoft Visual Studio 2012.
On the File menu, point to Open, and then click Open Solution.
Move to <drive>\Program Files (x86)\Microsoft BizTalk <version> Accelerator for RosettaNet\SDK\SchemaValidator, select SchemaValidator.sln, and then click Open.
In Solution Explorer, right-click SchemaValidator, and then click Properties.
In the MessageInspector Property page, click Signing tab, and then click Sign the assembly checkbox. Select SchemaValidator.snk in Choose a strong name key file.
Click SchemaValidator.cs.
Type the appropriate message instance path in the following existing line of code in
Main
:const string xmlInstancePath = @"..\..\Sample3A4.xml";
Replace the following existing line of code in
Main
with a reference to the RNPIPs assembly, and then select the appropriate schema:_3A4_MS_V02_02_PurchaseOrderRequest BTSSchema = new _3A4_MS_V02_02_PurchaseOrderRequest();
Right-click SchemaValidator, and then click Build.
Modify the message instance to you want to test by removing the <!DOCTYPE …> tag specifying the DTD file from the header of the XML instance.
In the root node of the message instance, add an XML namespace of the schema that you will validate against.
Note
For an example of a schema ready to be validated by the SchemaValidator utility, see Sample3A4.xml in <drive>\Program Files (x86)\Microsoft BizTalk <version> Accelerator for RosettaNet\SDK\SchemaValidator.
In Visual Studio, click SchemaValidator.cs, and then press CTRL and F5 to run the utility.
Remarks
Because the BTARN SDK includes the SchemaValidator code, you can add logic to the utility. For example, you can make it a command-line utility.