尝试使用该主题上唯一可用的文档来自动化WHQL测试:http://www.microsoft.com/whdc/devtools/wdk/dtm/dtm_dsso.mspx
我已经使用了示例代码,并且能够连接、列出设备等。从那里我创建了一个新项目,一个.NET 2.0 C#类:
using System;
using System.Reflection;
using System.IO;
using CookComputing.XmlRpc;
using Microsoft.DistributedAutomation.DeviceSelection;
using log4net;
class WhqlXmlRpcService : XmlRpcService
{
private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static DeviceScript deviceScript;
[XmlRpcMethod("connect")]
public Boolean Connect(String dtm)
{
Boolean retVal = false;
deviceScript = new DeviceScript();
try
{
deviceScript.ConnectToNamedDataStore(dtm);
retVal = true;
}
catch (Exception e)
{
Log.Debug("Error: " + e.Message);
}
return retVal;
}
}我正在使用XML-RPC.NET创建一个由IIS2.0托管的服务器(使用ASP.NET 2.0)。DTM Studio安装在C:\Inetpub\wwwroot\xmlrpc\bin中,也就是我的类的目标所在的位置,以确保十几个.dll的I引用没有解析问题(按照DSSO文档的说明)。我尝试将必要的DSSO库添加到GAC以避免出现这种情况,但并不是所有的库都有强名称。因此,尽管能够看到它需要链接到的所有库(并且Studio应用程序功能安装在非标准位置很好),尝试.ConnectToNamedDatastore("nameofDTM")仍然会得到以下结果:
xmlrpclib.Fault: <Fault 0: 'Could not connect to the controller to retrieve information. Several issues can cause this error including missing or corrupt files from the installation, running the studio application from a folder other than the install folder, and running an application that accesses the scripting APIs from a folder other than the installation folder.'>我从安装文件夹访问脚本.dll,因为它与我的web服务API位于相同的目录,并且文件没有损坏,因为如果我将一个.exe与DSSO示例代码放在同一个目录中,我可以看到它在调试器中连接得很好。
我对此已经无能为力了,而且在任何地方都找不到一个有用的DTM/DSSO信息来源。
有没有人在过去做过类似的事情,或者成功地自动化了他们的WHQL测试?
发布于 2010-10-28 02:42:30
我无法使用ASP.NET web服务.dll使其工作,但是,我可以通过使用.NET中的HttpListener类使我的XML服务器可用来访问DSSO API。
有关如何将XML-RPC.NET与HttpListener一起使用的示例,请参阅:http://www.cookcomputing.com/blog/archives/000572.html
注意:从上面的链接开始,"ListenerService“已经包含在XML-RPC.NET的最新版本中。它可以在CookComputing.XmlRpc.XmlRpcListenerService下找到
https://stackoverflow.com/questions/4026983
复制相似问题