WebService服务 Windows 下 java httpPost调用正常,linux 下调用失败

+N一米阳光 2019-09-27 09:51:54
WebService服务 Windows 下 java httpPost调用正常,linux 下调用失败 报500错

java.lang.RuntimeException: java.lang.RuntimeException: 500:Internal Server Error

StringBuffer sb = new StringBuffer();
sb.append("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tem=\"http://tempuri.org/\">");
sb.append("<soapenv:Header/>");
sb.append("<soapenv:Body>");
sb.append("<tem:"+action+">");
sb.append("<tem:carrCd>JD</tem:carrCd>");
sb.append("<tem:isEncrypt>false</tem:isEncrypt>");
sb.append("<tem:guid>").append(guid).append("</tem:guid>");
sb.append("<tem:requestData>").append(msg).append("</tem:requestData>");
sb.append("</tem:"+action+">");
sb.append("</soapenv:Body>");
sb.append("</soapenv:Envelope>");
HttpClient client=new HttpClient();
PostMethod postMethod=new PostMethod(soapBindingAddress);
//3.设置请求参数
postMethod.setRequestBody(sb.toString());
// postMethod.setParameter("mobileCode", mobileCode);
// postMethod.setParameter("userID", userID);
//修改请求的头部
postMethod.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
//4.执行请求 ,结果码
int code=client.executeMethod(postMethod);
//5. 获取结果
String result ="";
if(code==200) {
result=postMethod.getResponseBodyAsString();
result=parseXml(new ByteArrayInputStream(result.getBytes()));
}
logger.info("httpPost code="+code+", "+result);
...全文
239 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
正怒月神 2019-09-27
  • 打赏
  • 举报
回复
把详细日志也输出出来看

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧