作者:峰的紫色摩天轮 | 来源:互联网 | 2023-05-19 16:06
IsthereaaquickwaytovalidateSOAPmessages?IhaveseenvalidatorforJSONobjects.Istheres
Is there a a quick way to validate SOAP messages? I have seen validator for JSON objects. Is there something like this for SOAP? I am receiving a 'Bad Request: 400' error response with a AJAX post I am working on. I am not too familiar with SOAP as I typically just pass JSON. Can someone tell me what is wrong with my request or perhaps suggest a good way to debug it myself? Firebug error message is just 'Bad Request: 400' which doesn't really help.
有没有一种快速验证SOAP消息的方法?我见过JSON对象的验证器。 SOAP有这样的东西吗?我收到一个'Bad Request:400'错误响应,我正在处理一个AJAX帖子。我不太熟悉SOAP,因为我通常只传递JSON。有人可以告诉我我的请求有什么问题,或者可能建议自己调试它的好方法吗? Firebug错误消息只是'错误请求:400',这实际上没有帮助。
alertid=Test&companytoken=hw&autochart=false
This is my POST function:
这是我的POST功能:
function doPost(method, body) {
var soapRequest = "";
soapRequest = soapRequest + ""
soapRequest = soapRequest + "<" + method + " xmlns='http://somewhere.org/hwconnect/services' soap:encoding>";
soapRequest = soapRequest + body;
soapRequest = soapRequest + "" + method + ">";
soapRequest = soapRequest + "";
jQuery.noConflict();
jQuery.ajax({
beforeSend: function(xhrObj) {
xhrObj.setRequestHeader("Method", "POST");
xhrObj.setRequestHeader("Content-Type", "text/xml; charset=\"utf-8\";");
xhrObj.setRequestHeader("SOAPAction", "http://somewhere.org/hwconnect/services/" + method);
},
async: false,
type: "POST",
url: theURL,
contentType: "text/xml; charset=\"utf-8\";",
data: soapRequest,
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert("XMLHttpRequest Failure: " + XMLHttpRequest.statusText);
}
});
}
2 个解决方案