小编Mar*_*tti的帖子

通过代理连接到 AXIS 1.4 Web 服务

我正在使用 AXIS 1.4 为我的网络服务生成 subs。这一代工作正常,但我面临着通过 WebProxy 连接到 Web 服务的问题。

我使用axistools-maven-plugin 来生成我的轴类。

   <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<version>1.4</version>
<configuration>
 <urls>
  <url>http://mywiki/rpc/soap-axis/confluenceservice-v1?wsdl</url>
 </urls>

 <outputDirectory>${project.build.directory}/generated-wsdl-sources</outputDirectory>
 <packageSpace>de.allianz.wsdl.confluence</packageSpace>
 <testCases>false</testCases>
 <serverSide>false</serverSide>
 <subPackageByFileName>false</subPackageByFileName>
</configuration>
<executions>
 <execution>
  <id>add wsdl source</id>
  <phase>generate-sources</phase>
  <goals>
   <goal>wsdl2java</goal>
  </goals>
 </execution>
</executions>
<dependencies>
 <dependency>
  <groupId>axis</groupId>
  <artifactId>axis</artifactId>
  <version>1.4</version>
 </dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)

如果我在连接之前使用以下属性 - 一切正常,但我设置了 VM 范围内的属性,这是不可取的:

 public void setProxyHost(String proxyHost) {
  this.proxyHost = proxyHost;
  if(proxyHost != null){
   System.setProperty("http.proxyHost", proxyHost);
   AxisProperties.setProperty("http.proxyHost", proxyHost);  

  }  
 }

 public void setProxyPort(int proxyPort) {
  this.proxyPort = proxyPort;
  System.setProperty("http.proxyPort", ""+proxyPort);
  AxisProperties.setProperty("http.proxyPort", ""+proxyPort);  
 }
Run Code Online (Sandbox Code Playgroud)

有什么方法可以告诉轴生成源以通过代理连接吗?(我已经阅读了有关在生成源(以访问 WSDL)时如何指定代理的信息,但这不是我所需要的 …

axis web-services webservices-client

4
推荐指数
1
解决办法
1万
查看次数

在Apache POI公式中引用工作表

我正在使用Apache POI 3.6生成excel(2003)表.我想在一个单元格中插入一个公式,该单元格计算几张纸上某些单元格的总和.

我有名为a,b和c的表,并且想要计算单元格A1的总和

我试过了:

cell.setCellFormula("a!A1+b!A1+c!A1");
Run Code Online (Sandbox Code Playgroud)

POI不会产生任何错误,但是当我打开工作表时,我在OpenOffice中收到错误:

Err: 522 - =$#REF!.A1+$#REF!.A1+$#REF!.A1
Run Code Online (Sandbox Code Playgroud)

我做了一些研究,显然在引用多张表时存在错误.(例如https://issues.apache.org/bugzilla/show_bug.cgi?id=46670)有没有人知道如何在POI中使用多张表格的公式?

- - - - - - - 源代码 - - - - - - - - - -

public static void main(String args[]){
    Workbook wb = new HSSFWorkbook();
    CreationHelper createHelper = wb.getCreationHelper();
    Sheet sheet = wb.createSheet("Total");

    Row row = sheet.createRow((short)0);
    Cell cell = row.createCell(0);

    cell.setCellFormula("a!A1+b!A1+c!A1");

    Sheet sheet1 = wb.createSheet("a");
    Sheet sheet2 = wb.createSheet("b");
    Sheet sheet3 = wb.createSheet("c");
    Sheet sheet4 = wb.createSheet("d");

    createVal(sheet1, createHelper, 5);
    createVal(sheet2, createHelper, …
Run Code Online (Sandbox Code Playgroud)

java excel formula excel-2003 apache-poi

2
推荐指数
1
解决办法
4998
查看次数