小编use*_*084的帖子

如何使用REST API提交代理消息

根据MSDN,可以通过REST API提交Brokered Message,这个代理消息可以将Properties键值对作为消息的一部分.我已经能够提交Brokered消息,但是当我收到消息时,消息中的Properties字段不会被填充.我必须错误地编码Properties JSON.

这是代码片段

        WebClient webClient = new WebClient();
        webClient.Headers[HttpRequestHeader.Authorization] = _token;
        webClient.Headers["Content-Type"] = "application/atom+xml;type=entry;charset=utf-8";
        Guid messageId = Guid.NewGuid();
        webClient.Headers["BrokerProperties"] = @"{""MessageId"": ""{" + messageId.ToString("N") + @"}"", ""TimeToLive"" : 900, ""Properties"": [{""Key"" : ""ProjectId"", ""Value"" : """ + message.ProjectId + @"""}]}";

        // Serialize the message
        MemoryStream ms = new MemoryStream();
        DataContractSerializer ser = new DataContractSerializer(typeof(RespondentCommitMessage));
        ser.WriteObject(ms, message);
        byte[] array = ms.ToArray();
        ms.Close();

        byte[] response = webClient.UploadData(fullAddress, "POST", array);
        string responseStr = Encoding.UTF8.GetString(response);
Run Code Online (Sandbox Code Playgroud)

有没有人有使用BrokerProperties HTTP标头提交BrokeredMessage的示例?

servicebus azure

6
推荐指数
1
解决办法
2542
查看次数

为什么get-process -computername返回a无法连接到远程机器错误?

我可以在特定的计算机上执行以下命令,它可以返回多个目标计算机上的进程列表,但在一台计算机上返回"无法连接到远程计算机"错误.

get-process -ComputerName 192.168.1.101

  • 没有目标计算机安装了PowerShell.
  • 我正在执行powershell脚本的机器已安装2.0.
  • 我在所有机器上都有管理员权限.
  • 能够远程返回进程列表的目标计算机是带有SP 1的server 2003 Standard Edition.
  • 未远程返回进程列表的目标计算机是server 2003 R2 Standard Edition SP2.

什么会阻止我使用PowerShell从远程计算机获取进程列表?

powershell powershell-2.0 powershell-remoting

2
推荐指数
1
解决办法
1万
查看次数