Interface:
namespace SQRT_WCF
{
[DataContract]
public class PlaceOrder
{
[DataMember]
public string claimID { get; set; }
Answer was buried here:
WCF BodyStyle WrappedRequest doesn't work for incoming JSON param?
The name of the wrapper is not the parameter type, but the parameter name.
So in my case, the wrapper name was "order", because my parm name is "order":
SQ_jsonModel.Response placeOrderSQRT(PlaceOrder order);
The following works from SOAP-UI now:
{
"order" : {
"claimID" : "value",
"rederenceDate" : "value"
}
To me it's very shocking; normally we can change variable names and parms names (just not Class Names) with absolute no impact on the user interface. The reference post shows how you can use the attribute "MessageParameter" to set the external name, and still allow one to change the internal name if needed.
I think you might need to stringify your object.
var obj = {
"claimID" : "value",
"rederenceDate" : "value"
}
.......
data: '{ "argPlaceOrderJSON": ' + JSON.stringify(obj) + ' }'
I had a similar issue and turned out that I had to define my request format and body. Try this:
[OperationContract]
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json)]
YourResultType placeOrder(PlaceOrder argPlaceOrderJSON);