Beispiel #1
0
        public async Task <FindServersResponse> FindServersAsync(FindServersRequest findServersRequest)
        {
            UpdateRequestHeader(findServersRequest, true, "FindServers");
            FindServersResponse findServersResponse = null;

            try
            {
                if (UseTransportChannel)
                {
                    var serviceResponse = await Task <IServiceResponse> .Factory.FromAsync(TransportChannel.BeginSendRequest, TransportChannel.EndSendRequest, findServersRequest, null).ConfigureAwait(false);

                    if (serviceResponse == null)
                    {
                        throw new ServiceResultException(StatusCodes.BadUnknownResponse);
                    }
                    ValidateResponse(serviceResponse.ResponseHeader);
                    findServersResponse = (FindServersResponse)serviceResponse;
                }
                else
                {
                    var findServersResponseMessage = await Task <FindServersResponseMessage> .Factory.FromAsync(InnerChannel.BeginFindServers, InnerChannel.EndFindServers, new FindServersMessage(findServersRequest), null).ConfigureAwait(false);

                    if (findServersResponseMessage == null || findServersResponseMessage.FindServersResponse == null)
                    {
                        throw new ServiceResultException(StatusCodes.BadUnknownResponse);
                    }
                    findServersResponse = findServersResponseMessage.FindServersResponse;
                    ValidateResponse(findServersResponse.ResponseHeader);
                }
            }
            finally
            {
                RequestCompleted(findServersRequest, findServersResponse, "FindServers");
            }
            return(findServersResponse);
        }
Beispiel #2
0
        /// <summary>
        /// Invokes the FindServers service.
        /// </summary>
        public IServiceResponse FindServers(IServiceRequest incoming)
        {
            FindServersResponse response = null;

            FindServersRequest request = (FindServersRequest)incoming;

            ApplicationDescriptionCollection servers = null;

            response = new FindServersResponse();

            response.ResponseHeader = ServerInstance.FindServers(
               request.RequestHeader,
               request.EndpointUrl,
               request.LocaleIds,
               request.ServerUris,
               out servers);

            response.Servers = servers;

            return response;
        }
Beispiel #3
0
        /// <summary cref="IServiceMessage.CreateResponse" />
        public object CreateResponse(IServiceResponse response)
        {
            FindServersResponse body = response as FindServersResponse;

            if (body == null)
            {
                body = new FindServersResponse();
                body.ResponseHeader = ((ServiceFault)response).ResponseHeader;
            }

            return new FindServersResponseMessage(body);
        }
Beispiel #4
0
        /// <summary>
        /// Initializes the message with a service fault.
        /// </summary>
        public FindServersResponseMessage(ServiceFault ServiceFault)
        {
            this.FindServersResponse = new FindServersResponse();

            if (ServiceFault != null)
            {
                this.FindServersResponse.ResponseHeader = ServiceFault.ResponseHeader;
            }
        }
Beispiel #5
0
 /// <summary>
 /// Initializes the message with the body.
 /// </summary>
 public FindServersResponseMessage(FindServersResponse FindServersResponse)
 {
     this.FindServersResponse = FindServersResponse;
 }