连接到MS Exchange时出现soap错误

时间:2012-03-05 17:20:44

标签: java exception soap exchangewebservices

我正在尝试通过soap连接到MS Exchange服务器,但我收到以下错误。这适用于另一台计算机或多或少exakt相同的环境(eclipse上的次要版本差异等),我们在计算机上使用不同的AD帐户。有没有人见过这个,可以暗示可能出现的问题?

交换连接所需的部分代码:

@WebServiceClient(name = "ExchangeWebService", targetNamespace = "http://schemas.microsoft.com/exchange/services/2006/messages", wsdlLocation = "mysourceadress/exchange.wsdl")
public class ExchangeWebService
    extends Service
{

    private final static URL EXCHANGEWEBSERVICE_WSDL_LOCATION;
    private final static Logger logger = Logger.getLogger(se.ports.webservices.generatedWSDL.ExchangeWebService.class.getName());

    static {
        URL url = null;
        try {   
            URL baseUrl = se.ports.webservices.generatedWSDL.ExchangeWebService.class.getResource(".");
            url = new URL(baseUrl, "../exchange.wsdl");
        } catch (MalformedURLException e) {
            logger.warning("Failed to create URL for the wsdl Location:'"+ url +"', retrying as a local file");
            logger.warning(e.getMessage());
        }
        EXCHANGEWEBSERVICE_WSDL_LOCATION = url;
    }

    public ExchangeWebService(URL wsdlLocation, QName serviceName) {
        super(wsdlLocation, serviceName);
    }


javax.xml.ws.soap.SOAPFaultException: Can't find input stream in message
           at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)
           at $Proxy48.findItem(Unknown Source)
           at se.ports.webservices.io.ItemTypeDAO.getFolderItems(ItemTypeDAO.java:44)
           at se.ports.webservices.access.ExchangeFacade.getAllEmails(ExchangeFacade.java:38)
           at se.ports.webservices.utils.ExchangeFacadeTest.getAllEmails(ExchangeFacadeTest.java:25)
           at se.ports.webservices.ExchangeTests.test_single_exchangefacade_try_exchange_connection(ExchangeTests.java:34)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
           at org.testng.internal.Invoker.invokeMethod(Invoker.java:699)
           at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:891)
           at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1215)
           at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
           at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
           at org.testng.TestRunner.privateRun(TestRunner.java:758)
           at org.testng.TestRunner.run(TestRunner.java:613)
           at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
           at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
           at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
           at org.testng.SuiteRunner.run(SuiteRunner.java:240)
           at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
           at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)
           at org.testng.TestNG.runSuitesSequentially(TestNG.java:1170)
           at org.testng.TestNG.runSuitesLocally(TestNG.java:1095)
           at org.testng.TestNG.run(TestNG.java:1007)
           at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:109)
           at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:202)
           at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:173)
Caused by: java.lang.RuntimeException: Can't find input stream in message
           at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
           at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
           at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
           at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
           at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
           at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
           at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
           at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
           at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
           at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
           at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
           at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
           at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
           at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
           at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
           at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
           ... 29 more

更新

因此经过大量的试验和错误测试后,我逐渐意识到问题是其中一台计算机使用jdk7运行,这会失败,而其他计算机运行jdk6并且运行良好(我还添加了)工作计算机上的jdk7然后它们也失败了)。我试图通过从jdk7重新运行wsimport来解决这个问题,但是仍然为jdk7提供相同的错误并且完全打破了jdk6计算机。有人怎么解决这个问题?


因此经过大量的试验和错误测试后,我逐渐意识到问题是其中一台计算机使用jdk7运行,这会失败,而其他计算机运行jdk6并且运行良好(我还添加了)工作计算机上的jdk7然后它们也失败了)。我试图通过从jdk7重新运行wsimport来解决这个问题,但是仍然为jdk7提供相同的错误并且完全打破了jdk6计算机。有人怎么解决这个问题?

0 个答案:

没有答案