{ /// /// The response type we return for a standard integrator's web request. /// [DataContract] public class IntegrationResponse { /// /// Constructor /// public IntegrationResponse() { ProcessingDate = DateTime.UtcNow.ToString( "u" ); } /// /// Gets or sets the name of the integrator (if known). /// [DataMember( IsRequired = false )] public string Integrator { get; set; } /// /// Gets or sets the type of message (if known). /// [DataMember( IsRequired = false )] public string MessageType { get; set; } /// /// Gets or sets the identifier assigned by MoversConnect to this message /// [DataMember( IsRequired = false )] public string MessageTagId { get; set; } /// /// If the integration operation returns the results of a query, then that /// data is returned in this property. Only 'XML query' results are supported. /// [DataMember( IsRequired = false )] public string QueryResults { get; set; } /// /// If the integration operation returns output parameters, then that /// data is returned in this property in JSON format. See the /// class VendorConnectDbResults below for the structure of this /// JSON string. /// [DataMember( IsRequired = false, EmitDefaultValue = false )] public string OutParams { get; set; } /// /// Gets or sets if the overall result was a success or not. If there is at least /// one ResponseMessage item that is an error, then the overall result is fail. /// [DataMember( IsRequired = false )] public bool Results { get; set; } /// /// Gets or sets the HTTP status code. /// [DataMember( IsRequired = false )] public int StatusCode { get; set; } /// /// Gets or sets the top level exception message. /// [DataMember( IsRequired = false )] public string ExceptionMessage { get; set; } /// /// Gets or sets the base exception message. /// [DataMember( IsRequired = false )] public string BaseExceptionMessage { get; set; } /// /// Gets or sets the number of response messages. /// [DataMember( IsRequired = false )] public int ResponseMessageCount { get; set; } /// /// Gets or sets the response messages array. /// [DataMember( IsRequired = false )] public IntegrationResponseItem[] ResponseMessages { get; set; } /// /// Gets or sets the UTC date time it was processed. /// [DataMember( IsRequired = false )] public string ProcessingDate { get; set; } } /// /// A single request could have multiple results. Each item is one such result message. /// [DataContract] public class IntegrationResponseItem { /// /// Gets or sets if this item was a success or not. /// [DataMember( IsRequired = false )] public bool WasSuccess { get; set; } /// /// Gets or sets a success message. /// [DataMember( IsRequired = false )] public string SuccessMessage { get; set; } /// /// Gets or sets an error code. /// [DataMember( IsRequired = false )] public int ErrorCode { get; set; } /// /// Gets or sets an error message. /// [DataMember( IsRequired = false )] public string ErrorMessage { get; set; } } } /// /// The JSON structure we return for the OutParams string. /// public class VendorConnectDbResults { /// /// Gets or sets an array of output parameters that are /// part of the stored procedure. If there are no output /// parameters for a given stored procedure, an empty array /// is returned. /// public VendorConnectDbOutParam[] Parameters { get; set; } /// /// Gets or sets the integer return value from the stored procedure. /// All stored procedures have a return code, which is 0 by default. /// public int ReturnValue { get; set; } } public class VendorConnectDbOutParam { /// /// Gets or sets the name of an output parameter from the stored procedure. /// public string Name { get; set; } /// /// Gets or sets the value, in string format, of the parameter. /// public string Value { get; set; } }