【问题标题】:Webservices - Axis2 ClientStub policy errorWebservices - Axis2 ClientStub 策略错误
【发布时间】:2013-08-14 21:40:11
【问题描述】:

尝试使用 AXIS 生成的客户端存根调用 Web 服务。

当我运行我的独立 java 程序时

    Exception in thread "main" java.lang.NullPointerException
    at org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:201)

存根类中的 getPolicy() 方法

return org.apache.neethi.PolicyEngine.getPolicy    (org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(
           new java.io.StringReader(policyString)).getDocument().getXMLStreamReader(false));    

为什么会出现 NullPointerException?

我尝试像下面那样拆分代码。但仍然得到相同的 NullPointerException

 System.out.println("policy String :" + policyString);

    OMXMLParserWrapper omp = org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(
            new java.io.StringReader(policyString));
    System.out.println("Step 2 :" + omp);

    XMLStreamReader omd = omp.getDocument().getXMLStreamReader(false);
    System.out.println("Step 3 " + omd);
    Policy policy = org.apache.neethi.PolicyEngine.getPolicy(omd);
    System.out.println("Step 4");
    return policy;

有没有人遇到过这种错误?非常感谢任何建议

【问题讨论】:

    标签: axis2 axis policy wsdl2java ws-client


    【解决方案1】:

    问题已解决。存根是在防火墙后面生成的,并引发了此异常。我在防火墙之外生成了存根,它就像一个魅力

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-11-26
      • 1970-01-01
      • 1970-01-01
      • 2013-05-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多