本文整理汇总了C#中RequestMessage类的典型用法代码示例。如果您正苦于以下问题:C# RequestMessage类的具体用法?C# RequestMessage怎么用?C# RequestMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RequestMessage类属于命名空间,在下文中一共展示了RequestMessage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: HandleRequest
protected override void HandleRequest(RequestMessage request, PeerState peer)
{
if (!peer.IsChoked && request.Length <= Global.Instance.BlockSize)
{
BlockManager.GetBlock(new byte[request.Length], request.Index, request.Offset, request.Length, BlockRead, peer);
}
}
开发者ID:NewFuture,项目名称:BitTorrent,代码行数:7,代码来源:SeedMode.cs
示例2: call_NSPRFSH01
public void call_NSPRFSH01()
{
string errortxt = this.Vaildate();
if (errortxt != string.Empty)
{
MessageBox.Show(errortxt);
this.focusControl.Focus();
return;
}
string[] tmp = this.toid.Text.Split(new char[] { ' ' });
string toidstr = tmp[0];
sh01_req.Utility sh01req = sh01_req.Utility.CreateSH(toidstr);
sh01req.UtilityHeader.userid = this.LoginUser.UserName;
RequestMessage requestmessage = new RequestMessage(enumRequestType.MessageProcessor,
enumMessageType.Utility,
enumRequestMethod.functionOperation, this.LoginUser,
enumSendSysId.EXceed,
sh01req);
ResponseMessage response = ThreadHelper.Execute(requestmessage);
string errormsg = response.GetErrorMessage();
if (errormsg != string.Empty)
{
MessageBox.Show(response.GetErrorMessage());
}
else
{
MessageBox.Show("发运完成");
}
}
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:32,代码来源:NSPRFSH01Frm_2.cs
示例3: loadReason
private void loadReason()
{
RFDeviceAPP.Common.TaskReason.Request.TaskReason request = RFDeviceAPP.Common.TaskReason.Request.TaskReason.Craete(this.LoginUser.UserName);
RequestMessage requestmessage = new RequestMessage(enumRequestType.MessageProcessor,
enumMessageType.TaskReason,
enumRequestMethod.list, this.LoginUser,
enumSendSysId.EXceed,
request);
RequestWorkItem workitem = new RequestWorkItem(requestmessage, 1);
//threadhelper.AddWorkItem(workitem);
ResponseMessage Response = ThreadHelper.Execute(requestmessage);
string errormsg = Response.GetErrorMessage();
if (errormsg != string.Empty)
{
MessageBox.Show(errormsg);
}
else
{
RFDeviceAPP.Common.TaskReason.Response.TaskReason tasklist = Response.Deserialize<RFDeviceAPP.Common.TaskReason.Response.TaskReason>();
foreach (RFDeviceAPP.Common.TaskReason.Response.TaskReasonHeader header in tasklist.TaskReasonHeaders)
{
string line = header.TASKMANAGERREASONKEY;
this.listBox1.Items.Add(line);
}
this.listBox1.SelectedIndex = 0;
}
}
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:29,代码来源:Frmreason.cs
示例4: submitMove
public void submitMove(string sku, string fromloc, string fromid, string toid, string qty, string actloc)
{
string errortxt = this.Vaildate();
if (errortxt != string.Empty)
{
MessageBox.Show(errortxt);
this.focusControl.Focus();
return;
}
reqitem = req.Utility.Create( sku, fromloc, fromid, toid, qty, actloc);
reqitem.UtilityHeader.userid = this.loginuser.UserName;
RequestMessage request = new RequestMessage(enumRequestType.MessageProcessor,
enumMessageType.Utility,
enumRequestMethod.functionOperation, this.loginuser,
enumSendSysId.EXceed,
reqitem);
//RequestWorkItem workitem = new RequestWorkItem(request, 1);
ResponseMessage response = ThreadHelper.Execute(request);
string errormsg = response.GetErrorMessage();
if (errormsg != string.Empty)
{
MessageBox.Show(response.GetErrorMessage());
}
else
{
MessageBox.Show("移动完成");
Clean();
}
}
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:30,代码来源:NSPRFRL01B1FLFrm.cs
示例5: ExchangeAsClient
public ResponseMessage ExchangeAsClient(RequestMessage request)
{
PrepareExchangeAsClient();
stream.Send(request);
return stream.Receive<ResponseMessage>();
}
开发者ID:BradBarnich,项目名称:Halibut,代码行数:7,代码来源:MessageExchangeProtocol.cs
示例6: call_NSPRFIQ01
private void call_NSPRFIQ01()
{
this.request.UtilityHeader.userid = this.LoginUser.UserName;
RequestMessage query = new RequestMessage(enumRequestType.MessageProcessor,
enumMessageType.Utility,
enumRequestMethod.functionOperation, this.LoginUser,
enumSendSysId.EXceed,
this.request);
ResponseMessage response = ThreadHelper.Execute(query);
string errormsg = response.GetErrorMessage();
if (errormsg != string.Empty)
{
MessageBox.Show(response.GetErrorMessage());
}
else
{
RFDeviceAPP.Common.NSPRFIQ01.Response.Utility result = response.Deserialize<RFDeviceAPP.Common.NSPRFIQ01.Response.Utility>();
//Console.Write(result);
//FrmStockResult resultfrm = new FrmStockResult(result);
FrmStockResultDetail resultfrm = new FrmStockResultDetail(result);
resultfrm.ShowDialog();
this.Activate();
this.storerkey.SetFocus();
}
}
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:26,代码来源:FrmStockQuery.cs
示例7: SecureClientClearsPoolWhenAllConnectionsCorrupt
public void SecureClientClearsPoolWhenAllConnectionsCorrupt()
{
var pool = new ConnectionPool<ServiceEndPoint, IConnection>();
var stream = Substitute.For<IMessageExchangeStream>();
stream.When(x => x.IdentifyAsClient()).Do(x => { throw new ConnectionInitializationFailedException(""); });
for (int i = 0; i < SecureClient.RetryCountLimit; i++)
{
var connection = Substitute.For<IConnection>();
connection.Protocol.Returns(new MessageExchangeProtocol(stream));
pool.Return(endpoint, connection);
}
var request = new RequestMessage
{
Destination = endpoint,
ServiceName = "IEchoService",
MethodName = "SayHello",
Params = new object[] { "Fred" }
};
var secureClient = new SecureClient(endpoint, Certificates.Octopus, log, pool);
ResponseMessage response = null;
secureClient.ExecuteTransaction((mep) => response = mep.ExchangeAsClient(request));
// The pool should be cleared after the second failure
stream.Received(2).IdentifyAsClient();
// And a new valid connection should then be made
Assert.AreEqual("Fred...", response.Result);
}
开发者ID:BradBarnich,项目名称:Halibut,代码行数:29,代码来源:SecureClientFixture.cs
示例8: call_UserData
private void call_UserData(string username, string password)
{
userinforeq = fllg_req.Utility.Create(username, password);
RequestMessage searchrequest = new RequestMessage(enumRequestType.MessageProcessor,
enumMessageType.Utility,
enumRequestMethod.functionOperation, this._user,
enumSendSysId.EXceed,
userinforeq);
RequestWorkItem workitem = new RequestWorkItem(searchrequest, 1);
//threadhelper.AddWorkItem(workitem);
ResponseMessage Response = ThreadHelper.Execute(searchrequest);
if (Response.GetErrorMessage() != string.Empty)
{
MessageBox.Show(Response.GetErrorMessage());
this.usernametxt.Focus();
}
else
{
this.userinfores = Response.Deserialize<fllg_res.Utility>();
if (this._user.UserName == string.Empty)
{
MessageBox.Show("用户名不存在");
this.usernametxt.Focus();
}
else
{
this.screen = this.userinfores.UtilityHeader[0].Screen.Split(new char[] { ';' });
//InvokeHelper.Set(this, "DialogResult", DialogResult.OK);
DialogResult = DialogResult.OK;
}
}
}
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:33,代码来源:Login.cs
示例9: OnNewUpdate
private void OnNewUpdate(
IRequestManager<ConfigurationUpdate, ConfigurationUpdateAnswer> sender,
RequestMessage<ConfigurationUpdate> request)
{
var newConfiguration = request.request.update;
//Not the most efficient code, but premature optimisation is root of evil.
lock (internalLock)
{
var existing = allConfigurations.FirstOrDefault(o =>
o.Instance == newConfiguration.Instance &&
o.Key == newConfiguration.Key
);
if (existing != null)
{
existing.Value = newConfiguration.Value;
}
else
{
allConfigurations.Add(newConfiguration);
}
}
this.persister.Persist(allConfigurations);
//Todo here broadcast the update?
sender.Send(new AnwserMessage<ConfigurationUpdateAnswer>()
{
id = request.id,
answer = new ConfigurationUpdateAnswer()
{
result = true
}
});
}
开发者ID:Paraintom,项目名称:ConfigurationService,代码行数:32,代码来源:ConfigurationRequestHandler.cs
示例10: call_asnlist01
public void call_asnlist01(string pier)
{
//this.Start();
//this.portlist.Items.Clear();
//this.portlist.Enabled = false;
asnlist01req = asnlist01_req.AdvancedShipNotice.Create(pier);
RequestMessage request = new RequestMessage(enumRequestType.MessageProcessor,
enumMessageType.AdvancedShipNotice,
enumRequestMethod.listHead, this.loginuser,
enumSendSysId.EXceed,
asnlist01req);
//RequestWorkItem workitem = new RequestWorkItem(request, 2);
//threadhelper.AddWorkItem(workitem);
ResponseMessage Response = ThreadHelper.Execute(request);
string errormsg = Response.GetErrorMessage();
if (errormsg != string.Empty)
{
MessageBox.Show(Response.GetErrorMessage());
}
else
{
asnlist01res = Response.Deserialize<asnlist01_res.AdvancedShipNotice>();
foreach (asnlist01_res.AdvancedShipNoticeHeader body in asnlist01res.AdvancedShipNoticeHeaders)
{
if (!string.IsNullOrEmpty(body.ReceiptKey))
{
this.addasnlist(body.ReceiptKey + " " + body.StorerKey + " " + body.Status);
}
//InvokeHelper.Invoke(this, "addasnlist", body.ReceiptKey + " " + body.StorerKey + " " + body.Status);
}
}
}
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:33,代码来源:LeaveFrm.cs
示例11: RawRequestMessage
public RawRequestMessage(RequestMessage rm, int commandCount)
{
var prefix = (rm.Prefix ?? "");
Id = prefix + (prefix.Length>0?"_":"") + commandCount;
Type = rm.Type??"request";
Uri = rm.Uri;
Payload = rm.Payload;
}
开发者ID:gr4b4z,项目名称:lgtv.net,代码行数:8,代码来源:RawRequestMessage.cs
示例12: GetRequestMessage
private static RequestMessage<ConfigurationSubscription> GetRequestMessage(int requestId, string goodInstance)
{
var request = new RequestMessage<ConfigurationSubscription>()
{
id = requestId,
request = new ConfigurationSubscription() {instance = goodInstance}
};
return request;
}
开发者ID:Paraintom,项目名称:ConfigurationService,代码行数:9,代码来源:ConfigurationRequestHandlerTests.cs
示例13: Execute
public override ResponseMessage Execute (RequestMessage req)
{
// Start the shutdown process in a separate thread
// to avoid a deadlock: BeginShutdown() waits until
// all worker process are finished, but this method
// itself is part of a worker.
ExceptionHandlingThread.Start (new ThreadStart (DoShutdown));
return new EmptyResponse ();
}
开发者ID:zweib730,项目名称:beagrep,代码行数:10,代码来源:RemoteControlExecutors.cs
示例14: InvokeAndWrapAnyExceptions
static ResponseMessage InvokeAndWrapAnyExceptions(RequestMessage request, Func<RequestMessage, ResponseMessage> incomingRequestProcessor)
{
try
{
return incomingRequestProcessor(request);
}
catch (Exception ex)
{
return ResponseMessage.FromException(request, ex);
}
}
开发者ID:BradBarnich,项目名称:Halibut,代码行数:11,代码来源:MessageExchangeProtocol.cs
示例15: Publish
public override void Publish(RequestMessage request)
{
try
{
Write(request);
}
catch (Exception e)
{
OnChannelError(e);
}
}
开发者ID:onesimoh,项目名称:Andamio,代码行数:11,代码来源:FileSystemChannel.cs
示例16:
void IMessageSink.Invoke(RequestMessage request)
{
if (request == null) throw new ArgumentNullException("request");
DistributedMessaging messaging = DistributedMessaging.Instance;
Action<RequestMessage> eventHandler = messaging.Handlers.Outgoing.Request(request.Event);
if (eventHandler != null)
{
eventHandler.DynamicInvoke(request);
}
}
开发者ID:onesimoh,项目名称:Andamio,代码行数:11,代码来源:OutboundEventHandlingSink.cs
示例17: CreateRequest
protected static Cybersource.RequestMessage CreateRequest()
{
RequestMessage request = new RequestMessage();
request.clientLibrary = ".NET WCF";
request.clientLibraryVersion = Environment.Version.ToString();
request.clientEnvironment =
Environment.OSVersion.Platform +
Environment.OSVersion.Version.ToString();
return request;
}
开发者ID:ksrchen,项目名称:ps,代码行数:12,代码来源:CybersourceServiceBase.cs
示例18: Execute
public override ResponseMessage Execute (RequestMessage req)
{
this.info_request = (InformationalMessagesRequest) req;
if (QueryDriver.IsIndexing)
SendIndexingStatusResponse (IndexingStatus.Running);
QueryDriver.ChangedEvent += OnQueryDriverChanged;
// Don't send a response; we'll be sending them async.
return null;
}
开发者ID:zweib730,项目名称:beagrep,代码行数:12,代码来源:InformationalMessagesRequestExecutor.cs
示例19: Simple
async Task Simple(EndpointConfiguration endpointConfiguration, IEndpointInstance endpoint, SendOptions sendOptions)
{
#region 5to6-Callbacks-InstanceId
endpointConfiguration.ScaleOut().InstanceDiscriminator("uniqueId");
#endregion
#region 5to6-Callbacks
RequestMessage message = new RequestMessage();
ResponseMessage response = await endpoint.Request<ResponseMessage>(message, sendOptions);
#endregion
}
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:13,代码来源:Callbacks.cs
示例20: Call_NSPRFQUERYBYDROPID
public void Call_NSPRFQUERYBYDROPID(string dropid)
{
RFDeviceAPP.Common.NSPRFQUERYBYDROPID.Request.Utility req = RFDeviceAPP.Common.NSPRFQUERYBYDROPID.Request.Utility.Create(dropid);
RequestMessage request = new RequestMessage(enumRequestType.MessageProcessor,
enumMessageType.Utility,
enumRequestMethod.functionOperation, this.LoginUser,
enumSendSysId.EXceed,
req);
ResponseMessage response = ThreadHelper.Execute(request);
string xmls = response.XmlString;
RFDeviceAPP.Common.NSPRFQUERYBYDROPID.Response.Utility result = response.Deserialize<RFDeviceAPP.Common.NSPRFQUERYBYDROPID.Response.Utility>();
string errormsg = response.GetErrorMessage();
if (errormsg != string.Empty)
{
MessageBox.Show(response.GetErrorMessage());
}
else
{
this.wavekeytxt.Text = result.UtilityHeader.WaveKey;
this.orderkeytxt.Text = result.UtilityHeader.OrderKey;
if (!this.orderkeytxt.Text.Equals(""))
{
ShipmentOrder spod = ShipmentOrder.CreatePOD(this.orderkeytxt.Text);
RequestMessage searchrequest = new RequestMessage(enumRequestType.MessageProcessor,
enumMessageType.ShipmentOrder,
enumRequestMethod.list, this.LoginUser,
enumSendSysId.EXceed,
spod);
ResponseMessage response1 = ThreadHelper.Execute(searchrequest);
if (response1.GetErrorMessage() != string.Empty)
{
MessageBox.Show(response1.GetErrorMessage());
this.dropidtxt.Focus();
}
else
{
RFDeviceAPP.Common.Orders.ShipmentOrder result1 = response1.Deserialize<RFDeviceAPP.Common.Orders.ShipmentOrder>();
this.susr15.Text = result1.ShipmentOrderHeader.SUSR15;
}
}
if (result.UtilityHeader.ISFULLPICKED == "0" && result.UtilityHeader.OrderKey.Length > 0)
{
MessageBox.Show("该订单拣货完成");
this.dropidtxt.SetFocus();
}
}
}
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:50,代码来源:NSPRFQUERYBYDROPIDForm.cs
注:本文中的RequestMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论