"org.apache.axis2.AxisFault:未知"用Java调用Web服务时 [英] "org.apache.axis2.AxisFault: unknown" when calling web service with Java

查看:178
本文介绍了"org.apache.axis2.AxisFault:未知"用Java调用Web服务时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Java客户端调用Web服务. WSDL如下所示: http://pastebin.com/m13124ba

I'm trying to call a web service with a Java client. The WSDL looks like this: http://pastebin.com/m13124ba

我的客户:

public class Client{
    public static void main(java.lang.String args[]){
        try{
            CompileAndExecuteServiceInterfaceStub stub =
                new CompileAndExecuteServiceInterfaceStub
                ("http://192.168.1.3:8080/axis2/services/CompileAndExecuteServiceInterface");

            Compile comp = new Compile();
            comp.setArgs0("Test");
            comp.setArgs1("public class Test { public static void main(String[] args) { System.out.println(\"Hello\");}}");
            String[] classpath = {};
            comp.setArgs2(classpath);
            stub.compile(comp);

        } catch(Exception e){
            e.printStackTrace();


        }
    }

}

现在运行客户端时,会发生以下错误:

When I run the client now the following error occurs:

org.apache.axis2.AxisFault: unknown


at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:517)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at de.dax.compileandexecuteclient.CompileAndExecuteServiceInterfaceStub.compile(CompileAndExecuteServiceInterfaceStub.java:184)
at de.dax.compileandexecuteclient.Client.main(Client.java:17)</blockquote>

我在本地计算机上尝试了服务器的业务逻辑,并且在那里工作.该服务创建文件和文件夹.允许Web服务这样做吗?我还编写了一个简单的"Hello World" Web服务并将其部署到服务器.效果很好.

I tried out the business logic of the server on my local machine and there it works. The service creates files and folders. Are web services allowed to do that? I also wrote a simple "Hello World" web service and deployed it to the server. This worked fine.

推荐答案

问题是我的服务中存在NullPointerException.

The problem was that there was an NullPointerException in my service.

这篇关于"org.apache.axis2.AxisFault:未知"用Java调用Web服务时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆