You need to sign in to do that
Don't have an account?
MaggieSumit
Getting Error while saving the class. Please help me on this.
Line no 14 I am getting this error. "Type cannot be constructed: String" Please help me on this.
- public String type_Z {get;set;}
- public List<String> authcookies {get;set;}
- public JsonStringsss(JSONParser parser) {
- while (parser.nextToken() != JSONToken.END_OBJECT) {
- if (parser.getCurrentToken() == JSONToken.FIELD_NAME) {
- String text = parser.getText();
- if (parser.nextToken() != JSONToken.VALUE_NULL) {
- if (text == 'type') {
- type_Z = parser.getText();
- } else if (text == 'auth-cookies') {
- authcookies = new List<String>();
- while (parser.nextToken() != JSONToken.END_ARRAY) {
- authcookies.add(new String(parser));
- }
- } else {
- System.debug(LoggingLevel.WARN, 'Root consuming unrecognized property: '+text);
- consumeObject(parser);
- }
- }
- }
- }
- }
Let us know if this will help you
All Answers
Not sure what you are trying to add in the authcookies list
if you add in string list the format should be
authcookies.add(new String(parser.<Method>));
for example authcookies.add(new String(parser.GetText));
Thanks
Let us know if this will help you
this is JSON response. JSESSIONID id i am trying to store
{
"type": "loginAnswer",
"state": 0,
"data": {
"type": "tenantOwner",
"blocked": false,
"created-at": "2017-01-05T18:42:14Z",
"credentials-id": "ad18e3fdf6af48a391b20ccd07776a6f",
},
"auth-cookies": [
"JSESSIONID=66977ff4536c177e0e8c2f2c65fb; Path=/coe; HttpOnly"
]
}