How to call apache axis webservice using javascript for evothings app
Posted: 12:57, 26 Mar 2015
HI,
I want to call a webservice from my javascript code to get data from my service. I have tried this coding .
but am getting the following exception stacktrace at my webservice server side.
Can you Give me an idea about this? Thanks in advance
I want to call a webservice from my javascript code to get data from my service. I have tried this coding .
Code: Select all
var soapaction = "http://codon.com/login";
var soapRequest = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:cod=\"http://codon.com\">" + "<soapenv:Header xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>" + "<soapenv:Body>" + "<cod:login>" + "<acc_name>" + account + "</acc_name>" + "<uname>" + username + "</uname>" + "<pass>" + pwd + "</pass>" + "</cod:login>" + "</soapenv:Body>" + "</soapenv:Envelope>";
$.ajax({
type: 'POST',
dataType: 'xml',
SOAPAction: soapaction,
timeout: 3000,
crossDomain: true,
url: 'http://192.168.0.0:8080/WebSer/services/EmailClient?wsdl',
data: soapRequest,
success: function(data) {
alert("=sss=");
successFun(data) },
error: function(a, err) { failFun(err) }
});
but am getting the following exception stacktrace at my webservice server side.
Code: Select all
2015-03-26 16:18:23,893 ERROR - Generating fault class
AxisFault
faultCode: {http://xml.apache.org/axis/}Client.NoSOAPAction
faultSubcode:
faultString: no SOAPAction header!
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:no SOAPAction header!
at 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:637)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
{http://xml.apache.org/axis/}hostname:CHANDRAGIRI
no SOAPAction header!
at 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:637)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Can you Give me an idea about this? Thanks in advance