本文整理汇总了C#中ProcessRequestAsyncResult.BeginProcessRequest方法的典型用法代码示例。如果您正苦于以下问题:C# ProcessRequestAsyncResult.BeginProcessRequest方法的具体用法?C# ProcessRequestAsyncResult.BeginProcessRequest怎么用?C# ProcessRequestAsyncResult.BeginProcessRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProcessRequestAsyncResult
的用法示例。
在下文中一共展示了ProcessRequestAsyncResult.BeginProcessRequest方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginProcessRequest
/// <summary>
/// Begins processing a request received via a binary encoded channel.
/// </summary>
/// <param name="channeId">A unique identifier for the secure channel which is the source of the request.</param>
/// <param name="endpointDescription">The description of the endpoint which the secure channel is using.</param>
/// <param name="request">The incoming request.</param>
/// <param name="callback">The callback.</param>
/// <param name="callbackData">The callback data.</param>
/// <returns>
/// The result which must be passed to the EndProcessRequest method.
/// </returns>
/// <seealso cref="EndProcessRequest"/>
/// <seealso cref="ITransportListener"/>
public IAsyncResult BeginProcessRequest(
string channeId,
EndpointDescription endpointDescription,
IServiceRequest request,
AsyncCallback callback,
object callbackData)
{
if (channeId == null) throw new ArgumentNullException("channeId");
if (request == null) throw new ArgumentNullException("request");
// create operation.
ProcessRequestAsyncResult result = new ProcessRequestAsyncResult(this, callback, callbackData, 0);
SecureChannelContext context = new SecureChannelContext(
channeId,
endpointDescription,
RequestEncoding.Binary);
// begin invoke service.
return result.BeginProcessRequest(context, request);
}
示例2: BeginDeleteReferences
/// <summary>
/// Asynchronously calls the DeleteReferences service.
/// </summary>
public virtual IAsyncResult BeginDeleteReferences(DeleteReferencesMessage message, AsyncCallback callback, object callbackData)
{
try
{
// check for bad data.
if (message == null) throw new ArgumentNullException("message");
// set the request context.
SetRequestContext(RequestEncoding.Xml);
// create handler.
ProcessRequestAsyncResult result = new ProcessRequestAsyncResult(this, callback, callbackData, 0);
return result.BeginProcessRequest(SecureChannelContext.Current, message.DeleteReferencesRequest);
}
catch (Exception e)
{
throw CreateSoapFault(message.DeleteReferencesRequest, e);
}
}
示例3: BeginInvokeService
/// <summary>
/// Dispatches an incoming binary encoded request.
/// </summary>
public virtual IAsyncResult BeginInvokeService(InvokeServiceMessage message, AsyncCallback callack, object callbackData)
{
try
{
// check for bad data.
if (message == null)
{
throw new ServiceResultException(StatusCodes.BadInvalidArgument);
}
// set the request context.
SetRequestContext(RequestEncoding.Binary);
// create handler.
ProcessRequestAsyncResult result = new ProcessRequestAsyncResult(this, callack, callbackData, 0);
return result.BeginProcessRequest(SecureChannelContext.Current, message.InvokeServiceRequest);
}
catch (Exception e)
{
throw CreateSoapFault(null, e);
}
}
示例4: BeginCancel
/// <summary>
/// Asynchronously calls the Cancel service.
/// </summary>
public virtual IAsyncResult BeginCancel(CancelMessage message, AsyncCallback callback, object callbackData)
{
try
{
// OnRequestReceived(message.CancelRequest);
// check for bad data.
if (message == null) throw new ArgumentNullException("message");
// set the request context.
SetRequestContext(RequestEncoding.Xml);
// create handler.
ProcessRequestAsyncResult result = new ProcessRequestAsyncResult(this, callback, callbackData, 0);
return result.BeginProcessRequest(SecureChannelContext.Current, message.CancelRequest);
}
catch (Exception e)
{
Exception fault = CreateSoapFault(message.CancelRequest, e);
// OnResponseFaultSent(fault);
throw fault;
}
}