C# Class ModernApp4Me.WP8.WebService.M4MWebServiceCaller

A basis class for making web service calls easier which uses RestSharp.Portable on Windows Phone. When invoking an HTTP method, the caller goes through the following workflow: The M4MWebServiceCaller.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 M4MWebServiceCaller.OnHttpStatusCodeNotOk() is invoked. if the HttpStatusCode is NotFound and the DeviceNetworkInformation.IsNetworkAvailable is false, a M4MConnectivityException is thrown. Otherwife, a M4MCallException is thrown.
Inheritance: ModernApp4Me.Core.WebService.M4MBaseWebServiceCaller
Datei anzeigen Open project: smartnsoft/ModernApp4Me

Protected Methods

Method Description
M4MWebServiceCaller ( string baseUrl ) : System.Net

Basis constructor.

OnHttpStatusCodeNotOk ( string resource, HttpStatusCode statusCode ) : void

Private function that raises an exception when the result code to a web method id not OK (not 20X).

Method Details

M4MWebServiceCaller() protected method

Basis constructor.
protected M4MWebServiceCaller ( string baseUrl ) : System.Net
baseUrl string The base URL of the web service API
return System.Net

OnHttpStatusCodeNotOk() protected method

Private function that raises an exception when the result code to a web method id not OK (not 20X).
protected OnHttpStatusCodeNotOk ( string resource, HttpStatusCode statusCode ) : void
resource string The uri
statusCode HttpStatusCode the
return void