JSON

从soapwsdl在javascript中处理JSON响应(复制) - handling JSON response f

字号+ 作者:H5之家 来源:H5之家 2015-11-05 18:00 我要评论( )

28im技术大牛是面向程序员的知识学习与分享社区,追求最前沿技术

从soapwsdl在javascript中处理JSON响应(复制) - handling JSON response from the soap wsdl in javascript [duplicate]

- 此内容更新于:2015-10-30

主题:

这个问题的准确复制:错误:?未捕获TypeError:无法读取属性定义的长度吗?如何处理以下从soapwsdljson响应。我需要特别PERSON_ID从这个印刷在我的HTML文件。其实我有一个javascript代码和IBMmobiefirst工作。任何身体的帮助请??

原文:

This question is an exact duplicate of:

  • Getting error: “Uncaught TypeError: Cannot read property 'length' of undefined”
  • how to handle the below json response from soap wsdl.i need particularly PERSON_ID from this to be printed in my HTML FILE.actually i have a javascript code for this and am working on IBM mobiefirst.any body help pls??

    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": [ ] }

    楼主:到底你不能够回答这个mobilefirst所以我张贴在json也得到了答案。你为什么这么做

    (原文:what the hell u cant able to answer this in mobilefirst so i posted in json and also got the answer .why you are doing this)

    解决方案:
    你可以做以下几点:varstr=//你的JSON响应……varID=str.Envelope.Body.processResponse。PERSON_ID;//如果你使用jQueryjQuery(“#htmlelementid”).html(ID);//其他document.querySelectorAll(“#htmlelementid”)。innerHTML=ID;

    原文:

    You can do the following:

    var str = //your JSON response... var ID = str.Envelope.Body.processResponse.PERSON_ID;

    //if you use jQuery

    jQuery("#htmlelementid").html(ID);

    //else

    document.querySelectorAll("#htmlelementid").innerHTML = ID;

    楼主:我身体是未定义错误味精在chrome开发控制台

    (原文:i get Body is undefined as error msg in chrome dev console)

    楼主:我编辑的问题,以上结果是响应消息从wsdl已经从json转换成js的价值

    (原文:i have edited my question, and above result is response message from wsdl that has been converted to js value from json)

     

    1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

    相关文章
    • JavaScript转换与解析JSON方法实例详解第1/2页

      JavaScript转换与解析JSON方法实例详解第1/2页

      2016-02-10 21:25

    • DockOne技术分享(十二):新浪是如何分析处理32亿条实时日志的

      DockOne技术分享(十二):新浪是如何分析处理32亿条实时日志的

      2016-02-05 19:16

    • 未来编程的9大猜想:JavaScript不必亲自编写

      未来编程的9大猜想:JavaScript不必亲自编写

      2016-01-30 13:01

    • Objective-C与JavaScript交互的那些事

      Objective-C与JavaScript交互的那些事

      2016-01-30 13:00

    网友点评
    t