本文整理汇总了C#中System.Web.Services.Discovery.DiscoveryClientProtocol.WriteAll方法的典型用法代码示例。如果您正苦于以下问题:C# DiscoveryClientProtocol.WriteAll方法的具体用法?C# DiscoveryClientProtocol.WriteAll怎么用?C# DiscoveryClientProtocol.WriteAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Services.Discovery.DiscoveryClientProtocol
的用法示例。
在下文中一共展示了DiscoveryClientProtocol.WriteAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadWriteTest
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);
}
}
示例2: WriteMetadata
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));
}
}