我有一个基于从这里获取的代码的 TestClient 应用程序。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security;
using System.Net;
using ServiceStack.Common.Web;
using ServiceStack.Logging;
using ServiceStack.ServiceHost;
using ServiceStack.ServiceInterface;
namespace TestClient
{
class Program
{
static void Main(string[] args)
{
try
{
var client = new JsonServiceClient(); // missing assembly reference
client.LocalHttpWebRequestFilter +=
delegate(HttpWebRequest request)
{
// ContentType still null at this point so we must hard code it
request.ContentType = ServiceStack.Common.Web.ContentType.Json;
request.Date = DateTime.Now;
var secret = "5771CC06-B86D-41A6-AB39-9CA2BA338E27";
var token = ApiSignature.CreateToken(request, secret);
request.Headers.Add(ApiCustomHttpHeaders.UserId, "1");
request.Headers.Add(ApiCustomHttpHeaders.Signature, token);
};
var teams = client.Get<List<Team>>("http://localhost:59833/api/teams");
foreach (var team in teams)
{
Label1.Text += team.Name + "<br>";
}
}
catch (WebServiceException ex) // missing assembly reference
{
Label1.Text = ex.Message + " : " + ex.ResponseBody;
}
}
}
}
我似乎缺少以下程序集参考:
JsonServiceClient
WebServiceException
谁能告诉我在哪里可以获得这些 DLL 以便我可以完成构建?