/// <summary>
        /// Generates an <see cref="Authentication"/> instance based on the current credentials and time.
        /// </summary>
        /// <returns></returns>
        private Authentication GetAuthentication()
        {
            DateTime timestamp = System.DateTime.Now;

            // Milliseconds seem to be a problem...
            timestamp = new DateTime(timestamp.Year, timestamp.Month, timestamp.Day,
                                     timestamp.Hour, timestamp.Minute, timestamp.Second, 0).ToUniversalTime();

            WS.Authentication auth = new WS.Authentication();
            auth.user      = _user;
            auth.timestamp = timestamp;

            HMACSHA256 hmac     = new HMACSHA256(System.Text.Encoding.UTF8.GetBytes(_key));
            string     password = Namespace + _user + timestamp.ToString(TimeStampFormat);

            auth.signature = ConvertToHex(hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(password)));

            return(auth);
        }
Beispiel #2
0
 public string getTagPaginated(Authentication authentication, string tag, int start, int offset) {
     object[] results = this.Invoke("getTagPaginated", new object[] {
                 authentication,
                 tag,
                 start,
                 offset});
     return ((string)(results[0]));
 }
Beispiel #3
0
 /// <remarks/>
 public void getTagAsync(Authentication authentication, string tag, object userState) {
     if ((this.getTagOperationCompleted == null)) {
         this.getTagOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetTagOperationCompleted);
     }
     this.InvokeAsync("getTag", new object[] {
                 authentication,
                 tag}, this.getTagOperationCompleted, userState);
 }
Beispiel #4
0
 /// <remarks/>
 public void getTagAsync(Authentication authentication, string tag) {
     this.getTagAsync(authentication, tag, null);
 }
Beispiel #5
0
 public string getTag(Authentication authentication, string tag) {
     object[] results = this.Invoke("getTag", new object[] {
                 authentication,
                 tag});
     return ((string)(results[0]));
 }
Beispiel #6
0
 public bool isTag(Authentication authentication, string tag) {
     object[] results = this.Invoke("isTag", new object[] {
                 authentication,
                 tag});
     return ((bool)(results[0]));
 }
Beispiel #7
0
 /// <remarks/>
 public void listAllTagsAsync(Authentication authentication, object userState) {
     if ((this.listAllTagsOperationCompleted == null)) {
         this.listAllTagsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnlistAllTagsOperationCompleted);
     }
     this.InvokeAsync("listAllTags", new object[] {
                 authentication}, this.listAllTagsOperationCompleted, userState);
 }
Beispiel #8
0
 public string[] listAllTags(Authentication authentication) {
     object[] results = this.Invoke("listAllTags", new object[] {
                 authentication});
     return ((string[])(results[0]));
 }
Beispiel #9
0
 /// <remarks/>
 public void createTagAsync(Authentication authentication, string tag) {
     this.createTagAsync(authentication, tag, null);
 }
Beispiel #10
0
 /// <remarks/>
 public void deleteTagAsync(Authentication authentication, string tag) {
     this.deleteTagAsync(authentication, tag, null);
 }
Beispiel #11
0
 /// <remarks/>
 public void sendEmailAsync(Authentication authentication, Email[] subscribers, CampaignParameters parameters, Content content, object userState) {
     if ((this.sendEmailOperationCompleted == null)) {
         this.sendEmailOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsendEmailOperationCompleted);
     }
     this.InvokeAsync("sendEmail", new object[] {
                 authentication,
                 subscribers,
                 parameters,
                 content}, this.sendEmailOperationCompleted, userState);
 }
Beispiel #12
0
 /// <remarks/>
 public void sendEmailAsync(Authentication authentication, Email[] subscribers, CampaignParameters parameters, Content content) {
     this.sendEmailAsync(authentication, subscribers, parameters, content, null);
 }
Beispiel #13
0
 public bool sendEmail(Authentication authentication, [System.Xml.Serialization.XmlArrayItemAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)] Email[] subscribers, CampaignParameters parameters, Content content) {
     object[] results = this.Invoke("sendEmail", new object[] {
                 authentication,
                 subscribers,
                 parameters,
                 content});
     return ((bool)(results[0]));
 }
Beispiel #14
0
 /// <remarks/>
 public void getTagPaginatedAsync(Authentication authentication, string tag, int start, int offset) {
     this.getTagPaginatedAsync(authentication, tag, start, offset, null);
 }
Beispiel #15
0
 /// <remarks/>
 public void listAllTagsAsync(Authentication authentication) {
     this.listAllTagsAsync(authentication, null);
 }
Beispiel #16
0
 /// <remarks/>
 public void getTagPaginatedAsync(Authentication authentication, string tag, int start, int offset, object userState) {
     if ((this.getTagPaginatedOperationCompleted == null)) {
         this.getTagPaginatedOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetTagPaginatedOperationCompleted);
     }
     this.InvokeAsync("getTagPaginated", new object[] {
                 authentication,
                 tag,
                 start,
                 offset}, this.getTagPaginatedOperationCompleted, userState);
 }
        /// <summary>
        /// Generates an <see cref="Authentication"/> instance based on the current credentials and time.
        /// </summary>
        /// <returns></returns>
        private Authentication GetAuthentication()
        {
            DateTime timestamp = System.DateTime.Now;
            // Milliseconds seem to be a problem...
            timestamp = new DateTime(timestamp.Year, timestamp.Month, timestamp.Day,
                timestamp.Hour, timestamp.Minute, timestamp.Second, 0).ToUniversalTime();

            WS.Authentication auth = new WS.Authentication();
            auth.user = _user;
            auth.timestamp = timestamp;

            HMACSHA256 hmac = new HMACSHA256(System.Text.Encoding.UTF8.GetBytes(_key));
            string password = Namespace + _user + timestamp.ToString(TimeStampFormat);

            auth.signature = ConvertToHex(hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(password)));

            return auth;
        }