C# Class MMS_App1, API-Platform

MMS_App1 class
This application allows an end user to send an MMS message with up to three attachments of any common format, and check the delivery status of that MMS message.
Inheritance: System.Web.UI.Page
ファイルを表示 Open project: attdevsupport/API-Platform

Public Methods

Method Description
BypassCertificateError ( ) : void

This method neglects the ssl handshake error with authentication server

Protected Methods

Method Description
GetStatusButton_Click ( object sender, EventArgs e ) : void

This method will be called when user click on get status button

Page_Load ( object sender, EventArgs e ) : void

Event, that triggers when the application page is loaded into the web browser, reads the web.config file and gets the values of the attributes

SendMMSMessageButton_Click ( object sender, EventArgs e ) : void

This method will be called when user clicks on send mms button

Private Methods

Method Description
DrawGetStatusSuccess ( string status, string url ) : void

Displays Resource url upon success of GetMmsDelivery

DrawPanelForFailure ( Panel, panelParam, string message ) : void

Displays error message

DrawPanelForSuccess ( Panel, panelParam, string message ) : void

Display success message

FormMIMEParts ( string boundary, string &data ) : byte[]

Form mime parts for the user input files

GetAccessToken ( AccessTokenType type ) : bool

This method gets access token based on either client credentials mode or refresh token.

GetBytesOfFile ( string boundary, string &data, string filePath ) : byte[]

Gets the bytes representation of file along with mime part

GetMmsDeliveryStatus ( ) : void

This function calls get message delivery status api to fetch the delivery status

GetPhoneNumber ( ) : string

Gets formatted phone number

IsTokenValid ( ) : string

Validates he expiry of the access token and refresh token

JoinTwoByteArrays ( byte firstByteArray, byte secondByteArray ) : MemoryStream

This function adds two byte arrays

ReadAccessTokenFile ( ) : bool

This function reads the Access Token File and stores the values of access token, expiry seconds, refresh token, last access token time and refresh token expiry time.

ReadAndGetAccessToken ( ) : bool

This function reads access token file, validates the access token and gets a new access token

ReadConfigFile ( ) : bool

This method reads config file and assigns values to local variables

SendMMS ( ) : void

This function initiates send mms api call to send selected files as an mms

SendMessageNoAttachments ( string mmsAddress, string mmsMessage ) : void

Invokes messaging api to send message without any attachments

SendMultimediaMessage ( string mmsAddress, string mmsMessage ) : void

Sends MMS by calling messaging api

Method Details

BypassCertificateError() public static method

This method neglects the ssl handshake error with authentication server
public static BypassCertificateError ( ) : void
return void

GetStatusButton_Click() protected method

This method will be called when user click on get status button
protected GetStatusButton_Click ( object sender, EventArgs e ) : void
sender object object, that caused this event
e EventArgs Event that invoked this function
return void

Page_Load() protected method

Event, that triggers when the application page is loaded into the web browser, reads the web.config file and gets the values of the attributes
protected Page_Load ( object sender, EventArgs e ) : void
sender object object, that caused this event
e EventArgs Event that invoked this function
return void

SendMMSMessageButton_Click() protected method

This method will be called when user clicks on send mms button
protected SendMMSMessageButton_Click ( object sender, EventArgs e ) : void
sender object object, that caused this event
e EventArgs Event that invoked this function
return void