C# 클래스 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.
파일 보기 프로젝트 열기: smartnsoft/ModernApp4Me

보호된 프로퍼티들

프로퍼티 타입 설명
client RestClient

공개 메소드들

메소드 설명
ExecuteHttpRequest ( RestSharp.Portable.RestRequest restRequest, int attempsCount ) : double>>.Task

Executes a call to a web method without any persistence.

보호된 메소드들

메소드 설명
Debug ( string message ) : void
Error ( string message ) : void
M4MBaseWebServiceCaller ( string baseUrl ) : System.Net

Basis constructor.

OnHttpStatusCodeNotOk ( string resource, HttpStatusCode statusCode ) : void

메소드 상세

Debug() 보호된 추상적인 메소드

protected abstract Debug ( string message ) : void
message string
리턴 void

Error() 보호된 추상적인 메소드

protected abstract Error ( string message ) : void
message string
리턴 void

ExecuteHttpRequest() 공개 메소드

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
리턴 double>>.Task

M4MBaseWebServiceCaller() 보호된 메소드

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

OnHttpStatusCodeNotOk() 보호된 추상적인 메소드

protected abstract OnHttpStatusCodeNotOk ( string resource, HttpStatusCode statusCode ) : void
resource string
statusCode HttpStatusCode
리턴 void

프로퍼티 상세

client 보호되어 있는 프로퍼티

protected RestClient client
리턴 RestClient