Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用smsj:发送Base64编码字符串的SMS_Java_Html_Sms Gateway - Fatal编程技术网

Java 使用smsj:发送Base64编码字符串的SMS

Java 使用smsj:发送Base64编码字符串的SMS,java,html,sms-gateway,Java,Html,Sms Gateway,我有一个Base64编码的Java字符串。我需要通过SMS将该Java字符串发送到GSM移动电话上的另一个SMS应用程序,该应用程序希望该字符串以Basse64编码格式发送。我在smsj java库中使用Clickatell HTTP API,如下所示: public void SendBinarySMSMessage(String toPhone, String cTxt, String toPort, String fromPhone) throws Exception { // Note

我有一个Base64编码的Java字符串。我需要通过SMS将该Java字符串发送到GSM移动电话上的另一个SMS应用程序,该应用程序希望该字符串以Basse64编码格式发送。我在smsj java库中使用Clickatell HTTP API,如下所示:

public void SendBinarySMSMessage(String toPhone, String cTxt, String toPort, String fromPhone) throws Exception {
// Note that 'cTxt' is Base64 encoded string 
    Properties props = new Properties();
    props.setProperty("smsj.clickatell.username", "xxxxxxx");
    props.setProperty("smsj.clickatell.password","yyyyy");
    props.setProperty("smsj.clickatell.apiid","zzzzzzz");
    // Now load the clickatell transport
    SmsTransport transport = SmsTransportManager.getTransport("org.marre.sms.transport.clickatell.ClickatellTransport", props);
    // Connect to clickatell
    transport.connect();
    // Create and send the sms message
    int dstPort = Integer.parseInt(toPort);
    int srcPort = Integer.parseInt(toPort);
    SmsPortAddressedTextMessage textMessage = new SmsPortAddressedTextMessage(dstPort,srcPort,cTxt);
    transport.send(textMessage,new SmsAddress(toPhone),new SmsAddress(fromPhone));
    // Disconnect from clickatell
    transport.disconnect();
}
每次尝试发送mesage时,都会出现以下错误:

SEVERE:   org.marre.sms.SmsException: Clickatell API cannot send 7 bit encoded messages with UDH
at org.marre.sms.transport.clickatell.ClickatellTransport.buildSendRequest(ClickatellTransport.java:385)
下面是我试图发送的cTXT字符串的值:“56pRfQSuddMbjOc8ibMyYKkmLTQ8AZpAz3sT+5JrGDw=”

如何解决此问题

多谢各位