I'm creating a mobile app in which I use a webservice written in C# to create JSOn which gets sent to the app written in Java, in C# on the website, I use the following to create a new object:
new { success = true }
However in Java I can't seem to do the same, what's the best alternative for this in java if I can't do the same?
To put this into context, here is one of my webmethods on the website:
[WebMethod]
public object getNode(int intId)
{
DynamicNode node = new DynamicNode(intId);
object page = new
{
id = node.Id,
parentId = node.Parent.Id,
name = node.Name,
title = node.GetPropertyValue("title"),
summary = node.GetPropertyValue("summary"),
body = node.GetPropertyValue("body"),
updateDate = node.UpdateDate.ToString(),
createDate = node.CreateDate.ToString()
};
return page;
}
If anyone could help me out, I'd be very greatful!
Thanks in advance.