C# Class com.healthmarketscience.api.samples.dotnet.Core

显示文件 Open project: hmsonline/hms-api-starter-csharp

Private Properties

Property Type Description
CallWebService string
CallWebServicePost string
DebuggerPrint void
DebuggerPrintWebResponse void
GenerateSignature string
GetUrlBase string
HMS_API_SEARCH_WEBSERVICE_PATH string

Public Methods

Method Description
EnableSecurityProtocol ( SecurityProtocolType type = SecurityProtocolType.Tls|SecurityProtocolType.Tls11|SecurityProtocolType.Tls12|SecurityProtocolType.Ssl3 ) : void
SetConfiguration ( HmsApiConfig config ) : void

Private Methods

Method Description
CallWebService ( string url, string restMethod = "GET", string secret = null, string signature = null, string postData = null ) : string

Method that actually calls the HMS API webservice Important things are to generate the signature based on the URL to be called and then append it as a parameter to the url The signature needs to be generated on the url context which does NOT include the server:port and does NOT include the signature parameter itself NOTE: the timestamp is a parameter that's part of the url context and is related to the signature, therefore both the timestamp and the signature should be generated just prior to the web services call itself

CallWebServicePost ( string url, string postData, string secret = null, string signature = null ) : string
DebuggerPrint ( string message ) : void
DebuggerPrintWebResponse ( string url, string response ) : void
GenerateSignature ( string contentToSign, string secretKey = DEFAULT_SECRET ) : string
GetUrlBase ( ) : string
HMS_API_SEARCH_WEBSERVICE_PATH ( ) : string

Method Details

EnableSecurityProtocol() public static method

public static EnableSecurityProtocol ( SecurityProtocolType type = SecurityProtocolType.Tls|SecurityProtocolType.Tls11|SecurityProtocolType.Tls12|SecurityProtocolType.Ssl3 ) : void
type SecurityProtocolType
return void

SetConfiguration() public static method

public static SetConfiguration ( HmsApiConfig config ) : void
config HmsApiConfig
return void