什么时候发生javax.xml.ws.soap.SOAPFaultException?

时间:2016-09-12 03:30:20

标签: java web-services jax-ws

我调用端口名称 getDUNSProfile()的代码如下所示:

public class LookupRequestProcessor 
{
  protected GetCleanseMatchResponse sendRequest(Request request) throws Exception_Exception, GetDUNSProfileFault, PayloadException
  {
    return DNBPortUtil.getDunsService().getDUNSProfile();
  }
}

我收到如下的异常(使用完整的堆栈跟踪更新)

    java.lang.Error: javax.xml.ws.soap.SOAPFaultException: Error in operation: 
        at imx.svb.module.getdunsprofile.LookupRequestProcessor.doWork(LookupRequestProcessor.java:478)
        at imx.svb.TemplateDatablockProcessor.run(TemplateDatablockProcessor.java:63)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.ws.soap.SOAPFaultException: Error in operation: 
        at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:197)
        at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:130)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:125)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:95)
        at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:136)
        at com.sun.proxy.$Proxy97.getDUNSProfile(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at weblogic.wsee.jaxws.spi.ClientInstanceInvocationHandler.invoke(ClientInstanceInvocationHandler.java:84)
        at com.sun.proxy.$Proxy98.getDUNSProfile(Unknown Source)
        at imx.svb.module.getdunsprofile.LookupRequestProcessor.sendRequest(LookupRequestProcessor.java:258)
        at imx.svb.module.getdunsprofile.LookupRequestProcessor.doWork(LookupRequestProcessor.java:472)

这是否意味着我成功拨打了该端口?还是还没达到?
WS服务器返回的异常消息是操作错误吗?

1 个答案:

答案 0 :(得分:1)

你有机会到达港口。引用the documentation of the Faultthis thread on code ranch似乎表明服务提供商正在引发错误。在您的代码中,您可以添加一个块来捕获Exception并在调用时获取SOAPFault。如果故障得到妥善处理,理想情况下应该为您提供原因/代码,说明异常发生的原因。