Java
一穷二白的豆腐君
此人很笨,什么都不会写
展开
-
使用post方法发送XML数据并解析返回的XML报文
//使用POST方法发送XML数据 Public String senfXMLDataByPost(String url,String xmlData)throws Exception{ CloseableHttpResponse response = null; if(null == url ||””.equals(url)){ return null; } String result = nu...原创 2019-10-25 14:12:52 · 2639 阅读 · 0 评论 -
Tomcat中获取xml文件模版,并修改模版内容,最终生成字符串
使用w3c.dom相关包 Public Document getXml() throws Exception{ try{ //tomcat下,要用InputStream 通过当前类(类名.class)找到xml模版文件的路径,xml文件路径最好放在根目录下的config文件中, InputStream is =javaName.clss.getClassLoader().getResourceAs...原创 2019-10-25 11:32:26 · 152 阅读 · 0 评论 -
将本地xml报文文件转换为String并在后台输出
将本地xml报文文件转换为String并在后台输出 public String transfor() throws Exception{ try{ File file input = new File(“…/…/fileName.xml”); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); Docum...原创 2019-10-18 11:30:38 · 558 阅读 · 0 评论