- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
下面是 JSON,我需要解析其中的值:
"primaryInvolvedParty":
{
}
响应是 XML,因此它被转换为 JSON,以便我可以轻松解析它。
使用以下方法将 XML 转换为 JSON:
String messageBody = actualResult.get("StatusMessage");
JSONObject xmlconvertedjson=XML.toJSONObject(messageBody);
JsonElement jelement = new
JsonParser().parse(xmlconvertedjson.toString());
但我正在寻找可以获取给定属性的键值的通用函数,例如:customerScore.scoreResult= Accept
,请帮忙,因为我是放心解析的新手。
JSON:
{
"soap:Envelope": {
"soap:Header": "",
"xmlns:soap": "http://schemas.xmlsoap.org/soap/envelope/",
"soap:Body": {
"ns2:offerProductArrangementResponse": {
"xmlns:ns2": "http://LIB_SIM_SalesProcessManagement/IA_OfferProductArrangement",
"response": {
"productArrangement": {
"arrangementId": "317076",
"offeredProducts": {
"externalSystemProductIdentifier": [
{
"productIdentifier": "901",
"systemCode": "00107"
},
{
"productIdentifier": "201",
"systemCode": "10107"
},
{
"productIdentifier": "P_CLASSIC",
"systemCode": "00010"
},
{
"productIdentifier": "0071306000",
"systemCode": "00004"
},
{
"productIdentifier": "0071776000",
"systemCode": "00004"
}
],
"productIdentifier": "92",
"productoffer": {
"offerType": "2001"
},
"associatedFamily": {
"extsysprodfamilyidentifier": {
"productFamilyIdentifier": "502"
}
},
"productoptions": [
{
"optionsDescription": "Correspondence Default",
"optionsName": "Correspondence Default",
"optionsType": "CorrespDef",
"optionsValue": "Paper",
"optionsCode": "3521"
},
{
"optionsDescription": "Correspondence Option",
"optionsName": "Correspondence Option",
"optionsType": "CorrespOp",
"optionsValue": "Choice",
"optionsCode": "2944"
},
{
"optionsDescription": "Debit Card Funding",
"optionsName": "Debit Card Funding",
"optionsType": "DCF",
"optionsValue": "N",
"optionsCode": "3943"
},
{
"optionsDescription": "Product Priority",
"optionsName": "Product priority",
"optionsType": "PrdPriority",
"optionsValue": "5",
"optionsCode": "2658"
},
{
"optionsDescription": "Upsell Display Value",
"optionsName": "Upsell Display Value",
"optionsType": "UPSellDispval",
"optionsValue": "0",
"optionsCode": "2659"
},
{
"optionsDescription": "Account Switching",
"optionsName": "Account Switching",
"optionsType": "AccSwitching",
"optionsValue": "Y",
"optionsCode": "2662"
},
{
"optionsDescription": "VERDE PRODUCT ID",
"optionsName": "VERDE PRODUCT ID",
"optionsType": "VerdeProdId",
"optionsValue": "20051",
"optionsCode": "4523"
},
{
"optionsDescription": "Vantage Product Id for Verde",
"optionsName": "Vantage Product Id for Verde",
"optionsType": "VantProdIDVer",
"optionsValue": "20055",
"optionsCode": "4963"
},
{
"optionsDescription": "isVantage",
"optionsName": "isVantage",
"optionsType": "isVantage",
"optionsValue": "No",
"optionsCode": "6659"
},
{
"optionsDescription": "Overdraft Offer Flag",
"optionsName": "Overdraft Offer Flag",
"optionsType": "OD_Offer_Flag",
"optionsValue": "Y",
"optionsCode": "6905"
},
{
"optionsDescription": "Make_It_Joint",
"optionsName": "Make_It_Joint",
"optionsType": "MkItJoint",
"optionsValue": "1",
"optionsCode": "6975"
},
{
"optionsDescription": "Survey",
"optionsName": "Survey",
"optionsType": "Survey",
"optionsValue": "Y",
"optionsCode": "7288"
},
{
"optionsDescription": "Statement Option",
"optionsName": "Statement Option",
"optionsType": "StateOp",
"optionsValue": "Choice",
"optionsCode": "1099"
},
{
"optionsDescription": "Statement Default",
"optionsName": "Statement Default",
"optionsType": "StateDef",
"optionsValue": "Paper",
"optionsCode": "1770"
},
{
"optionsDescription": "Tariff",
"optionsName": "Tariff",
"optionsType": "TRF",
"optionsValue": "1",
"optionsCode": "2663"
}
],
"productName": "Classic Account"
},
"applicationType": "10001",
"xsi:type": "ns7:DepositArrangement",
"isOverdraftRequired": "true",
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"xmlns:ns7": "http://LIB_SIM_BO/BusinessObjects",
"primaryInvolvedParty": {
"auditData": [
{
"auditTime": "132551",
"auditType": "PARTY_EVIDENCE",
"auditDate": "12012018"
},
{
"auditTime": "132551",
"auditType": "ADDRESS_EVIDENCE",
"auditDate": "12012018"
},
{
"auditTime": "132551",
"auditType": "ADDRESS",
"auditDate": "12012018"
}
],
"isAuthCustomer": "false",
"cidPersID": "+00554133625",
"customerSegment": "3",
"individualIdentifier": "249894",
"newCustomerIndicator": "true",
"customerIdentifier": "2012794088",
"customerScore": [
{
"scoreResult": "ACCEPT",
"assessmentType": "EIDV",
"decisionText": "001",
"decisionCode": "I",
"assessmentEvidence": {
"addressStrength": "900",
"evidenceIdentifier": "4696198HL890678339009003211586646102",
"identityStrength": "900"
}
},
{
"scoreResult": "1",
"assessmentType": "ASM",
"referralCode": [
{
"code": "601",
"description": "Accept."
},
{
"code": "601",
"description": "Accept."
}
],
"scoreIdentifier": "647448142"
}
]
},
"arrangementType": "CA",
"applicationStatus": "1002",
"associatedProduct": {},
"conditions": [
{
"result": "No",
"name": "INTEND_TO_SWITCH"
},
{
"result": "true",
"name": "INTEND_TO_OVERDRAFT"
},
{
"result": "Y",
"name": "CHECK_BOOK_OFFERED_FLAG"
},
{
"result": "20",
"name": "DEBIT_CARD_RISK_CODE"
},
{
"result": "4",
"name": "OVERDRAFT_RISK_CODE"
}
],
"overdraftDetails": {
"amount": {
"amount": "3001"
}
}
},
"header": {
"interactionId": "ucoGI58OmuY0bfYXx2iLqta",
"LloydsHeaders": [
{
"prefix": "ns4",
"name": "ServiceRequest",
"nameSpace": "http://www.lloydstsb.com/Schema/Infrastructure/SOAP",
"value": {
"ns5:From": "10.245.211.214",
"xsi:type": "ns5:ServiceRequest",
"ns5:Action": "offerProductArrangement",
"ns5:ServiceName": "offerProductArrangement",
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"ns5:mustReturn": "false",
"ns5:MessageId": "ucoGI58OmuY0bfYXx2iLqta"
}
},
{
"prefix": "ns4",
"name": "ContactPoint",
"nameSpace": "http://www.lloydstsb.com/Schema/Infrastructure/SOAP",
"value": {
"ns5:OperatorType": "Customer",
"ns5:ContactPointId": "0000777505",
"ns5:ApplicationId": "AL07618",
"ns5:InitialOriginatorId": "10.245.224.125",
"xsi:type": "ns5:ContactPoint",
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"ns5:mustReturn": "false",
"ns5:InitialOriginatorType": "Browser",
"ns5:ContactPointType": "003"
}
},
{
"prefix": "ns5",
"name": "bapiInformation",
"nameSpace": "http://www.lloydstsb.com/Schema/Enterprise/LCSM",
"value": {
"ns4:BAPIId": "B001",
"xsi:type": "ns4:bapiInformation",
"ns4:BAPIOperationalVariables": {
"ns4:bForceHostCall": "false",
"ns4:bBatchRetry": "false",
"ns4:bPopulateCache": "false"
},
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"ns4:BAPIHeader": {
"ns4:acceptLanguage": {
"xsi:nil": "true"
},
"ns4:inboxidClient": "GX",
"ns4:cctmauthcd": {
"xsi:nil": "true"
},
"ns4:encVerNo": {
"xsi:nil": "true"
},
"ns4:sessionid": "ucoGI58OmuY0bfYXx2iLqta",
"ns4:useridAuthor": "UNAUTHSALE",
"ns4:userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",
"ns4:chanidObo": {
"xsi:nil": "true"
},
"ns4:stpartyObo": {
"ns4:ocisid": "737704834",
"ns4:partyid": "+00263174828",
"ns4:host": "I"
},
"ns4:chanid": "IBL",
"ns4:ipAddressCaller": {
"xsi:nil": "true"
},
"ns4:chanctxt": "1",
"ns4:callerlineid": {
"xsi:nil": "true"
},
"ns4:chansecmode": "PWD"
}
}
},
{
"prefix": "lgsm",
"name": "Security",
"nameSpace": "http://LB_GBO_Sales/Messages",
"value": {
"mustReturn": "false",
"ns3:UsernameToken": {
"ns3:Username": "UNAUTHSALE",
"ns3:UNPMechanismType": "NTLM",
"Id": "LloydsTSBSecurityToken",
"ns3:UserType": "013"
},
"xsi:type": "ns3:SecurityHeaderType",
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
}
}
],
"businessTransaction": "OfferProductArrangement",
"channelId": "LTB"
}
},
"xmlns:ns5": "http://www.lloydstsb.com/Schema/Infrastructure/SOAP",
"xmlns:ns3": "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
"xmlns:ns4": "http://www.lloydstsb.com/Schema/Enterprise/LCSM"
}
}
}
}
最佳答案
关于java - 使用Java解析XML转换为Json,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48228230/
我一直在使用 AJAX 从我正在创建的网络服务中解析 JSON 数组时遇到问题。我的前端是一个简单的 ajax 和 jquery 组合,用于显示从我正在创建的网络服务返回的结果。 尽管知道我的数据库查
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
我在尝试运行 Android 应用程序时遇到问题并收到以下错误 java.lang.NoClassDefFoundError: com.parse.Parse 当我尝试运行该应用时。 最佳答案 在这
有什么办法可以防止etree在解析HTML内容时解析HTML实体吗? html = etree.HTML('&') html.find('.//body').text 这给了我 '&' 但我想
我有一个有点疯狂的例子,但对于那些 JavaScript 函数作用域专家来说,它看起来是一个很好的练习: (function (global) { // our module number one
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 8 年前。 Improve th
我需要编写一个脚本来获取链接并解析链接页面的 HTML 以提取标题和其他一些数据,例如可能是简短的描述,就像您链接到 Facebook 上的内容一样。 当用户向站点添加链接时将调用它,因此在客户端启动
在 VS Code 中本地开发时,包解析为 C:/Users//AppData/Local/Microsoft/TypeScript/3.5/node_modules/@types//index而不是
我在将 json 从 php 解析为 javascript 时遇到问题 这是我的示例代码: //function MethodAjax = function (wsFile, param) {
我在将 json 从 php 解析为 javascript 时遇到问题 这是我的示例代码: //function MethodAjax = function (wsFile, param) {
我被赋予了将一种语言“翻译”成另一种语言的工作。对于使用正则表达式的简单逐行方法来说,源代码过于灵活(复杂)。我在哪里可以了解更多关于词法分析和解析器的信息? 最佳答案 如果你想对这个主题产生“情绪化
您好,我在解析此文本时遇到问题 { { { {[system1];1;1;0.612509325}; {[system2];1;
我正在为 adobe after effects 在 extendscript 中编写一些代码,最终变成了 javascript。 我有一个数组,我想只搜索单词“assemble”并返回整个 jc3_
我有这段代码: $(document).ready(function() { // }); 问题:FB_RequireFeatures block 外部的代码先于其内部的代码执行。因此 who
背景: netcore项目中有些服务是在通过中间件来通信的,比如orleans组件。它里面服务和客户端会指定网关和端口,我们只需要开放客户端给外界,服务端关闭端口。相当于去掉host,这样省掉了些
1.首先贴上我试验成功的代码 复制代码 代码如下: protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
什么是 XML? XML 指可扩展标记语言(eXtensible Markup Language),标准通用标记语言的子集,是一种用于标记电子文件使其具有结构性的标记语言。 你可以通过本站学习 X
【PHP代码】 复制代码 代码如下: $stmt = mssql_init('P__Global_Test', $conn) or die("initialize sto
在SQL查询分析器执行以下代码就可以了。 复制代码代码如下: declare @t varchar(255),@c varchar(255) declare table_cursor curs
前言 最近练习了一些前端算法题,现在做个总结,以下题目都是个人写法,并不是标准答案,如有错误欢迎指出,有对某道题有新的想法的友友也可以在评论区发表想法,互相学习🤭 题目 题目一: 二维数组中的
我是一名优秀的程序员,十分优秀!