2010-12-15 93 views
0

我使用1.2 soap綁定創建了使用CXF的Web Service。CXF與.Net不兼容?

當我試圖創建一個C#的客戶,儘量做到「添加Web服務引用」

Java方面給予預警..

所以......它意味着兩個部分使用不同的標準? 我們可以解決這個問題嗎?我正在jdmichal`s建議把

<jaxws:endpoint id="{your.service.namespace}YourPortName"> 
    <jaxws:features> 
    <wsa:addressing xmlns:wsa="http://cxf.apache.org/ws/addressing"/> 
    </jaxws:features> 
</jaxws:endpoint> 

還有另外一個新的警告後,這杞人憂天會引起我trobule,因爲我需要用這兩種技術創建一個項目......

WARNING: Interceptor for {http://demo.mydemo.com/}DartProxyImplService has thrown exception, unwinding now 
org.apache.cxf.binding.soap.SoapFault: MustUnderstand headers: [{http://www.w3.org/2005/08/addressing}Action, {http://www.w3.org/2005/08/addressing}To] are 
not understood. 
     at org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor.checkUltimateReceiverHeaders(MustUnderstandInterceptor.java:129) 
     at org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor.handleMessage(MustUnderstandInterceptor.java:87) 
     at org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor.handleMessage(MustUnderstandInterceptor.java:48) 
     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) 
     at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113) 
     at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:97) 
     at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:461) 
     at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:188) 
     at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148) 
     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179) 
     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103) 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) 
     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159) 
     at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) 
     at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401) 
     at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) 
     at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) 
     at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) 
     at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) 
     at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) 
     at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) 
     at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) 
     at org.mortbay.jetty.Server.handle(Server.java:326) 
     at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) 
     at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945) 
     at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) 
     at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) 
     at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) 
     at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) 
     at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) 

.. ..有誰知道這是什麼問題? 如何解決?

[INFO] Started Jetty Server 
Dec 16, 2010 10:42:25 AM org.apache.cxf.transport.servlet.ServletController invoke 
WARNING: Can't find the request for http://localhost:8080/DFAWebServiceProxy//'s Observer 
Dec 16, 2010 10:42:34 AM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging 
WARNING: Interceptor for {http://demo.mydemo.com/}DartProxyImplService has thrown exception, unwinding now 
org.apache.cxf.interceptor.Fault: No such operation: (HTTP GET PATH_INFO: /DFAWebServiceProxy/DartProxy) 
     at org.apache.cxf.interceptor.URIMappingInterceptor.handleMessage(URIMappingInterceptor.java:88) 
     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) 
     at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113) 
     at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:97) 
     at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:461) 
     at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:188) 
     at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148) 
     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179) 
     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:108) 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) 
     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159) 
     at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) 
     at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401) 
     at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) 
     at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) 
     at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) 
     at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) 
     at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) 
     at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) 
     at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) 
     at org.mortbay.jetty.Server.handle(Server.java:326) 
     at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) 
     at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928) 
     at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) 
     at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) 
     at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) 
     at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) 
     at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) 
Dec 16, 2010 10:42:34 AM org.apache.cxf.ws.addressing.ContextUtils retrieveMAPs 
WARNING: WS-Addressing - failed to retrieve Message Addressing Properties from context 
Dec 16, 2010 10:42:34 AM org.apache.cxf.ws.addressing.ContextUtils retrieveMAPs 
WARNING: WS-Addressing - failed to retrieve Message Addressing Properties from context 
Dec 16, 2010 10:42:34 AM org.apache.cxf.ws.addressing.ContextUtils retrieveMAPs 
WARNING: WS-Addressing - failed to retrieve Message Addressing Properties from context 
Dec 16, 2010 10:42:34 AM org.apache.cxf.ws.addressing.ContextUtils retrieveMAPs 
WARNING: WS-Addressing - failed to retrieve Message Addressing Properties from context 
Dec 16, 2010 10:42:34 AM org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor$Soap12FaultOutInterceptorInternal handleMessage 
INFO: class org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor$Soap12FaultOutInterceptorInternalapplication/soap+xml 
Dec 16, 2010 10:42:35 AM org.apache.cxf.service.invoker.AbstractInvoker invoke 
SEVERE: Invocation without a binding operation. 
Dec 16, 2010 10:42:35 AM org.apache.cxf.service.invoker.AbstractInvoker invoke 
SEVERE: Invocation without a binding operation. 
Dec 16, 2010 10:42:35 AM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging 
WARNING: Interceptor for {http://demo.mydemo.com/}DartProxyImplService has thrown exception, unwinding now 
org.apache.cxf.interceptor.Fault: No binding operation info while invoking unknown method with params unknown. 
     at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:60) 
     at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) 
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) 
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
     at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
     at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) 
     at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106) 
     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) 
     at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113) 
     at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:97) 
     at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:461) 
     at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:188) 
     at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148) 
     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179) 
     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103) 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) 
     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159) 
     at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) 
     at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401) 
     at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) 
     at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) 
     at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) 
     at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) 
     at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) 
     at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) 
     at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) 
     at org.mortbay.jetty.Server.handle(Server.java:326) 
     at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) 
     at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945) 
     at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) 
     at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) 
     at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) 
     at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) 
     at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) 

回答

1

您可能需要在Java服務上啓用WS-Addressing。由於.NET斷言服務器必須理解WS-Addressing的一個子集,並且服務器不符合該斷言,所以正在拋出該錯誤。

http://cxf.apache.org/docs/ws-addressing.html


回合2:

(請在未來,標誌着一個問題,回答和發佈一個新的,而不是改變你原來的。)

它看起來像.NET客戶端試圖訪問一個操作,但該操作未知/未實現?嘗試重新將WSDL導入到.NET中,並查看是否修復了任何內容。另外,您是否正在導入由CXF託管的WSDL,還是手工製作的?您應該使用CXF生成的,至少在您完成所有其他工作之前。

+0

是的..舊的異常已經消失,但一個新的警告來了....我有更新的問題..你能幫我看看嗎? – jojo 2010-12-15 23:47:11

+0

我啓動了java web服務,然後在瀏覽器中輸入鏈接,CXF將生成WSDL文件...並在Visual Studio中...我從瀏覽器複製鏈接,使用GUI生成客戶端代理 – jojo 2010-12-16 09:09:06

0

好了,行:

AbstractHTTPServlet.doGet(...) 

是一種關鍵的。它獲取GET請求,而不是SOAP請求所需的POST。仔細檢查客戶端在做什麼,以確保它發送適當的SOAP請求。