How can i send the chinese sms using java J2EE(web application)

hi,

i have the difficulty on sending chinese sms using J2EE application.i try to input the chinese word to jsp and send the plain text sms. i received the sms with plenty of question mark "?". i think it is regarding to the conversion of String to some kind of format that supported by mobile phone. below are some code the send the sms to recipient. i need someone help in order to have the solution.

thanks a lot

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>

............

<%@ page import="se.sapio.rta.service.MPMService"%>

<%@ page import="java.util.Locale"%>

<%

Locale.setDefault(Locale.UK);

Context ctx;

MPMService mpmservice;

ctx =new InitialContext();

mpmservice = (MPMService) ctx.lookup("BC/Service/RTAMPM");

LSUser user =null;

boolean ok =true;

try{

....................

if (ok){

String sender = request.getParameter("sender");

String phonenr = request.getParameter("phonenr");

String sendmsg = request.getParameter("sendmsg");

.........................................

}

if(bError){

byte[] bytes = message.getBytes("UTF-8");

message = mobileclientservice.ByteEncode(bytes);

response.sendRedirect("send_sms.jsp?s="+request.getParameter("s")+"&msg="+message+"&phonenr="+request.getParameter("phonenr").replaceAll("\\+","%2B")+"&sender="+request.getParameter("sender")+"&sendmsg="+request.getParameter("sendmsg").replaceAll("\\+","%2B"));

}

String resp ="";

if(mpmservice.sendPlainTextSMS(sender, phonenr, sendmsg)){

resp=mpmservice.getLang(user.getLang(),"sms_sent");

}else{

resp=mpmservice.getLang(user.getLang(),"sms_not_sent");

} %>

<jsp:include page="/top.jsp" />

<p class="headline"><%=mpmservice.getLang(user.getLang(),"send_sms_title")%>

<form name="operatordetails" id="operatordetails" method="post" action="send_sms.jsp">

<INPUT TYPE=hidden NAME=s VALUE="<%=request.getParameter("s")%>">

<INPUT TYPE=hidden NAME=phonenr VALUE="<%=request.getParameter("phonenr")%>">

<table class="infotable" id="report">

<tr>

<td class="left" colspan="2"><%=resp%></td>

<td class="right"></td>

</tr>

<tr>

<td class="left" colspan="2">

<input class="halfmiddle" name="Back" type="submit" id="Back" value="<%=mpmservice.getLang(user.getLang(), "back")%>" />

</td>

<td class="right"> </td>

</tr>

</table>

</form>

<jsp:include page="/bottom.jsp" />

<%} %>

publicboolean sendPlainTextSMS(String sender, String recipient, String sendmsg){

if(recipient.charAt(0) =='+')

{

recipient = recipient.substring(1);

}

String senderIdType ="Alpha";

if( (sender.charAt(0) >='0' && sender.charAt(0) <='9') || sender.charAt(0) =='+')

{

senderIdType ="Numeric";

if(sender.charAt(0) =='+')

{

sender = sender.substring(1);

}

for(int i=0; i < sender.length(); i++)

{

if(!(sender.charAt(i) >='0' && sender.charAt(i) <='9'))

senderIdType ="Alpha";

}

}

log.warn("sending sms to: "+recipient +" sendtype: " + senderIdType +" msg: "+ sendmsg);

log.warn("Encoded sms:"+Encode(sendmsg));

try{

String postData ="XMLDATA=" + URLEncoder.encode("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\r\n" +

"<NotificationRequest Version=\"3.4\">\r\n" +

"<NotificationHeader>\r\n" +

"<PartnerName>" + SMS_PARTNER_NAME +"</PartnerName>\r\n" +

"<PartnerPassword>" + SMS_PARTNER_PASSWORD +"</PartnerPassword>\r\n" +

"<SubscriptionName>XML</SubscriptionName>\r\n" +

"</NotificationHeader>\r\n" +

"<NotificationList BatchID=\"1\">\r\n" +

"<Notification SequenceNumber=\"0\" MessageType=\"SMS\">\r\n" +

"<Message>" + Encode(sendmsg) +"</Message>\r\n" +

"<Profile>" + SMS_PARTNER_PROFILE +"</Profile>\r\n" +

"<SenderID Type=\"" + senderIdType +"\">" + sender +"</SenderID>\r\n" +

"<Subscriber>\r\n" +

"<SubscriberNumber>" + recipient +"</SubscriberNumber>\r\n" +

"</Subscriber>\r\n" +

" </Notification>\r\n" +

" </NotificationList>\r\n" +

"</NotificationRequest>","ISO-8859-1");

appreciate for anyone provide the solution.

thanks a lot

[8335 byte] By [landoaa] at [2007-11-27 1:42:14]
# 1

Hi,

I want to send sms from web application to mobile phones at the time of registration. Its verymuch greatful to me, if you let me know, how to send from jsp to mobile. because from your post, i got, you already know about sending sms from jsp to mobile.

please let me know, how to send sms

atsakthivel@gmail.com

Thanks in advance for your kind help

SakthivelTa at 2007-7-12 0:58:36 > top of Java-index,Desktop,I18N...