Share via


DiscoveryClientProtocol.WriteAll(String, String) 메서드

정의

Documents 속성에 있는 모든 검색 문서, XSD(XML Schema Definition) 스키마 및 서비스 설명을 제공된 디렉터리에 쓰고 이 디렉터리에 파일을 만듭니다.

public:
 System::Web::Services::Discovery::DiscoveryClientResultCollection ^ WriteAll(System::String ^ directory, System::String ^ topLevelFilename);
public System.Web.Services.Discovery.DiscoveryClientResultCollection WriteAll (string directory, string topLevelFilename);
member this.WriteAll : string * string -> System.Web.Services.Discovery.DiscoveryClientResultCollection
Public Function WriteAll (directory As String, topLevelFilename As String) As DiscoveryClientResultCollection

매개 변수

directory
String

현재 Documents 속성에 있는 모든 문서를 저장할 디렉터리입니다.

topLevelFilename
String

만들거나 덮어쓸 파일의 이름으로, 저장된 모든 문서의 맵을 포함합니다.

반환

DiscoveryClientResultCollection

저장된 모든 파일의 결과를 포함하는 DiscoveryClientResultCollection입니다.

예제

다음 코드 예제는 호출 DiscoverAny 후 메서드를 호출하여 WriteAll 웹 서비스 검색 결과를 디스크에 쓰는 웹 양식입니다ResolveAll.

 protected void Discover_Click(object Source, EventArgs e)
 {
  // Specify the URL to discover.
  string sourceUrl = DiscoURL.Text;
  // Specify the URL to save discovery results to or read from.
  string outputDirectory = DiscoDir.Text;

      DiscoveryClientProtocol client = new DiscoveryClientProtocol();
  // Use default credentials to access the URL being discovered.
      client.Credentials = CredentialCache.DefaultCredentials;

      try 
      {
        DiscoveryDocument doc;
        
        // Discover the URL for any discoverable documents. 
    doc = client.DiscoverAny(sourceUrl);
   
        // Resolve all possible references from the supplied URL.
        client.ResolveAll();
      }
      catch ( Exception e2) 
      {
        DiscoveryResultsGrid.Columns.Clear();
        Status.Text = e2.Message;
      }

  // Save the discovery results to disk.
      DiscoveryClientResultCollection results = client.WriteAll(outputDirectory, "results.discomap");
      Status.Text = "The following file holds the links to each of the discovery results: <b>" + 
                                  Path.Combine(outputDirectory,"results.discomap") + "</b>";
}
Public Sub Discover_Click(Source As Object, e as EventArgs )
   ' Specify the URL to discover.
   Dim sourceUrl as String = DiscoURL.Text
   ' Specify the URL to save discovery results to or read from.
   Dim outputDirectory As String = DiscoDir.Text

   Dim client as DiscoveryClientProtocol = new DiscoveryClientProtocol()
   ' Use default credentials to access the URL being discovered.
   client.Credentials = CredentialCache.DefaultCredentials
   Try 
     Dim doc As DiscoveryDocument
     ' Discover the URL for any discoverable documents. 
     doc = client.DiscoverAny(sourceUrl)

 ' Resolve all possible references from the supplied URL.
     client.ResolveAll()
           
    Catch e2 As Exception
       DiscoveryResultsGrid.Columns.Clear()
       Status.Text = e2.Message
    End Try

    ' Save the discovery results to disk.	    
    Dim results As DiscoveryClientResultCollection 
    results = client.WriteAll(outputDirectory, "results.discomap")
    Status.Text = "The following file holds the links to each of the discovery results: <b>" + _ 
                                  Path.Combine(outputDirectory,"results.discomap") + "</b>"
   End Sub

설명

디렉터리 매개 변수에서 지정한 디렉터리의 매개 변수 이름으로 topLevelFilename 만든 파일에는 저장된 검색 문서 맵, XSD(XML 스키마 정의) 스키마 및 서비스 설명이 포함되어 있습니다. 이 파일은 메서드를 ReadAll 사용하여 및 Documents 속성을 채우는 References 데 사용할 수 있습니다. 파일 형식은 클래스의 직렬화된 버전을 포함하는 XML입니다 DiscoveryClientProtocol.DiscoveryClientResultsFile .

매개 변수의 매개 변수와 이름이 topLevelFilename 같은 파일이 있는 directory 경우 해당 파일은 메서드에 WriteAll 의해 덮어씁니다. topLevelFilename 파일이 현재 디렉터리에 없는 경우 매개 변수에 정규화된 경로를 포함해야 합니다.

적용 대상

추가 정보