急:请问有做过短信接口的吗? 帮帮我 thanks!!!!!!!!!

theodo 2004-11-02 03:22:41
我现在在做一个和短信接口传参数的程序.
对方接口是
ttp://219.238.160.67:8666/websend/?serverid=PLAYJH001&fromuser=ZW&password=9500&phone="+fromphone+"&fromphone="+fromphone+"&fromserver="+3650+"&message="+result_info+"&linkid="+linkid

fromphone、result_info、linkid都是我给它的参数
我的程序是这样做的,可是不行.

这个是我取它给的参数年的面:
<%@ page contentType="text/html; charset=gb2312" %>
<jsp:useBean id="smsdb" scope="session" class="sms.smsdb"/>
<jsp:useBean id="wwconn" scope="session" class="sms.wwconn"/>
</head>
<body bgcolor="#ffffff">
<%
String url = request.getQueryString();
String ipaddrs = request.getRemoteAddr();
String Serverid = new String(request.getParameter("Serverid").getBytes("ISO8859_1"));
String fromphone = new String(request.getParameter("fromphone").getBytes("ISO8859_1"));
String fromgateway = new String(request.getParameter("fromgateway").getBytes("ISO8859_1"));
String stamptime = new String(request.getParameter("stamptime").getBytes("ISO8859_1"));
String Msg = new String(request.getParameter("Msg").getBytes("ISO8859_1"));
String linkid = new String(request.getParameter("LinkID").getBytes("ISO8859_1"));

if (Msg.length()==21)
{
String result_info = "";
result_info = smsdb.executesms("{call pkg_sms.getsmsresult(?,?,?)}",fromphone,Msg);
if (!result_info.equals(""))
{
wwconn.strsend(fromphone,result_info,linkid);
}
else
{
System.out.println("error!");
}
}
%>
</body>
</html>
这个jsp信息取的都是对的
package sms;
import java.net.*;
import java.io.*;
import java.io.IOException;
public class wwconn {
public void strsend(String fromphone, String result_info, String linkid) throws
MalformedURLException, IOException {
String c;
URL url = new URL("http://219.238.160.67:8666/websend/?");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream(),"8859_1");
out.write("serverid=PLAYJH001&fromuser=ZW&password=9500&phone="+fromphone+"&fromphone="+fromphone+"&fromserver="+3650+"&message="+result_info+"&linkid="+linkid);
out.flush();
out.close();
}
}
对方应该把message的值发到手机上,可是发到手机上是:
<html>
<body bgcolor="#ffffff">
</body>
</html>
...全文
115 点赞 收藏 3
写回复
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
prok 2004-11-05
做广告可不好.....
回复
发动态
发帖子
J2ME
创建于2007-09-28

1.3w+

社区成员

Java J2ME
申请成为版主
社区公告
暂无公告