我有一个客户端将请求作为“GET”而不是“POST”发送到我的 cxf jax-ws Web 服务
根据this answer link Webservice has "No such operation: HTTP GET PATH_INFO",它应该是“POST”。我已经搜索了如何在 cxf 中将 HTTP-Method 设置为“POST”,但没有得到太多帮助。我发现 Message 类中有一个常量字符串 HTTP_REQUEST_METHOD 但找不到有关如何使用它的任何信息。请帮忙。
这是堆栈跟踪:
ID: 4
Address: http://localhost/ws/services/NTServiceHttpSoapEndpoint
Http-Method: GET
Content-Type:
Headers: {Accept=[text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2], cache-control=[no-cache], connection=[keep-alive], Content-Type=[null], host=[10.19.9.80:8080], pragma=[no-cache], user-agent=[Java/1.7.0_10]}
--------------------------------------
> Jul 22, 2016 9:15:58 PM org.apache.cxf.phase.PhaseInterceptorChain
> doDefaultLogging WARNING: Interceptor for
> {http://example.com/wsdl/service/nm/triggering/v3_0}NTriggeringService
> has thrown exception, unwinding now org.apache.cxf.interceptor.Fault:
> No such operation: (HTTP GET PATH_INFO:
> /ws/services/NotificationManagerTriggeringServiceHttpSoapEndpoint) at
> org.apache.cxf.interceptor.URIMappingInterceptor.handleMessage(URIMappingInterceptor.java:93)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> at
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:237)
> at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:239)
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:213)
> at
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:131)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:266)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:191)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:242)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
> at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
> at
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
> 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)
Jul 22, 2016 9:15:58 PM org.apache.cxf.services.NotificationManagerTriggeringService.NotificationManagerTriggeringServiceHttpSoapEndpoint.NotificationManagerTriggeringServicePortType
INFO: Outbound Message
---------------------------
ID: 4
Response-Code: 500
Encoding: UTF-8
Content-Type: text/xml
Headers: {}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>No such operation: (HTTP GET PATH_INFO: /ws/services/NTHttpSoapEndpoint)</faultstring></soap:Fault></soap:Body></soap:Envelope>
--------------------------------------