0
我想用叫我軸心國的web服務下面的代碼調用webservice的軸從jQuery的
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頭也..請幫助我出...預先提供
引用此客戶端archive.plugins.jquery.com/project/jqSOAPClient – constantlearner 2013-05-13 19:19:48
使用jqSOAPClient我可以調用webservice方法。但沒有從服務器得到任何迴應。怎麼了? – madas 2013-05-21 13:10:19