如何在轴应用程序中禁用SOAP Action?

时间:2017-08-04 08:41:44

标签: java soap wsdl axis

请在下面的html客户端找到我想要触及的方法。

<head>
    <title>SOAP JavaScript Client Test</title>
    <script type="text/javascript">
        function soap() {
            var xmlhttp = new XMLHttpRequest();
            xmlhttp.open('POST', 'http://localhost:9090/SMSSoapInterface/services/smsxmlpushservicewsSoap11', true);

            // build SOAP request
            var sr =
                '<?xml version="1.0" encoding="utf-8"?>' +
                '<soapenv:Envelope ' + 
                    'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
                    'xmlns:urn="urn:mm7pushinterface' +
                    'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">' +
                    '<soapenv:Body>' +
                            '<urn:SubmitReq>' +
                            '<urn:MM7Version>5.3.0</urn:MM7Version>' +
                            '<urn:SenderIdentification>' +
                            '<urn:VASPID>1234</urn:VASPID>'+
                            '<urn:VASID>12345</urn:VASID>'+
                            '<urn:CampaignName>SOAP Campaign</urn:CampaignName>'+
                            '<urn:CampaignDesc>test</urn:CampaignDesc>'+
                            '<urn:MsgCategory>1</urn:MsgCategory>'+
                            '<urn:SenderAddress>'+
                            '<urn:RFC2822Address >1244</urn:RFC2822Address>'+
                            '<urn:Number>919901251515</urn:Number>'+
                            '<urn:ShortCode >1234</urn:ShortCode>'+
                            '</urn:SenderAddress>'+
                            '</urn:SenderIdentification>'+
                            '<urn:Recipients>'+
                            '<urn:To>'+
                            '<urn:RFC2822Address >6789</urn:RFC2822Address>'+
                            '<urn:Number >919901251516</urn:Number>'+
                            '<urn:ShortCode >7896</urn:ShortCode>'+
                            '</urn:To>'+
                            '</urn:Recipients>'+
                            '</urn:Recipients>'+
                    '</soapenv:Body>' +
                '</soapenv:Envelope>';

            xmlhttp.onreadystatechange = function () {
                if (xmlhttp.readyState == 4) {
                    if (xmlhttp.status == 200) {
                        alert('done. use firebug/console to see network response');
                    }
                }
            }
            // Send the POST request
            xmlhttp.setRequestHeader('Content-Type', 'text/xml');
            xmlhttp.setRequestHeader('SOAPAction', "");
            xmlhttp.setRequestHeader('Access-Control-Allow-Headers', 'Authorization');
            xmlhttp.setRequestHeader('Access-Control-Allow-Methods', 'POST');
            xmlhttp.setRequestHeader('Access-Control-Allow-Origin', '*');
            xmlhttp.setRequestHeader('username', 'ecpDemoUser');
            xmlhttp.setRequestHeader('password', 'ecpDemo');
            xmlhttp.setRequestHeader('SOAPAction', "");
            xmlhttp.send(sr);
            // send request
            // ...
        }
    </script>
</head>
<body>
    <form name="Demo" action="" method="post">
        <div>
            <input type="button" value="Soap" onclick="soap();" />
        </div>
    </form>
</body>
</html> <!-- typo -->

我收到soap动作未找到错误。请在下面找到堆栈trace.no SOAPAction标头!     在

org.apache.axis.transport.http.AxisServlet.getSoapAction(AxisServlet.java:1013)
    at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:678)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

我的wsdl文件没有定义任何soap操作:

<soap:operation soapAction=""/>

当soap动作标题为空时,有人能说出如何在轴应用程序中禁用soap动作吗?请提供api

0 个答案:

没有答案