用javascript处理来自soap wsdl的JSON响应
handling JSON response from the soap wsdl in javascript
如何处理下面来自soap wsdl的json响应。我特别需要将其中的PERSON_ID打印在我的HTML文件中。实际上,我有一个javascript代码,正在处理IBM mobiefirst。请提供任何身体帮助??
var str= result;
alert(str);
var ID = str.Envelope.Body.processResponse.PERSON_ID;
alert(ID);
{
"Envelope": {
"Body": {
"processResponse": {
"ERROR_CODE": "S",
"ERROR_MSG": "Login Successful",
"GROUPS_ID": "76721",
"PERSON_ID": "309236",
"PERSON_LOGIN": "Y",
"PERSON_NAME": "Welcome! ashanka",
"PERSON_ROLE": "Y",
"PERSON_UID": "1014336",
"client": "http:'/'/xmlns.oracle.com'/InternetMobile'/AbsManagement'/BPELProcessUserLogin",
"xmlns": "http:'/'/xmlns.oracle.com'/InternetMobile'/AbsManagement'/BPELProcessUserLogin"
}
},
"Header": {
"FaultTo": {
"Address": "http:'/'/www.w3.org'/2005'/08'/addressing'/anonymous"
},
"MessageID": "urn:C9C4DB207D5211E5BF9B25E60F40847D",
"ReplyTo": {
"Address": "http:'/'/www.w3.org'/2005'/08'/addressing'/anonymous"
}
},
"env": "http:'/'/schemas.xmlsoap.org'/soap'/envelope'/",
"wsa": "http:'/'/www.w3.org'/2005'/08'/addressing"
},
"errors": [
],
"info": [
],
"isSuccessful": true,
"responseHeaders": {
"Content-Length": "1017",
"Content-Type": "text'/xml; charset=utf-8",
"Date": "Wed, 28 Oct 2015 09:03:42 GMT",
"SOAPAction": "'"'"",
"X-ORACLE-DMS-ECID": "9e10a9dcf92c80fa:-8e91c30:150a34b187a:-8000-0000000000053e79",
"X-Powered-By": "Servlet'/2.5 JSP'/2.1"
},
"responseTime": 106,
"statusCode": 200,
"statusReason": "OK",
"totalTime": 122,
"warnings": [
]
}
您可以执行以下操作:
var str=//您的JSON响应。。。var ID=str.Envelope.Body.prrocessResponse.PERSON_ID;
//如果您使用jQuery
jQuery("#htmlelementid").html(ID);
//其他
document.querySelectorAll("#htmlelementid").innerHTML=ID;
相关文章:
- jQuery匹配JSON对象的部分文本
- 在循环中分配json值时,值被覆盖
- 需要帮助设置json数组
- 如何在Javascript中将JSon对象转换为数组
- 我可以在json对象中添加一个函数吗
- 使用JS将数组转换为json对象
- Javascript-如何读取json文件中的列并将其保存在Javascript数组中
- 使用JQuery解析JSON嵌套数组
- 在使用Polymer'加载所有json文件后执行方法;s的核心ajax
- 如何使用json将对象列表从java转换为javascript
- 如何使用 node.js 比较两个 json 数组
- 如何将JSON数据导入我的ejs模板
- 区分JSON中的矩阵和列表列表
- 不显示带有本地json文件数据的谷歌地图脚本
- 如何将json数据显示为html
- 如何为json对象中的段发送array[]
- 根据id将json数组组合为一个json数组
- Json数据包含日期和时间格式
- AngularJS-在JSON选择器中使用变量名
- 用javascript处理来自soap wsdl的JSON响应