+ LOGD("Reading OCRepresentation Object from Native");
+ OC::OCRepresentation *ocRepresentation = new OC::OCRepresentation(message->getExtraInfo());
+ jlong handle = reinterpret_cast<jlong>(ocRepresentation);
+ jobject jRepresentation = env->NewObject(g_cls_OcRepresentation, g_mid_OcRepresentation_N_ctor_bool,
+ handle, true);
+ if (!jRepresentation)
+ {
+ LOGE("Failed to create OcRepresentation");
+ delete ocRepresentation;
+ }
+ else
+ {
+ LOGD("Created OCRepresentation Object from Native");
+ }
+ jfieldID fid_extraInfo = env->GetFieldID(cls_message, "mExtraInfo",
+ "Lorg/iotivity/base/OcRepresentation;");
+ if (!fid_extraInfo)
+ {
+ LOGE("Failed to get mExtraInfo for Message");
+ delete ocRepresentation;
+ return NULL;
+ }
+ LOGD ("setting extraInfo field");
+ env->SetObjectField(obj_message, fid_extraInfo, jRepresentation);
+