Javascript GetMethod.getResponseBodyAsString()到xml对象
使用Javascript HttpClient,我在WebService上运行了一个get方法,该方法运行良好,然后我将响应存储在变量resp_va中,如下所示 剪下下面的代码Javascript GetMethod.getResponseBodyAsString()到xml对象,javascript,xml,Javascript,Xml,使用Javascript HttpClient,我在WebService上运行了一个get方法,该方法运行良好,然后我将响应存储在变量resp_va中,如下所示 剪下下面的代码 var httpGetMethod = new GetMethod(url); httpClient.executeMethod(httpGetMethod); var statuscode = httpGetMethod.getStatusCode(); var resp_va = httpGetMethod.get
var httpGetMethod = new GetMethod(url);
httpClient.executeMethod(httpGetMethod);
var statuscode = httpGetMethod.getStatusCode();
var resp_va = httpGetMethod.getResponseBodyAsString();
虽然输出是XML格式的,但在我看来它是字符串,因此我无法解析它。问题是,在进一步解析XML对象之前,如何转换该对象中的“resp_va”?Java或JavaScript?它是JavaScript。我将编辑这个问题。