You need to sign in to do that
Don't have an account?
degmo
HttpGet methods do not support return type
Hi All,
I am trying to have my Apex Rest class method return a wrapper class but getting the exception: HttpGet methods do not support return type of OrderWrapper.OrderItem. Any idea why I am getting this error?
myOrderService.apxc
OrderWrapper.apxc
I am trying to have my Apex Rest class method return a wrapper class but getting the exception: HttpGet methods do not support return type of OrderWrapper.OrderItem. Any idea why I am getting this error?
myOrderService.apxc
@RestResource(urlMapping='/OrderService/*') global class myOrderService{ @HttpGet global static OrderWrapper.OrderItemWrapper getOrderSummary() { // Logic } }
OrderWrapper.apxc
Global Class OrderWrapper { global class OrderItemWrapper { public string type {get;set;} public string description {get;set;} } public class InvoiceItemWrapper { public string invoiceId {get;set} public string invoicenumber {get;set;} }
Hello degmo,
Please try below Code...
myOrderService.apxc
OrderWrapper.apxc
Please Mark It As Best Answer If It Helps
Thank You.
Also refer this link for better understanding.
https://developer.salesforce.com/docs/atlas.en-us.214.0.apexcode.meta/apexcode/apex_rest_methods.htm
Thanks.