public void ReadWriteTest ()
		{
			string directory = Path.Combine (Path.GetTempPath (), Path.GetRandomFileName ());
			Directory.CreateDirectory (directory);
			try {
				string url = "http://www.w3schools.com/WebServices/TempConvert.asmx";
				var p1 = new DiscoveryClientProtocol ();
				p1.DiscoverAny (url);
				p1.ResolveAll ();

				p1.WriteAll (directory, "Reference.map");

				var p2 = new DiscoveryClientProtocol ();
				var results = p2.ReadAll (Path.Combine (directory, "Reference.map"));

				Assert.AreEqual (2, results.Count);
				Assert.AreEqual ("TempConvert.disco", results [0].Filename);
				Assert.AreEqual ("TempConvert.wsdl", results [1].Filename);
			} finally {
				Directory.Delete (directory, true);
			}
		}
Ejemplo n.º 2
0
		public DiscoveryClientResultCollection WriteMetadata(string mapFullPath)
		{
			Guard.ArgumentNotNullOrEmptyString(mapFullPath, "mapFullPath");

			using (DiscoveryClientProtocol discovery = new DiscoveryClientProtocol())
			{				
				ResolveDiscovery(discovery, address);
				string directory = Path.GetDirectoryName(mapFullPath);
				if (!Directory.Exists(directory))
				{
					Directory.CreateDirectory(directory);
				}
				return discovery.WriteAll(directory, Path.GetFileName(mapFullPath));
			}
		}