客户端:mui.ajax('http://192.168.1.117:8014/SugarProject/ws/personService/login', {
data: {
personID : 'admin',
personPWD : '123'
},
dataType: 'json', //服务器返回json格式数据
type: 'post', //HTTP请求类型
timeout: 10000, //超时时间设置为10秒;
success: function(data) {
//服务器返回响应,根据响应结果,分析是否登录成功;
console.log("登录成功"+data.personName);
},
error: function(xhr, type, errorThrown) {
console.log(xhr.statusText+'#'+errorThrown);
console.log(type);
}
});
Java端为CXF的 WebService,
public String login(String id, String password) {
//。。。。各种代码,通过浏览器显示调用,或者通过SoupUI调用均没问题
}
wsdl地址为:http://192.168.1.117:8014/SugarProject/ws/personService?wsdl
用浏览器实验:http://192.168.1.117:8014/SugarProject/ws/personService/login?personID=admin&personPWD=123
可以进入MyEclipse 的调试模式,并且执行正常,返回json串
而用mui.ajax调用,则MyEclipse报错:
2016-3-6 18:31:25 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
警告: Interceptor has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
。。。。。
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'p' (code 112) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]
HBuilder 报错:
Internal Server Error#Internal Server Error at js/app.js:36
error at js/app.js:37
3 个回复
Nie
你好,这个问题解决了吗?怎么解决的
8***@qq.com
http://ask.csdn.net/questions/391914?sort=votes_count
EaApple
你好,能说一下解决的办法吗 谢谢