Java Web服务框架(Java Web Services framework)
我有以下场景:我必须实现Web服务客户端,它将为不同的Web服务提供者提供各种wsdl-s。 即使是同一个提供商也可以拥有我必须支持的不同版本的wsdl-s。 我们正在使用带有spring的java,因此我在考虑spring-ws框架。 但似乎,作为实现的一部分,我必须将wsdl导入到我的项目中,并根据导入pojo-s的一部分创建代码。 因此,不同提供商的不同代码没有问题,因为逻辑是不同的。 但我更喜欢为同一个提供程序的不同版本使用相同的代码,并避免创建不同版本的pojo-s。 所以,我正在寻找类似于python的suds库的东西。 你只需要提供特定的wsdl并拨打电话。 你不处理wsdl import和同一提供者的不同版本的wsdl - 如果需要,只需要调整ws调用的参数列表。 最好是,如果春天可以做类似的事情 - 也许我只是没有意识到,因为现在我们正在试图摆脱Axis和Axis-2。
I have the following scenario: I have to implement web services client that will serve different web services providers with various wsdl-s. Even the same provider can have different versions of wsdl-s that I'll have to support. We are using java with spring, therefore I was thinking about spring-ws framework. But it seems, that as part of implementation, I have to import wsdl into my project and to write code based on created as part of import pojo-s. So, no problem with different code for different providers, since the logic is different. But I prefer to have the same code for different versions of the same provider and to avoid creation of different versions of pojo-s. So, I'm looking for something similar to suds library for python. There you just provide particular wsdl and make a call. You don't deal with wsdl import and different versions of wsdl of the same provider - just need to adjust parameter list of ws call if needed. Preferable, if spring-ws can do something similar - maybe I just didn't realize that, since now we are trying to get rid of Axis and Axis-2.
原文:https://stackoverflow.com/questions/35561331
最满意答案
您可以在Java中使用System属性 。 假设在文件路径中使用
"user.home"
,以便将文件放在用户主目录中。 您无需在两者之间切换例如:
File file = new File(System.getProperty("user.home")+File.separator+ "Carrier_BackUp_Restore.sql");
通过@EJP注释添加另一种方法以避免文件分隔符
File file = new File(System.getProperty("user.home"), "Carrier_BackUp_Restore.sql");
You can make use of the System properties in Java. Say suppose Use
"user.home"
in your file path so that the file will be placed in the user home directory. You don't have to switch in betweenEx:
File file = new File(System.getProperty("user.home")+File.separator+ "Carrier_BackUp_Restore.sql");
Adding another way by @EJP comment to avoid file separator
File file = new File(System.getProperty("user.home"), "Carrier_BackUp_Restore.sql");
相关问答
更多-
您应该能够使用plink在Unix机器上运行命令,就像在另一台使用ssh的unix机器上运行一个unix命令一样。 例如 plink user@host "ls" 将在host上运行ls 同样: plink user@host "/absolute/path/to/script/on/unix/machine/script.sh" 应该在host上运行script.sh 。 您可以在本地构建要在unix机器上运行的命令(包括脚本的任何参数,如数据文件的路径名),然后使用plink运行命令,如上所述。 如 ...
-
像这样的东西: i=1 for f in file*; do mv "$f" file$i i=$((i+1)) done Something like that: i=1 for f in file*; do mv "$f" file$i i=$((i+1)) done
-
UNIX找到找不到特定扩展名的文件名?(UNIX find for finding file names NOT ending in specific extensions?)[2023-04-25]
或者没有(和需要逃脱它: find . -not -name "*.exe" -not -name "*.dll" 并排除目录列表 find . -not -name "*.exe" -not -name "*.dll" -not -type d 或正面逻辑;-) find . -not -name "*.exe" -not -name "*.dll" -type f Or without ( and the need to escape it: find . -not -name "*.exe" - ... -
确实,checkout normalizePath : normalizePath(path, winslash = "\\", mustWork = NA) 明确说明: 在Windows上,它将相对路径转换为绝对路径, 将 路径元素的短名称 转换 为长名称,并确保分隔符由winslash指定。 它将不区分大小写地匹配路径并返回规范案例。 可以使用在当前语言环境中无效的UTF-8编码路径。 Indeed, checkout normalizePath: normalizePath(path, winsla ...
-
1 。 是否有Windows和Unix系统常用扩展名列表? 但就我而言,它主要用于Windows。 是的,加载,遍布互联网: http : //www.google.com/search?q = common + file +extensions 2 。 并且可以安全地假设Windows中的所有文件名都应该有一个以三个字母字符结尾的扩展名吗? 不,在Windows中使用'.c' , '.java'等是完全可能的。 1. Is there a list of commonly used extension f ...
-
您最好的选择是使用能够“与Windows对话”的库。 还有一个: JCIFS ,由Samba的优秀人员提供。 链接到javadoc 这里 。 Your best bet is to use a library which is able to "talk Windows". And there is one: JCIFS, by the good folks at Samba. Link to javadoc here.
-
编辑 - 使用Tomcat作为Windows服务 我已经使用文档将Tomcat作为Windows服务安装。 然后我从Tomcat的bin目录运行这个命令行: "tomcat7.exe" //US//Tomcat7 ++JvmOptions=-Xloggc:gc-%DATE:~-4%.%DATE:~4,2%.%DATE:~7,2%_%TIME:~0,2%.%TIME:~3,2%.%TIME:~6,2%.log 注意: //US是更新服务命令。 Tomcat7是服务的名称。 然后重新启动服务,现在日志路径被正 ...
-
我实际上并不知道bla/bla/bla/Prefix@invoice.csv所指的是什么; 是bla/bla/bla/bla所有目录,文件名是Prefix@invoice.csv吗? 假设我已正确理解您的文件名,我建议使用File.split() : irb> (path, name) = File.split("bla/bla/bla/Prefix@invoice.csv") => ["bla/bla/bla", "Prefix@invoice.csv"] irb> (prefix, postfix) = ...
-
您可以在Java中使用System属性 。 假设在文件路径中使用"user.home" ,以便将文件放在用户主目录中。 您无需在两者之间切换 例如: File file = new File(System.getProperty("user.home")+File.separator+ "Carrier_BackUp_Restore.sql"); 通过@EJP注释添加另一种方法以避免文件分隔符 File file = new File(System.getProperty("user.home"), "C ...
-
我找到了解决这个问题的方法。 代码为FYI: public static String getFileType(String filePath){ String fileType =""; int count=0; FileInputStream in=null; try{ in =new FileInputStream(filePath); StringBuffer systemFormat = new StringBuffer(); ...