- 浏览: 594786 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (263)
- 默认类别 (0)
- STRUTS HIBERNATE (2)
- STRUTS SPRING HIBERNATE (18)
- SOA/WEB service (8)
- PORTAL (3)
- 想法和设计思想 (17)
- SMARTEAM 二次开发 (0)
- ACTIVEBPEL (0)
- ERP (0)
- EAI (0)
- 甲醇汽油 (0)
- webwork freemarker spring hibernate (1)
- 工作流技术研究 (1)
- ROR (5)
- 搜索引擎 (7)
- 3.非技术区 (0)
- 1.网站首页原创Java技术区(对首页文章的要求: 原创、高质量、经过认真思考并精心写作。BlogJava管理团队会对首页的文章进行管理。) (2)
- 2.Java新手区 (2)
- 4.其他技术区 (0)
- ESB (1)
- Petals ESB (6)
- 手机开发 (1)
- docker dedecms (1)
最新评论
-
w630636065:
楼主,期待后续!!!!!!!!
生成文本聚类java实现 (2) -
zilong513:
十分感谢楼主,期待后续。
生成文本聚类java实现 (2) -
qqgoodluck:
可否介绍一下您的选型依据,包括Petal ESB与MULE等E ...
Petals ESB 简介 -
jackiee_cn:
写的比较清楚,学习了
Petals ESB 集群实战 -
忙两夜:
你好,能发一下源代码吗
抓取口碑网店铺资料
客户有一个需求,发布了一个Web Services,其中一个Function,输入的请求参数是Soap协议的XML文件,通过请求后.会输出一个XML格式的文件.
涉及的技术有Freemaker.
基本的思路是:通过一个连接请求,发送soap方式的XML请求文档,然后通过读取流的方式,返回结果.
private String serviceAddress = "http://localhost:8080/axis/services/Corticon"; private URL webServiceUrl; @PostConstruct private void init() { try { webServiceUrl = new URL(serviceAddress); } catch (MalformedURLException e) { e.printStackTrace(); } } public String processRequest(DialogDecisionInput input) { try { cfg.setClassForTemplateLoading(this.getClass(), "/"); cfg.setObjectWrapper(new DefaultObjectWrapper()); cfg.setNumberFormat("################"); // Get and config the connection. HttpURLConnection conn; conn = (HttpURLConnection) webServiceUrl.openConnection(); conn.setDoOutput(true); conn.setDoInput(true); conn.setRequestMethod("POST"); conn.setUseCaches(false); conn.setRequestProperty("Content-Type", "text/xml; charset=utf-8"); conn.setRequestProperty("SOAPAction", "Corticon"); Map root = new HashMap(); root.put("model", input); Template template = cfg.getTemplate("soapRequest.ftl"); OutputStream os = conn.getOutputStream(); Writer out = new BufferedWriter(new OutputStreamWriter(os, "utf-8")); template.process(root, out); out.flush(); out.close(); // Get the soap response. InputStream is = conn.getInputStream(); String rc = IOUtils.toString(is); return rc; } catch (TemplateException e) { StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); corticonlogger.error("[E00004]" + E00004 + "\n" + sw); } catch (IOException e1) { StringWriter sw = new StringWriter(); e1.printStackTrace(new PrintWriter(sw)); corticonlogger.error("[E00003]" + E00003 + "\n" + sw); } return null; }
呵呵,因为Freemarker的process默认是要写到一个文件当中.增加了IO的操作,比较慢,所以我的另外一篇文章也写了:
Freemarker输出字符串而不是文件
或者参考如下的代码:
private String serviceAddress = "http://localhost:8080/axis/services/Corticon"; private URL webServiceUrl; @PostConstruct private void init() { try { webServiceUrl = new URL(serviceAddress); } catch (MalformedURLException e) { e.printStackTrace(); } } public DialogDecisionService() { // Get and config the connection. cfg.setClassForTemplateLoading(this.getClass(), "/"); cfg.setObjectWrapper(new DefaultObjectWrapper()); cfg.setNumberFormat("################"); cfg.setCacheStorage(new freemarker.cache.MruCacheStorage(20, 250)); } public String processRequest(DialogDecisionInput input) { try { HttpURLConnection conn; conn = (HttpURLConnection) webServiceUrl.openConnection(); conn.setDoOutput(true); conn.setDoInput(true); conn.setRequestMethod("POST"); conn.setUseCaches(false); conn.setRequestProperty("Content-Type", "text/xml; charset=utf-8"); conn.setRequestProperty("SOAPAction", "Corticon"); Map root = new HashMap(); root.put("model", input); Template template = cfg.getTemplate("soapRequest.ftl"); /** * StringWriter instead of Writer * Class StringWriter contains a StringBuffer which can be rendered toString * modify by heweiya */ OutputStream os = conn.getOutputStream(); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, "utf-8")); template.setEncoding("UTF-8"); cfg.setDefaultEncoding("UTF-8"); template.process(root, writer); writer.flush(); writer.close(); // Get the soap response. InputStream is = conn.getInputStream(); String rc = IOUtils.toString(is); return rc; } catch (TemplateException e) { StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); corticonlogger.error("[E00004]" + E00004 + "\n" + sw); } catch (IOException e1) { StringWriter sw = new StringWriter(); e1.printStackTrace(new PrintWriter(sw)); corticonlogger.error("[E00003]" + E00003 + "\n" + sw); } corticonlogger.error("[E00004]" + E00004 + "\n"); return null; }
发送的XML文件格式如下:
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SOAP-ENV:Body> <CorticonRequest xmlns="urn:Corticon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" decisionServiceName="diabetes"> <WorkDocuments> <D_diabetes id="D_diabetes_id_1"> <currentPage>p_medInfo</currentPage> <dialogId>3</dialogId> <dialogInstanceId>771</dialogInstanceId> <displayTitle>Pediatric Diabetes Screening Tool</displayTitle> <function>screen</function> <lastQuestionAnswered>q_sex</lastQuestionAnswered> <locale /> <noOfChangedFlags>0</noOfChangedFlags> <productLine>Loan</productLine> <refId>D-00012</refId> <region>region 1</region> <sessionId xsi:nil="1" /> <version>1</version> <p_medInfo id="P_medInfo_id_1"> <displayTitle>Diabetes Screening - Info</displayTitle> <helpText></helpText> <pageId>7</pageId> <refId>D-00012</refId> <version>1</version> <q_sex id="Q_sex_id_1"> <displayFlag>true</displayFlag> <helpText></helpText> <questionId>41</questionId> <questionText>Sex</questionText> <refId>D-00012</refId> <responseType>Custom</responseType> <uiControl>Radio Button</uiControl> <sequence>1.2</sequence> <version>1</version> <pageQuestionId>44</pageQuestionId> <response id="R_sex_id_13" Type="R_sex"> <responseId>74</responseId> <respEnabled xsi:nil="1" /> <respLabel>Female</respLabel> <respSelected>false</respSelected> <respSeq>3</respSeq> <respValue>F</respValue> </response> <response id="R_sex_id_22" Type="R_sex"> <responseId>73</responseId> <respEnabled xsi:nil="1" /> <respLabel>Male</respLabel> <respSelected>true</respSelected> <respSeq>2</respSeq> <respValue>M</respValue> </response> </q_sex> <q_medIntro id="Q_medIntro_id_7"> <displayFlag>true</displayFlag> <helpText></helpText> <questionId>39</questionId> <questionText>We are asking a few extra questions in order to assess special risks in our new members. I would like to get some additional information about your child. This will just take a couple of minutes.</questionText> <refId>D-00012</refId> <responseType>No response</responseType> <uiControl xsi:nil="1" /> <version>1</version> <sequence>1</sequence> <pageQuestionId>40</pageQuestionId> <response id="R_medIntro_id_101" Type="R_medIntro"> <respEnabled xsi:nil="1" /> <respLabel xsi:nil="1" /> <respSelected xsi:nil="1" /><respValue></respValue> </response> </q_medIntro> <q_age id="Q_age_id_8"> <displayFlag>true</displayFlag> <helpText></helpText> <questionId>40</questionId> <questionText>Current Age</questionText> <refId>D-00012</refId> <responseType>Custom</responseType> <uiControl>Text Box</uiControl> <version>1</version> <sequence>1.1</sequence> <pageQuestionId>45</pageQuestionId> <response id="R_age_id_102" Type="R_age"> <respEnabled xsi:nil="1" /> <respLabel xsi:nil="1" /> <respSelected xsi:nil="1" /><respValue>0</respValue> </response> </q_age> <q_weight id="Q_weight_id_9"> <displayFlag>true</displayFlag> <helpText></helpText> <questionId>42</questionId> <questionText>Weight</questionText> <refId>D-00012</refId> <responseType>Custom</responseType> <uiControl>Text Box</uiControl> <version>1</version> <sequence>1.3</sequence> <pageQuestionId>43</pageQuestionId> <response id="R_weight_id_103" Type="R_weight"> <respEnabled xsi:nil="1" /> <respLabel xsi:nil="1" /> <respSelected xsi:nil="1" /><respValue>0</respValue> </response> </q_weight> <q_heightFeet id="Q_heightFeet_id_10"> <displayFlag>true</displayFlag> <helpText></helpText> <questionId>43</questionId> <questionText>Height - Feet</questionText> <refId>D-00012</refId> <responseType>Custom</responseType> <uiControl>Text Box</uiControl> <version>1</version> <sequence>1.4</sequence> <pageQuestionId>42</pageQuestionId> <response id="R_heightFeet_id_104" Type="R_heightFeet"> <respEnabled xsi:nil="1" /> <respLabel xsi:nil="1" /> <respSelected xsi:nil="1" /><respValue>0</respValue> </response> </q_heightFeet> <displayFlag>true</displayFlag> <helpText></helpText> <questionId>44</questionId> <questionText>Height - Inches</questionText> <refId>D-00012</refId> <responseType>Custom</responseType> <uiControl>Text Box</uiControl> <version>1</version> <sequence>1.5</sequence> <pageQuestionId>41</pageQuestionId> <response id="R_heightInches_id_105" Type="R_heightInches"> <respEnabled xsi:nil="1" /> <respLabel xsi:nil="1" /> <respSelected xsi:nil="1" /><respValue>0</respValue> </response> </q_heightInches> </p_medInfo> <displayTitle></displayTitle> <helpText></helpText> <pageId>9</pageId> <refId>D-00012</refId> <version>1</version> <q_findingsIntro id="Q_findingsIntro_id_9"> <displayFlag xsi:nil="1" /> <helpText></helpText> <questionId>50</questionId> <questionText>Recap:</questionText> <refId>D-00012</refId> <responseType>No response</responseType> <uiControl xsi:nil="1" /> <version>1</version> <sequence>1</sequence> <pageQuestionId>60</pageQuestionId> <response id="R_findingsIntro_id_103" Type="R_findingsIntro"> <respEnabled xsi:nil="1" /> <respLabel xsi:nil="1" /> <respSelected xsi:nil="1" /> <respValue></respValue> </response> </q_findingsIntro> </p_findings> </D_diabetes> </WorkDocuments> </CorticonRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
发表评论
-
Petals ESB 开发之一 代理Web Service
2014-01-13 16:13 1648今天要做的工作有如下三个: ... -
Petals ESB 安装部署
2014-01-12 13:37 1612本文档主要有三个内容。 1)P ... -
Petals ESB 简介
2014-01-12 11:43 2118Petal ESB 是一个 ... -
IBM MQ轶事-误删scratch和active日志怎么办?
2011-11-30 11:39 15931,误删scratch下面的文件后,会造成通道不通。STA ... -
错误: 必须限制口令文件读取访问 解决方法
2011-04-22 16:22 6021我在使用activeMQ时,加入有权限的RMI时,发生 ... -
请求远程服务传参和过大参数的函数
2009-10-10 12:26 1254两个Code,第一个函数是普通请求,Like:http ... -
JAVA处理含有DataSet的web services
2006-12-14 14:08 7592本篇文章将讲述如何通过axis取得.net发布的 ...
相关推荐
实验-三、数据库安全性(目的、要求和模板).doc
基于Docker搭建K8s集群离线包,包含部署时所需的全部文件,可在内网环境中使用,K8s为1.23.0版本,docker为20.10.9-3版本
基于springboot+vue实现的求职招聘类型网站源代码+数据库(优质毕设项目).zip个人经导师指导并认可通过的98分毕业设计项目,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者。也可作为课程设计、期末大作业。包含全部项目源码、该项目可以直接作为毕设使用。项目都经过严格调试,确保可以运行! 基于springboot+vue实现的求职招聘类型网站源代码+数据库(优质毕设项目).zip个人经导师指导并认可通过的98分毕业设计项目,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者。也可作为课程设计、期末大作业。包含全部项目源码、该项目可以直接作为毕设使用。项目都经过严格调试,确保可以运行! 基于springboot+vue实现的求职招聘类型网站源代码+数据库(优质毕设项目).zip个人经导师指导并认可通过的98分毕业设计项目,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者。也可作为课程设计、期末大作业。包含全部项目源码、该项目可以直接作为毕设使用。项目都经过严格调试,确保可以运行!基于springboot+vue实现的求
基于Android系统Api封装常用工具类.zip
svm 基于PCA(主成分分析)和SVM(支持向量机)的人脸识别是一种常见的方法。这里是一个简要说明: PCA(主成分分析): PCA是一种降维技术,它通过线性变换将高维数据转换为低维数据,同时保留最大的数据方差。 在人脸识别中,PCA被用来提取人脸图像中的主要特征,从而减少数据的维度,并保留最重要的信息。 SVM(支持向量机): SVM是一种监督学习算法,用于分类和回归分析。 在人脸识别中,SVM被用来构建一个分类器,以将提取的人脸特征映射到相应的人脸身份标签。 基于PCA和SVM的人脸识别流程: 训练阶段: 收集训练数据集,包括多个人的人脸图像和相应的标签。 对每个人脸图像应用PCA,将其转换为低维特征向量。 使用这些特征向量训练一个SVM分类器,使其能够将人脸特征向量与相应的人脸标签关联起来。 测试阶段: 对待识别的人脸图像应用相同的PCA转换,将其转换为与训练数据相同的低维特征向量。 使用训练好的SVM分类器,将待识别的人脸特征向量与已知的人脸标签进行比较,从而确定其身份。 优点: PCA可以有效地降低数据的维度,减少计算复杂度,并提取最相关的特征。 SVM在处理
PPT模板,答辩PPT模板,毕业答辩,学术汇报,母校模板,我给母校送模板作品,周会汇报,开题答辩,教育主题模板下载。PPT素材下载。
Java SE Development Kit 11.0.23 macOS x64 DMG Installer
【资源说明】【毕业设计】 1、该资源内项目代码都是经过测试运行成功,功能正常的情况下才上传的,请放心下载使用。 2、适用人群:主要针对计算机相关专业(如计科、信息安全、数据科学与大数据技术、人工智能、通信、物联网、数学、电子信息等)的同学或企业员工下载使用,具有较高的学习借鉴价值。 3、不仅适合小白学习实战练习,也可作为大作业、课程设计、毕设项目、初期项目立项演示等,欢迎下载,互相学习,共同进步!
studyopencv2
实验五-使用matlab实现卷积的运算.pdf
2024年中国纸杯蛋糕盒行业研究报告
matplotlib绘图 通过 Matplotlib,开发者可以仅需要几行代码,便可以生成绘图、直方图、功率谱、条形图、错误图、散点图等。 Matplotlib基础知识 1.Matplotlib中的基本图表包括的元素 x轴和y轴 水平和垂直的轴线 x轴和y轴刻度 刻度标示坐标轴的分隔,包括最小刻度和最大刻度 x轴和y轴刻度标签 表示特定坐标轴的值 绘图区域 实际绘图的区域 2.hold属性 hold属性默认为True,允许在一幅图中绘制多个曲线;将hold属性修改为False,每一个plot都会覆盖前面的plot。 但是不推荐去动hold这个属性,这种做法(会有警告)。因此使用默认设置即可。 3.网格线 grid方法 使用grid方法为图添加网格线 设置grid参数(参数与plot函数相同) .lw代表linewidth,线的粗细 .alpha表示线的明暗程度 4.axis方法 如果axis方法没有任何参数,则返回当前坐标轴的上下限 5.xlim方法和ylim方法 除了plt.axis方法,还可以通过xlim,ylim方法设置坐标轴范围
高分设计源码,详情请查看资源内容中使用说明 高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明高分设计源码,详情请查看资源内容中使用说明
springboot框架 一、Spring Boot基础应用 Spring Boot特征 概念: 约定优于配置,简单来说就是你所期待的配置与约定的配置一致,那么就可以不做任何配置,约定不符合期待时才需要对约定进行替换配置。 特征: 1. SpringBoot Starter:他将常用的依赖分组进行了整合,将其合并到一个依赖中,这样就可以一次性添加到项目的Maven或Gradle构建中。 2,使编码变得简单,SpringBoot采用 JavaConfig的方式对Spring进行配置,并且提供了大量的注解,极大的提高了工作效率,比如@Configuration和@bean注解结合,基于@Configuration完成类扫描,基于@bean注解把返回值注入IOC容器。 3.自动配置:SpringBoot的自动配置特性利用了Spring对条件化配置的支持,合理地推测应用所需的bean并自动化配置他们。 4.使部署变得简单,SpringBoot内置了三种Servlet容器,Tomcat,Jetty,undertow.我们只需要一个Java的运行环境就可以跑SpringBoot的项目了
CUDA规约求和.cu
工程有限公司计算机信息系统数据信息安全管理办法.doc
小学教育信息化工作计划.doc
springboot停车位管理源码.rarspringboot停车位管理源码.rarspringboot停车位管理源码.rar
实验七-管道通信.doc
YOLO高分设计资源源码,详情请查看资源内容中使用说明 YOLO高分设计资源源码,详情请查看资源内容中使用说明 YOLO高分设计资源源码,详情请查看资源内容中使用说明 YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明