Powershell和WCF服务的奇怪之处

时间:2019-02-08 10:21:30

标签: powershell wcf

从Powershell脚本调用WCF服务方法时,我注意到了一种奇怪的情况。 我已经用一种方法实现了基本服务,如下所示:

 public int receive_data(string machine_name, string ad_site, string user_name,string version)
    {  //do some stuff in here  }

此方法采用4个参数,如图所示。

但是,当在powershell中创建此服务的对象并进行| GM显示时,会看到以下内容:

receive_data                         Method     void receive_data(string machine_name, string ad_site, string user_name, string version, [ref] int receive_dataResult, [ref] bool receive_d...

这表明还需要其他2个[Ref]参数。没有这两个额外的参数,powershell将不会提交。

我的问题是参数是什么?为什么需要它们,却不反对服务出现?

0 个答案:

没有答案
相关问题