对接IPTV时,调试webservice接口时提示 no SOAPAction header! 异常 特此记录,提供两种解决方案
org.apache.axis.AxisFault: no SOAPAction header!
at org.apache.axis.transport.http.AxisServlet.getSoapAction(AxisServlet.java:586) [classes/:?]
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:385) [classes/:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) [tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) [axis-1.4.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) [shiro-web-1.4.2.jar:1.4.2]
方案1 修改请求方的http请求头
我使用的Htool包提供的http请求根据,设置请求头SOAPAction
String xmlStr = "xml内容";
HttpRequest httpRequest = HttpRequest.post