67,513
社区成员
发帖
与我相关
我的任务
分享
public static void sendImsg(String firstid,String secondid,String content){
try {
String serviceCode = "IM-2008001";
String clientName = "xxxxx";
String servicePwd = "yyyyy";
String fromjid = firstid;
String tojid = secondid;
String msg = content;
String endpoint = "http://62.180.33.138:8080/service/ImService";
String cn = new String(clientName.getBytes("ISO-8859-1"),"UTF-8");
StringBuffer buf = new StringBuffer().append(serviceCode).append(servicePwd)
.append(cn).append(fromjid);
MD5 temp = new MD5();
String md5 = temp.getMD5ofStr(buf.toString());
Service service = new Service(); //每次执行到这就执行不下去了,但也不报错,页面就显示错误
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName("sendGoverMessage");
Object obj = call.invoke(new Object[]{serviceCode,clientName,fromjid,tojid,msg,md5});
System.out.println("Send im message. resutl is "+obj);
}
catch(Exception ex){
ex.printStackTrace();
}
}
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;