C# Class MMS_App2, API-Platform

MMS_App2 class
This is a server side application which also has a web interface. The application looks for a file called numbers.txt containing MSISDNs of desired recipients, and an image called coupon.jpg, and message text from a file called subject.txt, and then sends an MMS message with the attachment to every recipient in the list. This can be triggered via a command line on the server, or through the web interface, which then displays all the returned mmsIds or respective errors
Inheritance: System.Web.UI.Page
Show file 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
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

SendButton_Click ( object sender, EventArgs e ) : void

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

StatusButton_Click ( object sender, EventArgs e ) : void

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

Private Methods

Method Description
DrawPanelForFailedNumbers ( Panel panelParam ) : void

This function draws table for failed numbers

DrawPanelForFailure ( Panel panelParam, string message ) : void

Displays error message

DrawPanelForGetStatusResult ( string msgid, string phone, string status, bool headerFlag ) : void

This method draws table for get status response

DrawPanelForSuccess ( Panel panelParam, string message ) : void

Display success message

GetAccessToken ( AccessTokenType type ) : bool

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

GetPhoneNumbers ( ) : bool

This method gets the phone numbers present in phonenumber text box and validates each phone number and prepares valid and invalid phone number lists and returns a bool value indicating if able to get the phone numbers.

IsTokenValid ( ) : string

Validates he expiry of the access token and refresh token

IsValidMISDN ( string number ) : bool

This method validates the given string as valid msisdn

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

Sends MMS message by invoking Send MMS api

Method Details

BypassCertificateError() public static method

This method neglects the ssl handshake error with authentication server
public static BypassCertificateError ( ) : void
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

SendButton_Click() protected method

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

StatusButton_Click() protected method

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