I am sending the following JSON data to an RO Server :
var basketItem= { x:x1, y:y1 };
var basketItemByStop=
{
sessionId : {
id : "sessionId",
memberType : "property",
value : '3432345ADC'
},
customerId : {
id : "customerId",
memberType: "property",
value : '123456'
},
email : {
id : "email",
memberType : "property",
value : "x.y@x.net"
},
basketItem : {
"id" : "basketItem",
"memberType" : "property",
"format" : "string",
"extensions" : {"x-isis-format" : "string"},
"value" : basketItem
}
};
In the action class I tried retrieving the basketItem as a string, but I am getting the following error:
"invalidReason":"Failed to parse representation as value of type 'String'"},"x-ro-invalidReason":"Basket Item is mandatory"}
My action method defintion
@Bookmarkable
@ActionSemantics(Of.IDEMPOTENT)
@MemberOrder(sequence = "1")
@Named("View Basket")
@PublishedAction
public final ShoppingBasket getBasket(
@Named("Session ID") final String sessionID,
@Named("Customer ID") final String customerID,
@Named("Email") final String email,
@Named("Basket Item") final String JSONData) {
}
The main problem is the JSONData parameter is coming across as [object object] in the method and using toString() does not convert it to a normal string. I need it as a normal human readable json and pass it to my Jackson JSON parser for further processing. Any ideas anyone ... Thanks.