exportLibraryStructure 接口用于将库、文件夹和共享步骤对象导出为 XML 文件。下表显示了 exportLibraryStructure 接口的参数。
| 接口 URL | 参数 | 说明 | 
|---|---|---|
| http://<front-end URL>/servicesExchange?hid=exportLibraryStructure | sid | 用于用户身份验证的 Web 服务令牌或会话标识符。您可以在 Silk Central UI 的设置页面中生成 Web 服务令牌。要访问此页面,请将鼠标光标悬停在 Silk Central 菜单中的用户名上,然后选择用户设置。您可以通过调用可用 Web 服务之一的 logonUser 方法来检索会话标识符。 | 
| nodeID | 要导出的库树中的库节点或文件夹。不允许共享步骤节点的 ID。 | 
示例:http://<front-end URL>/servicesExchange?hid=exportLibraryStructure&sid=<webServiceToken>&nodeID=<id>
以下代码使用 Apache HttpClient 来导出库。
import org.apache.commons.httpclient.*; // Apache HttpClient
String webServiceToken = "e39a0b5b-45db-42db-84b2-b85028d954d5";
URL service = new URL("http", mWebServiceHelper.getHost(),
  mWebServiceHelper.getPort(), String.format("/servicesExchange?hid=%s&sid=%s&nodeID=%d",
  "exportLibraryStructure", webServiceToken, NODE_ID));
	
HttpClient client = new HttpClient();
client.getHttpConnectionManager().getParams().setConnectionTimeout(60000);
HttpMethod fileGet = new GetMethod(service.toExternalForm());
int status = client.executeMethod(fileGet);
System.out.println(fileGet.getStatusLine());
String exportedTestPlanResponse = fileGet.getResponseBodyAsString();
System.out.println(exportedTestPlanResponse); 
               		要下载 Apache HttpComponents,请访问 http://hc.apache.org/downloads.cgi。请参阅组件文档,了解所需的库。