C# Class ModernApp4Me.Core.WebService.M4MBaseWebServiceCaller

A basis class for making web service calls easier which uses RestSharp.Portable. When invoking an HTTP method, the caller goes through the following workflow: The M4MBaseWebServiceCaller.ExecuteHttpRequest methods is invoked : if the response HttpStatusCode is OK, the body is returned ad a string. if the HttpStatusCode is not OK, the private method M4MBaseWebServiceCaller.OnHttpStatusCodeNotOk is invoked.
Afficher le fichier Open project: smartnsoft/ModernApp4Me

Protected Properties

Свойство Type Description
client RestClient

Méthodes publiques

Méthode Description
ExecuteHttpRequest ( RestSharp.Portable.RestRequest restRequest, int attempsCount ) : double>>.Task

Executes a call to a web method without any persistence.

Méthodes protégées

Méthode Description
Debug ( string message ) : void
Error ( string message ) : void
M4MBaseWebServiceCaller ( string baseUrl ) : System.Net

Basis constructor.

OnHttpStatusCodeNotOk ( string resource, HttpStatusCode statusCode ) : void

Method Details

Debug() protected abstract méthode

protected abstract Debug ( string message ) : void
message string
Résultat void

Error() protected abstract méthode

protected abstract Error ( string message ) : void
message string
Résultat void

ExecuteHttpRequest() public méthode

Executes a call to a web method without any persistence.
public ExecuteHttpRequest ( RestSharp.Portable.RestRequest restRequest, int attempsCount ) : double>>.Task
restRequest RestSharp.Portable.RestRequest the
attempsCount int the current attemp number
Résultat double>>.Task

M4MBaseWebServiceCaller() protected méthode

Basis constructor.
protected M4MBaseWebServiceCaller ( string baseUrl ) : System.Net
baseUrl string The base URL of the web service API
Résultat System.Net

OnHttpStatusCodeNotOk() protected abstract méthode

protected abstract OnHttpStatusCodeNotOk ( string resource, HttpStatusCode statusCode ) : void
resource string
statusCode HttpStatusCode
Résultat void

Property Details

client protected_oe property

protected RestClient client
Résultat RestClient