访问 virtualbox web 服务
我想使用 C# 访问 VirtualBox Web 服务。 首先,我使用 wsdl.exe 和 vboxwebService.wsdl 文件创建了一个服务代理。 ' 假设 VirtualBox Web 服务位于: http://localhost:18083/ 如何使用 C# 访问它? 我正在做这样的事情:
EndpointAddress endpoint = new EndpointAddress("http://localhost:18083/");
BasicHttpBinding binding = new BasicHttpBinding();
vboxPortTypeClient client = new vboxPortTypeClient(binding,endpoint);
这工作得很好(我认为):
但是我如何才能获得 virtualbox 的实例版本呢? 我不知道如何使用以下方法:
string test = string.Empty;
client.IVirtualBox_getVersion(test);
I want to access VirtualBox webservice using c#.
Firstly I created a service proxy using wsdl.exe and vboxwebService.wsdl file. '
Assuming that VirtualBox webservice is located in: http://localhost:18083/ how can I access it using c#?
I am doing something like this:
EndpointAddress endpoint = new EndpointAddress("http://localhost:18083/");
BasicHttpBinding binding = new BasicHttpBinding();
vboxPortTypeClient client = new vboxPortTypeClient(binding,endpoint);
and this works fine (I think):
But how then I then can get for instance version of virtualbox?
I don't know how to use the following method:
string test = string.Empty;
client.IVirtualBox_getVersion(test);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经做到了我所期待的
首先,我从两个 wsdl 文件
wsdl.exe 生成了一个新的代理类,然后生成了一个名为 vboxService 的代理类
,然后以下代码执行了我想要的操作:
请注意,为了简单起见,我现在禁用了身份验证 - 这就是我传递空字符串的原因到 IWebessionManager_logon 方法
I've managed to do what I was expecting
First of all I generated a new proxy class from two wsdl files
wsdl.exe then generated a proxy class named vboxService
then the following code does what I want:
Please note that for simplicity I disabled authentication for now - this is why I pass empty strings to IWebessionManager_logon method
对于那些像我一样从 google 来到这里但对知识知之甚少的人来说,vboxService.wsdl 和 vboxweb.wsdl 是随 Virtualbox SDK。只需下载并解压文件,您将在 sdk/bindings/webservice 下找到它们。
To those who ended up here from google with very little knowledge like me, vboxService.wsdl and vboxweb.wsdl are provided with the Virtualbox SDK. Just download it and extract the files, you'll find them under sdk/bindings/webservice.