2016-12-12 91 views
0

當我從Web服務調用EWS Java API時,出現錯誤。 完整的堆棧跟蹤如下。 僅供參考,com.ixbat.synchroexchangews是我們的網絡服務。它調用JAR(synchroexchange。*),它調用EWS API。EWS API Java:請求失敗。 null

是否可以從其他Web服務調用EWS API? 爲什麼會發生此錯誤?

microsoft.exchange.webservices.data.core.exception.service.remote.ServiceRequestException: The request failed. null 
at microsoft.exchange.webservices.data.core.request.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:74) 
at microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:158) 
at microsoft.exchange.webservices.data.core.ExchangeService.internalCreateItems(ExchangeService.java:598) 
at microsoft.exchange.webservices.data.core.ExchangeService.createItem(ExchangeService.java:657) 
at microsoft.exchange.webservices.data.core.service.item.Item.internalCreate(Item.java:245) 
at microsoft.exchange.webservices.data.core.service.item.Item.save(Item.java:386) 
at synchroexchange.ExtendedTask.create(ExtendedTask.java:108) 
at synchroexchange.ExchangeManager.wsPropagerAction(ExchangeManager.java:734) 
at synchroexchange.ExchangeManager.wsPropagerAction(ExchangeManager.java:702) 
at com.ixbat.synchroexchangews.SynchroExchangews.propagerAction(SynchroExchangews.java:152) 
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.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:117) 
at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:91) 
at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:149) 
at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:88) 
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136) 
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050) 
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019) 
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877) 
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:419) 
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:868) 
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:422) 
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:169) 
at weblogic.wsee.jaxws.WLSServletAdapter.handle(WLSServletAdapter.java:199) 
at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:640) 
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363) 
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146) 
at weblogic.wsee.util.ServerSecurityHelper.authenticatedInvoke(ServerSecurityHelper.java:108) 
at weblogic.wsee.jaxws.HttpServletAdapter$3.run(HttpServletAdapter.java:284) 
at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:293) 
at weblogic.wsee.jaxws.JAXWSServlet.doRequest(JAXWSServlet.java:128) 
at weblogic.servlet.http.AbstractAsyncServlet.service(AbstractAsyncServlet.java:99) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:844) 
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280) 
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254) 
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136) 
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346) 
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25) 
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79) 
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:137) 
at java.security.AccessController.doPrivileged(Native Method) 
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315) 
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460) 
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:120) 
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:217) 
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:81) 
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79) 
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:220) 
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79) 
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3436) 
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402) 
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) 
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) 
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57) 
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285) 
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201) 
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179) 
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572) 
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255) 
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311) 
at weblogic.work.ExecuteThread.run(ExecuteThread.java:263) 
Caused by: java.lang.NullPointerException 
at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:451) 
at microsoft.exchange.webservices.data.core.EwsServiceXmlWriter.writeValue(EwsServiceXmlWriter.java:307) 
at microsoft.exchange.webservices.data.property.complex.StringList.writeElementsToXml(StringList.java:117) 
at microsoft.exchange.webservices.data.property.complex.ComplexProperty.writeToXml(ComplexProperty.java:325) 
at microsoft.exchange.webservices.data.property.complex.ComplexProperty.writeToXml(ComplexProperty.java:338) 
at microsoft.exchange.webservices.data.property.definition.ComplexPropertyDefinitionBase.writePropertyValueToXml(ComplexPropertyDefinitionBase.java:170) 
at microsoft.exchange.webservices.data.core.PropertyBag.writeToXml(PropertyBag.java:548) 
at microsoft.exchange.webservices.data.core.service.ServiceObject.writeToXml(ServiceObject.java:321) 
at microsoft.exchange.webservices.data.core.request.CreateRequest.writeElementsToXml(CreateRequest.java:129) 
at microsoft.exchange.webservices.data.core.request.ServiceRequestBase.writeBodyToXml(ServiceRequestBase.java:134) 
at microsoft.exchange.webservices.data.core.request.ServiceRequestBase.writeToXml(ServiceRequestBase.java:256) 
at microsoft.exchange.webservices.data.core.request.ServiceRequestBase.buildEwsHttpWebRequest(ServiceRequestBase.java:696) 
at microsoft.exchange.webservices.data.core.request.ServiceRequestBase.buildEwsHttpWebRequest(ServiceRequestBase.java:665) 
at microsoft.exchange.webservices.data.core.request.ServiceRequestBase.validateAndEmitRequest(ServiceRequestBase.java:635) 
at microsoft.exchange.webservices.data.core.request.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:62) 
... 63 more 

感謝您的幫助

+0

我不明白問題是什麼。你只是想知道你的堆棧跟蹤或其他東西的原因?請參閱SO問題提示(http://stackoverflow.com/help/how-to-ask)。 – entpnerd

+0

是的,我想知道爲什麼會有這個錯誤。我編輯主帖。 – Gabriel

+1

很酷。既然你編輯了這篇文章,我已經刪除了downvote。 – entpnerd

回答

1

沒有看到實際的代碼,我不能肯定,但我會猜測基礎上,你要發送到Web服務的請求您的堆棧跟蹤,但是當它是編組XML的一個字段是空的,所以它拋出了這個異常。我鼓勵你調試並確定你試圖發送的任何字段實際上是否丟失。

+0

實際上,這個錯誤來自第74行:https://github.com/OfficeDev/ews-java-api/blob/master/src/main/java/microsoft/exchange/webservices/data/core/request/ SimpleServiceRequestBase.java。這很奇怪,因爲當我調用相同的方法創建「正常」時它運行良好。但是當我從另一個Web服務調用它時,它不起作用。任何想法,如果一個Web服務可以調用另一個Web服務? – Gabriel

+0

我懷疑發生了什麼事情,在您調用方法「正常」的上下文中,該Web服務實際上運行的是一些內部設置代碼,它將自身置於正確的狀態,用於調用下游服務。但是,當您從另一個Web服務調用時,中間Web服務不會將自己置於正確的狀態並運行必要的初始代碼。我唯一可以說的是調試兩條路徑來找出正在發生的事情,這可能需要一段時間。 : -/ – entpnerd

+0

至於你的問題,絕對! Web服務的一個主要優點是它們的功能相似,因爲它們可以根據需要互相調用。 – entpnerd