<div class="iteye-blog-content-contain" style="font-size: 14px"></div>
问题:使用axis2调用远程webservice时,产生大量临时文件写入磁盘,降低程序运行效率,占用磁盘空间
前提:使用axis2客户端版本:1.7.4
解决方案:
1:在初始化RPCServiceClient 使用构造器RPCServiceClient(ConfigurationContext configContext, AxisService service) 替换默认构造器
在wsdl生产的java文件中使用ConfigurationContext 的静态化
private static final ConfigurationContext configurationContextStatic = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null)
综合事例:
@Override
public String abc(String reqXml) throws Exception
{
String value="";
RPCServiceClient serviceClient=init();
Object[] toParams = new Object[] {reqXml};