2011-01-11 141 views
3

我正在使用「simplewire」庫(適用於Java),它應該能夠從PC發送短信到手機。不過,我seeting以下錯誤:如何使用simplewire for Java將SMS從PC發送到手機?

Message was not sent! Error Code: 420 Error Description: Invalid Subscriber ID or Subscriber Password.

這裏是我的代碼示例

import com.simplewire.sms.*; 

public class send_text 
{ 
    public static void main(String[] args) throws Exception 
    { 
     SMS sms = new SMS(); 

     // Subscriber Settings 
     sms.setSubscriberID("123-456-789-12345"); 
     sms.setSubscriberPassword("1234"); 

     // Message Settings 
     sms.setMsgPin("+110051"); 
     sms.setMsgFrom("Demo"); 
     sms.setMsgCallback("+11005551212"); 
     sms.setMsgText("Hello World From Simplewire!"); 

     System.out.println("Sending message to Simplewire..."); 

     // Send Message 
     sms.msgSend(); 

     // Check For Errors 
     if(sms.isSuccess()) 
     { 
      System.out.println("Message was sent!"); 
     } 
     else 
     { 
      System.out.println("Message was not sent!"); 
      System.out.println("Error Code: " + sms.getErrorCode()); 
      System.out.println("Error Description: " + sms.getErrorDesc()); 
      System.out.println("Error Resolution: " + sms.getErrorResolution() + "\n"); 
     } 
    } 
} 

我想知道如何獲得用戶ID和密碼用戶?我需要一個帳戶嗎?

回答

3

Simplewire Java SMS SDK Manual

The subscriber ID is an ID number provided to paid subscribers that gives access to all of Simplewire’s resources. The appropriate password must also be set.

1

SimpleWire現在OpenMarket

是你需要設置一個賬戶OpenMarket使用他們的SDK。

他們提供兩種類型的帳戶:

  • 演示:這是在那裏你可以在很短的代碼,用於測試
  • 商用測試代碼:這是你將支付一Short Code和訪問他們的平臺/服務
相關問題