当前位置: 首页 > 知识库问答 >
问题:

Apache cxf抛出"错误读取XMLStreamReader"的应用程序/x-www-form-urlencoded

毛成济
2023-03-14

我已经使用Springboot和ApacheCXF库实现了webservice

如果header设置为content type:application/x-www-form-urlencoded,则会抛出“读取XMLStreamReader时出错”。

它的工作原理如果内容类型:应用程序/xml

我在我们的遗留应用程序old Spring上公开了相同的Web服务,该应用程序托管在tomcat webserver中,它接受的内容类型为:application/x-www-form-urlencoded。

Springbootcxf库在3.4.4版本上,旧的Spring应用cxf在2.6.4版本上。

更新:当I m send SOAP request using postman and header设置为content type:application/x-www-form-urlcoded时,请求为空,我添加了自定义拦截器,并尝试打印请求,但请求为空。

如果我设置了头内容类型:应用程序/xml。我可以在我的客户拦截器中打印完整的请求。

为什么在Springboot中,当header设置为content type:application/x-www-form-urlencoded时,我会收到空请求

以下是stacktrace:

[DEBUG] 2021-10-13 12:04:04.796 2021-10-13 12:04:04,796 (3706595) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.transport.servlet.ServletController - Service http request on thread: Thread[http-nio-8225-exec-2,5,main]
[DEBUG] 2021-10-13 12:04:04.796 2021-10-13 12:04:04,796 (3706595) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.transport.http.AbstractHTTPDestination - Create a new message for processing
[DEBUG] 2021-10-13 12:04:04.797 2021-10-13 12:04:04,797 (3706596) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.transport.http.Headers - Request Headers: {Accept=[*/*], accept-encoding=[gzip, deflate], Authorization=[***], cache-control=[no-cache, no-cache], connection=[keep-alive], Content-Length=[3548], content-type=[application/x-www-form-urlencoded], cookie=[JSESSIONID=515326571A247E4AAA3606E5744BC014], host=[localhost:8225], postman-token=[c6a28c3a-194a-48c4-b021-3121145fc694], Proxy-Authorization=[***], user-agent=[West Wind Internet Protocols 6.17], x-amzn-trace-id=[Root=1-616531e1-251451d3146f266946c920eb], x-forwarded-for=[129.232.215.82], x-forwarded-port=[443], x-forwarded-proto=[https]}
[DEBUG] 2021-10-13 12:04:04.797 2021-10-13 12:04:04,797 (3706596) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.transport.https.CertConstraintsInterceptor@1a0f004a to phase pre-stream
[DEBUG] 2021-10-13 12:04:04.797 2021-10-13 12:04:04,797 (3706596) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Chain org.apache.cxf.phase.PhaseInterceptorChain@5d8a7c50 was created. Current flow:
  receive [PolicyInInterceptor, AttachmentInInterceptor]
  pre-stream [CertConstraintsInterceptor]
  post-stream [StaxInInterceptor]
  read [SAAJPreInInterceptor, WSDLGetInterceptor, ReadHeadersInterceptor, SoapActionInInterceptor, StartBodyInterceptor]
  pre-protocol [WSS4JInInterceptor, MustUnderstandInterceptor]
  post-protocol [CheckFaultInterceptor, JAXBAttachmentSchemaValidationHack]
  unmarshal [DocLiteralInInterceptor, SoapHeaderInterceptor]
  pre-logical [OneWayProcessorInterceptor]
  post-logical [WrapperClassInInterceptor]
  pre-invoke [SwAInInterceptor, HolderInInterceptor]
  invoke [ServiceInvokerInterceptor]
  post-invoke [OutgoingChainInterceptor]

[DEBUG] 2021-10-13 12:04:04.797 2021-10-13 12:04:04,797 (3706596) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.ws.policy.PolicyInInterceptor@2f9d82b5
[DEBUG] 2021-10-13 12:04:04.797 2021-10-13 12:04:04,797 (3706596) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.interceptor.AttachmentInInterceptor@3a852bdf
[DEBUG] 2021-10-13 12:04:04.797 2021-10-13 12:04:04,797 (3706596) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.transport.https.CertConstraintsInterceptor@1a0f004a
[DEBUG] 2021-10-13 12:04:04.797 2021-10-13 12:04:04,797 (3706596) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.interceptor.StaxInInterceptor@45ac5280
[DEBUG] 2021-10-13 12:04:04.797 2021-10-13 12:04:04,797 (3706596) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.interceptor.StaxInEndingInterceptor@7225972d to phase pre-invoke
[DEBUG] 2021-10-13 12:04:04.797 2021-10-13 12:04:04,797 (3706596) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Chain org.apache.cxf.phase.PhaseInterceptorChain@5d8a7c50 was modified. Current flow:
  receive [PolicyInInterceptor, AttachmentInInterceptor]
  pre-stream [CertConstraintsInterceptor]
  post-stream [StaxInInterceptor]
  read [SAAJPreInInterceptor, WSDLGetInterceptor, ReadHeadersInterceptor, SoapActionInInterceptor, StartBodyInterceptor]
  pre-protocol [WSS4JInInterceptor, MustUnderstandInterceptor]
  post-protocol [CheckFaultInterceptor, JAXBAttachmentSchemaValidationHack]
  unmarshal [DocLiteralInInterceptor, SoapHeaderInterceptor]
  pre-logical [OneWayProcessorInterceptor]
  post-logical [WrapperClassInInterceptor]
  pre-invoke [StaxInEndingInterceptor, SwAInInterceptor, HolderInInterceptor]
  invoke [ServiceInvokerInterceptor]
  post-invoke [OutgoingChainInterceptor]

[DEBUG] 2021-10-13 12:04:04.797 2021-10-13 12:04:04,797 (3706596) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor@1c90e3c6
[DEBUG] 2021-10-13 12:04:04.797 2021-10-13 12:04:04,797 (3706596) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleFault on interceptor org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor@1c90e3c6
[DEBUG] 2021-10-13 12:04:04.797 2021-10-13 12:04:04,797 (3706596) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleFault on interceptor org.apache.cxf.interceptor.StaxInInterceptor@45ac5280
[DEBUG] 2021-10-13 12:04:04.797 2021-10-13 12:04:04,797 (3706596) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleFault on interceptor org.apache.cxf.transport.https.CertConstraintsInterceptor@1a0f004a
[DEBUG] 2021-10-13 12:04:04.798 2021-10-13 12:04:04,798 (3706597) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleFault on interceptor org.apache.cxf.interceptor.AttachmentInInterceptor@3a852bdf
[DEBUG] 2021-10-13 12:04:04.798 2021-10-13 12:04:04,798 (3706597) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleFault on interceptor org.apache.cxf.ws.policy.PolicyInInterceptor@2f9d82b5
[WARN ] 2021-10-13 12:04:04.798 2021-10-13 12:04:04,798 (3706597) [http-nio-8225-exec-2] [[]] WARN  org.apache.cxf.phase.PhaseInterceptorChain - Interceptor for {http://soap.api.controller.web.****.com/}EnterpriseAPISoapService has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
    at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.handleMessage(SAAJInInterceptor.java:145) ~[cxf-rt-bindings-soap-3.4.4.jar:3.4.4]
    at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.handleMessage(SAAJInInterceptor.java:107) ~[cxf-rt-bindings-soap-3.4.4.jar:3.4.4]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.4.4.jar:3.4.4]
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.4.4.jar:3.4.4]
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265) [cxf-rt-transports-http-3.4.4.jar:3.4.4]
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [cxf-rt-transports-http-3.4.4.jar:3.4.4]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [cxf-rt-transports-http-3.4.4.jar:3.4.4]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [cxf-rt-transports-http-3.4.4.jar:3.4.4]
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225) [cxf-rt-transports-http-3.4.4.jar:3.4.4]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:298) [cxf-rt-transports-http-3.4.4.jar:3.4.4]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:217) [cxf-rt-transports-http-3.4.4.jar:3.4.4]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:273) [cxf-rt-transports-http-3.4.4.jar:3.4.4]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:239) [javamelody-core-1.83.0.jar:1.83.0]
    at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:215) [javamelody-core-1.83.0.jar:1.83.0]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90) [spring-boot-actuator-2.1.2.RELEASE.jar:2.1.2.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) [spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) [spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:117) [spring-boot-actuator-2.1.2.RELEASE.jar:2.1.2.RELEASE]
    at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:106) [spring-boot-actuator-2.1.2.RELEASE.jar:2.1.2.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_111]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_111]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.14.jar:9.0.14]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
    at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:701) ~[woodstox-core-6.2.6.jar:6.2.6]
    at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2235) ~[woodstox-core-6.2.6.jar:6.2.6]
    at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2141) ~[woodstox-core-6.2.6.jar:6.2.6]
    at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1180) ~[woodstox-core-6.2.6.jar:6.2.6]
    at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1203) ~[woodstox-core-6.2.6.jar:6.2.6]
    at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.handleMessage(SAAJInInterceptor.java:130) ~[cxf-rt-bindings-soap-3.4.4.jar:3.4.4]
    ... 62 more
[DEBUG] 2021-10-13 12:04:04.798 2021-10-13 12:04:04,798 (3706597) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.ws.policy.ServerPolicyOutFaultInterceptor@17fd33dd to phase setup
[DEBUG] 2021-10-13 12:04:04.798 2021-10-13 12:04:04,798 (3706597) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.jaxws.interceptors.WebFaultOutInterceptor@686d836c to phase pre-protocol
[DEBUG] 2021-10-13 12:04:04.798 2021-10-13 12:04:04,798 (3706597) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.interceptor.MessageSenderInterceptor@28963fe4 to phase prepare-send
[DEBUG] 2021-10-13 12:04:04.798 2021-10-13 12:04:04,798 (3706597) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.interceptor.StaxOutInterceptor@70c3a941 to phase pre-stream
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor@ede1f5f to phase write
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.interceptor.AttachmentOutInterceptor@aac8b0b to phase pre-stream
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor@13dcfca5 to phase write
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.binding.soap.interceptor.SoapHeaderOutFilterInterceptor@7e38d63e to phase pre-logical
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor@e21a41 to phase prepare-send
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Chain org.apache.cxf.phase.PhaseInterceptorChain@d6f3462 was created. Current flow:
  setup [ServerPolicyOutFaultInterceptor]
  pre-logical [SoapHeaderOutFilterInterceptor]
  prepare-send [MessageSenderInterceptor, Soap11FaultOutInterceptor]
  pre-stream [AttachmentOutInterceptor, StaxOutInterceptor]
  pre-protocol [WebFaultOutInterceptor]
  write [SoapOutInterceptor]

[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.ws.policy.ServerPolicyOutFaultInterceptor@17fd33dd
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.ws.policy.ServerPolicyOutFaultInterceptor - No binding operation info.
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.binding.soap.interceptor.SoapHeaderOutFilterInterceptor@7e38d63e
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.interceptor.MessageSenderInterceptor@28963fe4
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor@34d084e0 to phase prepare-send-ending
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Chain org.apache.cxf.phase.PhaseInterceptorChain@d6f3462 was modified. Current flow:
  setup [ServerPolicyOutFaultInterceptor]
  pre-logical [SoapHeaderOutFilterInterceptor]
  prepare-send [MessageSenderInterceptor, Soap11FaultOutInterceptor]
  pre-stream [AttachmentOutInterceptor, StaxOutInterceptor]
  pre-protocol [WebFaultOutInterceptor]
  write [SoapOutInterceptor]
  prepare-send-ending [MessageSenderEndingInterceptor]

[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor@e21a41
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor$Soap11FaultOutInterceptorInternal@62e5b97b to phase marshal
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Chain org.apache.cxf.phase.PhaseInterceptorChain@d6f3462 was modified. Current flow:
  setup [ServerPolicyOutFaultInterceptor]
  pre-logical [SoapHeaderOutFilterInterceptor]
  prepare-send [MessageSenderInterceptor, Soap11FaultOutInterceptor]
  pre-stream [AttachmentOutInterceptor, StaxOutInterceptor]
  pre-protocol [WebFaultOutInterceptor]
  write [SoapOutInterceptor]
  marshal [Soap11FaultOutInterceptorInternal]
  prepare-send-ending [MessageSenderEndingInterceptor]

[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.interceptor.AttachmentOutInterceptor@aac8b0b
[DEBUG] 2021-10-13 12:04:04.799 2021-10-13 12:04:04,799 (3706598) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.interceptor.StaxOutInterceptor@70c3a941
[DEBUG] 2021-10-13 12:04:04.800 2021-10-13 12:04:04,800 (3706599) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.interceptor.StaxOutEndingInterceptor@5362971 to phase pre-stream-ending
[DEBUG] 2021-10-13 12:04:04.800 2021-10-13 12:04:04,800 (3706599) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Chain org.apache.cxf.phase.PhaseInterceptorChain@d6f3462 was modified. Current flow:
  setup [ServerPolicyOutFaultInterceptor]
  pre-logical [SoapHeaderOutFilterInterceptor]
  prepare-send [MessageSenderInterceptor, Soap11FaultOutInterceptor]
  pre-stream [AttachmentOutInterceptor, StaxOutInterceptor]
  pre-protocol [WebFaultOutInterceptor]
  write [SoapOutInterceptor]
  marshal [Soap11FaultOutInterceptorInternal]
  pre-stream-ending [StaxOutEndingInterceptor]
  prepare-send-ending [MessageSenderEndingInterceptor]

[DEBUG] 2021-10-13 12:04:04.800 2021-10-13 12:04:04,800 (3706599) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.jaxws.interceptors.WebFaultOutInterceptor@686d836c
[DEBUG] 2021-10-13 12:04:04.800 2021-10-13 12:04:04,800 (3706599) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor@ede1f5f
[DEBUG] 2021-10-13 12:04:04.800 2021-10-13 12:04:04,800 (3706599) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Adding interceptor org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor@6d3bed65 to phase write-ending
[DEBUG] 2021-10-13 12:04:04.800 2021-10-13 12:04:04,800 (3706599) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Chain org.apache.cxf.phase.PhaseInterceptorChain@d6f3462 was modified. Current flow:
  setup [ServerPolicyOutFaultInterceptor]
  pre-logical [SoapHeaderOutFilterInterceptor]
  prepare-send [MessageSenderInterceptor, Soap11FaultOutInterceptor]
  pre-stream [AttachmentOutInterceptor, StaxOutInterceptor]
  pre-protocol [WebFaultOutInterceptor]
  write [SoapOutInterceptor]
  marshal [Soap11FaultOutInterceptorInternal]
  write-ending [SoapOutEndingInterceptor]
  pre-stream-ending [StaxOutEndingInterceptor]
  prepare-send-ending [MessageSenderEndingInterceptor]

[DEBUG] 2021-10-13 12:04:04.800 2021-10-13 12:04:04,800 (3706599) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor$Soap11FaultOutInterceptorInternal@62e5b97b
[DEBUG] 2021-10-13 12:04:04.800 2021-10-13 12:04:04,800 (3706599) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor@6d3bed65
[DEBUG] 2021-10-13 12:04:04.800 2021-10-13 12:04:04,800 (3706599) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.interceptor.StaxOutEndingInterceptor@5362971
[DEBUG] 2021-10-13 12:04:04.800 2021-10-13 12:04:04,800 (3706599) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor@34d084e0
[DEBUG] 2021-10-13 12:04:04.801 2021-10-13 12:04:04,801 (3706600) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.transport.http.AbstractHTTPDestination - Finished servicing http request on thread: Thread[http-nio-8225-exec-2,5,main]
[DEBUG] 2021-10-13 12:04:04.801 2021-10-13 12:04:04,801 (3706600) [http-nio-8225-exec-2] [[]] DEBUG org.apache.cxf.transport.servlet.ServletController - Finished servicing http request on thread: Thread[http-nio-8225-exec-2,5,main]

共有1个答案

华宣
2023-03-14

问题解决了。

当标题Content-Type: Application/x-wow-form-urlencoded被添加到Springstart应用的请求中时,请求正文为空。

您需要禁用HiddenHttpMethodFilter。

我按照指令是下面的链接和它的工作。

https://newbedev.com/why-is-httpservletrequest-inputstream-empty

 类似资料:
  • 我正在尝试使用,但数据没有到达PHP。我认为这是因为当使用标题始终设置为

  • 问题内容: 我是Web API的新手。我想使用web-api接收HTTP POST数据。content-type为,请求主体为: (JSON格式)。 我的控制器是这样的: 但是formData始终为null。仅当我将请求正文更改为: 我可以找到已保存在我的字符串中。 所以我的问题是我应该如何接收具有以下格式的数据: ? 是否有一种简单的方法可以将JSON淡化为C#? 感谢帮助! 更新:我尝试使用模

  • RESTAPI在映射到Java对象时采用输入内容类型:application/x-www-form-urlencoded,如 在表单输入请求中,我正在设置my_name和my_phone的值,但MyRequest对象的myName和myPhone为null。 我正在使用Jackson annotations 2.3 jar 有什么建议吗?可能有什么问题?

  • 问题内容: 我想上网本REST API,它接受三个参数: ,, 我做它像这样在AngularJS为: 但是我总是这样: 对象{数据:“ {”结果“:”假“}”“,状态:200,配置:对象,状态文本:”确定“,标头:功能} 要么 {“ data”:“ {\” result \“:\” false \“}”,“状态”:200,“ config”:{“方法”:“ POST”,“ transformReq

  • Jersey文档给出了如何在资源上注入HttpSession的示例。我应该如何注入(或以其他方式访问)在请求中发送的表单参数,并使用“Content Type:application/x-www-form-urlencoded”?我看到这些都是作为参数在方法上传递的,而且似乎没有注释,让我相信这里有一些怪癖? 我目前使用的(naive)工厂实现如下,JerseyHttpServletRequest

  • 我正在使用Jersey RESTful Web服务框架开发一个REST服务。 需要使用url编码的表单content-type,并将其解释/验证为bean。 当资源使用application/json或application/xml时,这是可能的,但是在application/x-www-form-urlencoded的情况下,我会收到'415-Unsupported Media type'响应。