Advertisement
piotrek77

WyslijSMSXMLSoap()

Jul 21st, 2012
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.83 KB | None | 0 0
  1.         /// <summary>
  2.         /// Wysyła SMS-y po uprzednim zainicjowaniu
  3.         /// </summary>
  4.         /// <returns></returns>
  5.         public RaportWyslaniaSMS WyslijSMSXMLSoap()
  6.         {
  7.  
  8.            
  9.             promosmsAPIPortTypeClient client = new Powiadamiacz.PromoSMSNamespace.promosmsAPIPortTypeClient();
  10.             messagesToSend messagesToSend = new Powiadamiacz.PromoSMSNamespace.messagesToSend();
  11.             messagesToSend.sMessage = msg;
  12.             messagesToSend.bSpecialCharsSpecified = true;
  13.             messagesToSend.bSpecialChars = true;
  14.             messagesToSend.bLongSms =  (Single == 0);
  15.             messagesToSend.bLongSmsSpecified = true;
  16.            
  17.             messagesToSend.iType = IType;
  18.             messagesToSend.iTypeSpecified = true;
  19.             messagesToSend.sFrom = From;
  20.             messagesToSend.aRecipients = new String[1]{To};
  21.             //messagesToSend.aUserIndexes = new String[1] { To };
  22.            
  23.             messagesToSend[] mesagesy = new messagesToSend[1] { messagesToSend };
  24.  
  25.             string description = "";
  26.             int smsCount = 0;
  27.             int price = 0;
  28.             sendRecipientsResults[] sendResult = new sendRecipientsResults[0];
  29.             RaportWyslaniaSMS wynik = new RaportWyslaniaSMS();
  30.  
  31.             wynik.Status = client.send(Login, EncodePassword(Pass), mesagesy, true, out description, out smsCount, out price, out sendResult).ToString();
  32.             if (wynik.Status.Length < 3) wynik.Status = "0" + wynik.Status;
  33.             if (wynik.Status.Length < 3) wynik.Status = "0" + wynik.Status;
  34.             wynik.Description = description;
  35.             wynik.Count = smsCount;
  36.             wynik.Price = price;
  37.             wynik.Number = sendResult[0].sRecipient;
  38.             wynik.Smsid = sendResult[0].sSmsId;
  39.             return wynik;
  40.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement