代码执行到这一句就不往下执行了String endpoint = "http://X.X.X.X:X/services/DxptMessageService"
public int sendMsg(String phoneNum, String msg) {try {
String user="user";
String password="password";
String sjhm="sjhm";
String content="content";
String xml = "<?xml version='1.0' encoding='GBK'?><business id='net.htjs.send.message' comment='短信发送接口'><security><user>XXXXXXX</user><password>XXXXXX</password></security><group>" ;
xml =xml+"<message><sjhm>"+phoneNum+"</sjhm><content>"+msg+"</content></message>";
xml = xml+"</group></business>";
String endpoint = "http://XX.XX.XX.XX:XX/services/DxptMessageService";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName("SendMessage");
Object[] obj = new Object[]{xml};
String result = call.invoke(obj).toString();
if(result.contains("<returnmessage>成功</returnmessage>")){
return 0;
}else if(result.contains("<returnmessage>用户名密码错误</returnmessage>")){
return 2;
}else if(result.contains("<returnmessage>发送人手机号码非法</returnmessage>")){
return 4;
}else if(result.contains("<returnmessage>手机号码为空</returnmessage>")){
return 3;
}else if(result.contains("<returnmessage>用户名不存在</returnmessage>")){
return 1;
}else if(result.contains("<returnmessage>发送失败</returnmessage>")){
return 99;
}
return 99;
} catch (Exception e) {
e.printStackTrace();
return 99;
}
}
请帮忙看看代码有什么问题? --------------------编程问答-------------------- 把错误提示信息帖出来看看 --------------------编程问答-------------------- 关键没有错误提示,运行到这一行就不运行了Service service = new Service(); --------------------编程问答-------------------- debug跟一下,看看具体到哪一步了,貌似是借口的问题吧 --------------------编程问答-------------------- 你再仔细debug吧,这种奇特的情况,不可能发生.
除非你编译环境出问题了,不然,就是你没有细心留意.
补充:Java , Web 开发