AutoWebServiceRequest<TResponse> class

A web service request whose response is initialized via reflection.

public class AutoWebServiceRequest<TResponse> : WebServiceRequestBase<TResponse>
parameter description
TResponse The type of the response.

Public Members

name description
AutoWebServiceRequest(…) Initializes a new instance of the AutoWebServiceRequest class.
JsonSettings { get; set; } Gets or sets the JSON settings.

Protected Members

name description
virtual CreateResponse() Creates an empty response.
override HandleResponseCoreAsync(…) Overrides HandleResponseCore.

Remarks

AutoWebServiceRequest automatically sets properties on an instance of TResponse when handling the web service response.

First, a property is located whose name matches the name of the returned status code. If that property is Boolean, it is set to true. If the response content is JSON, it is deserialized into the property according to the property type. If no such property is found on TResponse, a WebServiceException is thrown.

After the status code is handled, the response headers are deserialized into properties that match the header names without the hyphens. If the property is a string, it is set to the header value without modification; other property types will cause the header value to be parsed accordingly, e.g. Int32, Int64, Uri, DateTime (RFC1123), LanguageName, and byte[] (base-64). Response headers without corresponding properties are ignored.

See Also