我想使用以下代码调用我的 Axis 网络服务
var wsUrl = "http://localhost:8080/TestServ/services/TestCls?wsdl";
var soapreq = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:cod=\"http://codon.com\">+"<soapenv:Header/>"+"<soapenv:Body>"+"<cod:testMethod>"+"<cod:name>hai</cod:name>"+"</cod:testMethod>"+"</soapenv:Body>"+"</soapenv:Envelope>";
var soapaction = "http://codon.com/testMethod";
jQuery.support.cors = true;
$.ajax({
type: "POST",
url: wsUrl,
contentType: 'text/xml; charset=utf-8' ,
dataType: "xml",
data: soapreq ,
SOAPAction: soapaction,
//async: false,
//processData: false,
crossDomain: true,
success: processSuccess,
error: processError
});
但是在我的 weservice 方面出现以下错误...
May 10, 2013 12:18:52 PM org.apache.axis.transport.http.AxisServlet getSoapAction
SEVERE: 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
但是我也在发送 SOAPAction 标头..请帮帮我..提前谢谢