无法从SOAP接口解析jquery响应中的XML

时间:2020-09-15 08:58:31

标签: jquery xml soap

在对SOAP ui接口进行AJAX调用后,我无法从收到的响应中解析元素

AJAX呼叫:

$.ajax({
            type:"POST",
            url:myURL,
            async:false,
            contentType: "text/xml",
            dataType: 'xml',
            data: msgXML,
            success: function(result) {
                debugger;
                console.log('success');
                console.log(result);
                json = result;
                //I would like to parse the object here

            },
            error:function(data){
                console.log(data.responseText);
                debugger;
            }
        });

我在Google chrome调试器中得到以下对象

looking at the result I get from the AJAX success

我知道这是一个菜鸟问题,但我无法以某种方式解析该对象内部的内容。

谢谢!

1 个答案:

答案 0 :(得分:0)

找到了!

要解析数据,只需执行以下操作:

result.getElementsByTagName("nameOfTheTagIWantToFind")[0]

干杯!

相关问题