cancel
Showing results for 
Search instead for 
Did you mean: 

Code based Odata CLient Proxy Response handler returns Exception when the response contains null

08-12-2026 7:02 AM
JyothirAditya_Kundhurthi Product and Topic Expert
213 views 3 comments
0 Likes
SAP Managed Tags
Subscribe

hi, 

 

we are using code based odata client proxy -( rest service ) to send or receive data . i have defined the model class and set the response body structure for the HTTP operation. In the response handler class - /IWBEP/IF_CP_RESPONSE_HANDLER~HANDLE_REST_RESPONSE, it is unable to parse the response to the desired format and getting error /IWBEP/CM_CP-168: Instance of a complex type could not be deserialized. I have defined the response structure fields to be of type string and as nullable. 

Response payload structure: 

[
  {
    "status": 500,
     "id" : null,
    "externalId": null,
"message": "Some string"
  }
]

Some of the fields in the response structure are optional and they are ignored or sent as null by other REST API. Can you please guide what is wrong/missing and how to resolve the error. 

 

Thanks 

0 Likes

Accepted Solutions (0)

Answers (1)

Answers (1)

sravan_aleshwaram
Active Participant
0 Likes

Hello @JyothirAditya_Kundhurthi 

The JSON response does not match the proxy model

For nullable fields, ensure the proxy property is marked nullable. If null handling still fails, ask the REST API to omit null fields or send empty strings.

Then regenerate the OData client proxy/model and retest.


Thanks,
Sravan

JyothirAditya_Kundhurthi
Product and Topic Expert
Product and Topic Expert
0 Likes
its not possible to omit or send empty strings from other system. i have defined the property as nullable, The json response matched the proxy model.This issue arises only when the response is different, for other case able to map the data.