就是说服务端要做一个统一的中转站。
解决方案 »
- ECLIPSE如何安装Axis插件
- 我的学习笔记1——基础报表制作1
- 新手求助:编写第一个Spring就出错了……
- 目前java+jsp框架最好用最流行的推送技术是什么啊
- 请问高手!用STRUTS+HIBERNATE编写登陆程序时出现“java.lang.NoClassDefFoundError: org/hibernate/Session”,加上MAIN函数单独运行可
- 值得高手研究的javamail的中文题的搜索问题!
- 关于tomcat5.5配置数据源的问题,请问应该如何配置?多谢了!
- 很简单的小问题,如何调试JAVA
- spring加载很久No Spring WebApplicationInitializer types detected on classpath
- jquery问题
- 用struts2框架和不用框架的情况下怎么配置错误页面
- SHH2整合启动tomcat报错,急求解!!!
public void testClient()
{
String rspXml = "";
final HttpClient httpClient = new HttpClient();
final String url = "http://localhost:8080/SimulateBSS/httpServ.do?model=Simple";
String str = "<servlet><servlet-name>tychoLoader</servlet-name><servlet-class>org.junesky.tycho.servlet.TychoLoaderServlet</servlet-class><cdatatest><![CDATA[function matchwo(a,b){if(a<b&&a<0)then{return 1;}else{return 0;}}]]></catatest><load-on-startup>3</load-on-startup></servlet>";
final String charset = "UTF-8";
final PostMethod method = new PostMethod(url);
//httpClient.getParams().setConnectionManagerTimeout(connTimeOut);
//method.getParams().setSoTimeout(invokeTimeOut);
httpClient.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET, charset); try {
RequestEntity entity = new ByteArrayRequestEntity(str.getBytes(charset));
method.setRequestEntity(entity);
httpClient.executeMethod(method);
rspXml = method.getResponseBodyAsString();
//rspXml = java.net.URLDecoder.decode(rspXml, "UTF-8");
System.out.println(rspXml);
} catch (final HttpException e) {
//throw new BaseException("15", e, new Object[] { url, connTimeOut, invokeTimeOut, charset, data });
} catch (final IOException e) {
//throw new BaseException("16", e, new Object[] { url, connTimeOut, invokeTimeOut, charset, data });
} finally {
method.releaseConnection();
}
对于HTTP POST类服务,你要用SERVLET,
对于SOAP 类服务,你要用hessian,axis2等