Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
956 B

  1. using System;
  2. using System.IO;
  3. using UDDI.Diagnostics;
  4. class UDDIValidate
  5. {
  6. static void Main(string[] args)
  7. {
  8. if( args.Length < 1 )
  9. {
  10. usage();
  11. return;
  12. }
  13. try
  14. {
  15. Debug.Verify(
  16. File.Exists( args[ 0 ] ),
  17. "UDDI_ERROR_FATALERROR_TOOLS_VALIDATE_MISSIGFILE",
  18. UDDI.ErrorType.E_fatalError,
  19. args[ 0 ]
  20. );
  21. Console.WriteLine( "Validating {0}...", args[0] );
  22. UDDI.SchemaCollection.ValidateFile( args[0] );
  23. Console.WriteLine( "{0} successfully validated", args[ 0 ] );
  24. }
  25. catch( Exception e )
  26. {
  27. Console.WriteLine( "Exception: {0}", e.ToString() );
  28. }
  29. return;
  30. }
  31. public static void usage()
  32. {
  33. Console.WriteLine("Attempts to validate an XML file against the UDDI schema");
  34. Console.WriteLine("\r\nUsage:");
  35. Console.WriteLine("\r\nvalidate InputFile");
  36. Console.WriteLine("\r\nExamples:");
  37. Console.WriteLine("\r\nvalidate c:\\somefile.xml");
  38. }
  39. }