راهنمای متد GetInboxMessageWithInboxID
با استفاده از این متد شما می توانید با ارسال شناسه یک پیامک، لیستی از تمامی پیامک های دریافتی که شناسه آن ها بزرگتر از شناسه پیامک ارسالی باشد، را دریافت نمایید. با توجه به جدول ذیل پارامتر های این متد را مقدار دهی کنید .
نام نوع اجباری / اختیاری توضیح
UserName String اجباری نام کاربری
Password String اجباری کلمه عبور
NumberOfMessage Integer اجباری تعداد پیامک های درخواستی
InboxID Integer اجباری شناسه پیامک
IsReaded Boolean اجباری آیا تمامی پیامک ها نمایش داده شود یا فقط خوانده نشده ها
کلید توضیح
ResultInbox آرایه ای از InboxItem2
نکات مهم در مورد کار با متد GetInboxMessageWithInboxID
مقدار بازگشتی این متد، آبجکت ResultInbox که شامل آرایه ای از آبجکتی با نوع InboxItem2 می باشد . فرمت آبجکت مذکور در فایل WSDL موجود می باشد .
class SMS
{
public $ Username = '' ;
public $ Password = '' ;
private $ SoapAddress = 'https://sms.sunwaysms.com/SMSWS/SOAP.asmx?wsdl ' ;
private $ client ;
function __construct ()
{
$ this ->client = new SoapClient ($ this ->SoapAddress );
}
public Function GetClient (){
return $ this ->client ;
}
public Function GetClientEx ($ option ){
return new SoapClient ($ this ->SoapAddress , $ option );
}
public Function GetMethods (){
$ arr = array ();
$ client = GetClient ();
return $ client ->__getFunctions ();
}
public function GetInboxMessageWithInboxID ($ NumberOfMessage , $ InboxID , $ IsReaded ) {
$ option = array ('UserName ' => $ this ->Username ,'Password ' => $ this ->Password ,
'NumberOfMessage ' => $ NumberOfMessage ,'InboxID ' => $ InboxID ,'IsReaded ' => IsReaded);
$ client = $ this ->GetClient ();
return $ client ->GetInboxMessageWithInboxID ($ option )->GetInboxMessageWithInboxIDResult ;
}
}
/**
Get Inbox Message With Last InboxID
@param UserName String
@param Password String
@param NumberOfMessage int
@param InboxID int
@param IsReaded True/False
@return ResultInbox
*/
public final SOAP .ResultInbox GetInboxMessageWithInboxID (String UserName , String Password , int NumberOfMessage , int InboxID , boolean IsReaded )
{
try (SOAP .SMS SMSService = new SOAP .SMS ())
{
return SMSService .GetInboxMessageWithInboxID (UserName , Password , NumberOfMessage , InboxID , IsReaded );
}
catch (RuntimeException ex ){}
}
public static class API {
/// <summary>
/// Get Inbox Message With Last InboxID
/// </summary>
/// <param name="UserName">String</param>
/// <param name="Password">String</param>
/// <param name="NumberOfMessage">int</param>
/// <param name="InboxID">int</param>
/// <param name="IsReaded">True/False</param>
/// <returns>ResultInbox</returns>
public static SOAP . ResultInbox GetInboxMessageWithInboxID ( string UserName , string Password , int NumberOfMessage , int InboxID , bool IsReaded ) {
using ( SOAP . SMS SMSService = new SOAP . SMS ( ) ) {
return SMSService . GetInboxMessageWithInboxID ( UserName , Password , NumberOfMessage , InboxID , IsReaded ) ;
}
}
}
Imports System.Net
Imports System.IO
Imports System.Text
Imports System.Web.Script.Serialization
public Class API
''' <summary>
''' Get Inbox Message With Last InboxID
''' </summary>
''' <param name="UserName">String</param>
''' <param name="Password">String</param>
''' <param name="NumberOfMessage">int</param>
''' <param name="InboxID">int</param>
''' <param name="IsReaded">True/False</param>
''' <returns>ResultInbox</returns>
public Shared Function GetInboxMessageWithInboxID(UserName As String , Password As String , NumberOfMessage As Integer , InboxID As Integer , IsReaded As Boolean ) As SOAP.ResultInbox
Using SMSService As New SOAP.SMS()
Return SMSService.GetInboxMessageWithInboxID(UserName, Password, NumberOfMessage, InboxID, IsReaded)
End Using
End Function
End Class