Beispiel #1
0
        public static ServiceRequest GetServiceRequest()
        {
            RequestMessage request = new RequestMessage();
             MessageArgument arg = new MessageArgument();
             arg.ArgumentType = "System.String";
             arg.Argument = "stub";
             request.MessageArgs = new MessageArgument[1]{arg};

             byte[] content;
             using (IBinaryMessageSerializer serializer =
            MessageSerializerFactory.CreateBinarySerializer(typeof(RequestMessage)))
             {
            content = serializer.Serialize(request);
             }

             ServiceRequest result = new ServiceRequest(content);
             result.Message = new RequestMessage();
             result.Message.ServiceKey = typeof (FakeProxy).Name;
             result.Message.MethodKey = "ProxyMethod";
             result.Message.MessageArgs = request.MessageArgs;
             result.Message.SessionTicket = Guid.NewGuid();

             return result;
        }
Beispiel #2
0
        public static ServiceRequest GetServiceRequestFailure()
        {
            ServiceRequest result = new ServiceRequest(new byte[0]);
             result.Message = new RequestMessage();
             result.Service = new object();
             result.ServiceMethod = typeof(FakeProxy).GetMethod("ProxyMethod");
             result.ServiceMethodArgs = new object[1] { "stub" };
             result.ValidSession = true;
             result.Message.SessionTicket = Guid.NewGuid();

             return result;
        }
Beispiel #3
0
 public void Initialize(ServiceRequest request, ServiceResponse response)
 {
     _serviceRequest = request;
      _serviceResponse = response;
 }