示例#1
0
        public WebServiceClient([NotNull] ServiceClientConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            mConfiguration = configuration;
        }
        internal WebServiceClientRequest([NotNull] ServiceClientConfiguration configuration, [NotNull] CommunicationStrategy communicationStrategy, [NotNull] HttpWebRequest request)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }
            if (communicationStrategy == null)
            {
                throw new ArgumentNullException(nameof(communicationStrategy));
            }
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            mConfiguration         = configuration;
            mCommunicationStrategy = communicationStrategy;
            mRequest = request;
        }
		internal WebServiceClientResponse(
			[NotNull] ServiceClientConfiguration configuration, 
			[NotNull] CommunicationStrategy communicationStrategy, 
			[NotNull] byte[] data, 
			[NotNull] IKeyValueStore<string> headers, 
			[NotNull] IResult result, int statusCode)
		{
			if (configuration == null) throw new ArgumentNullException(nameof(configuration));
			if (communicationStrategy == null) throw new ArgumentNullException(nameof(communicationStrategy));
			if (data == null) throw new ArgumentNullException(nameof(data));
			if (headers == null) throw new ArgumentNullException(nameof(headers));
			if (result == null) throw new ArgumentNullException(nameof(result));

			mConfiguration = configuration;
			mCommunicationStrategy = communicationStrategy;
			mResponse = data;
			mHeaders = headers;

			HasError = result.HasError;
			ErrorDescription = result.ErrorDescription;
			StatusCode = statusCode;
		}