使用下面的代码,我可以一一处理请求。这是一个异步过程,所以我不需要得到响应。我只是通过请求。
class Program
{
static void Main(string[] args)
{
ProfileRequestData();
}
private static void ProfileRequestData()
{
ProfileRequest.Request[] req = new ProfileRequest.Request[4];
//req.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
req[0] = new ProfileRequest.Request();
req[1] = new ProfileRequest.Request();
req[2] = new ProfileRequest.Request();
req[3] = new ProfileRequest.Request();
req[0].Record = new ProfileRequest.RequestRecord();
req[1].Record = new ProfileRequest.RequestRecord();
req[2].Record = new ProfileRequest.RequestRecord();
req[3].Record = new ProfileRequest.RequestRecord();
req[0].Record.Id = "asdasd123";
req[1].Record.Id = "asdasd456";
req[2].Record.Id = "asdasd789";
req[3].Record.Id = "addjlk123";
ProfileRequest.ProfileRequestClient serviceClient = new ProfileRequest.ProfileRequestClient();
serviceClient.ClientCredentials.UserName.UserName = @"Liberty\nzy0105";
serviceClient.ClientCredentials.UserName.Password = "abcddf";
serviceClient.ProfileRequest(req[0]);
serviceClient.ProfileRequest(req[1]);
serviceClient.ProfileRequest(req[2]);
serviceClient.ProfileRequest(req[3]);
}
}
我想做的是一次处理所有请求,而不是一一处理。
任何人都可以,请提供要求的代码???