odataurinorthwind

Why is this URI producing a runtime error in the OData service?


The following URI triggered an error in the public OData service:

http://services.odata.org/V4/Northwind/Northwind.svc/Suppliers?$filter=Address eq '<A'

Entity type Supplier contains property Address of type Edm.String. So, the value of Address may contain any UTF-8 character from the definition (see section 6. Primitive data types).

The server responds with:

Runtime Error: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons).

Is the there something wrong with this URI or it is really a problem on the server side (e.g. inappropriate parsing of the $filter query option)?


Solution

  • You should encode your query URL, e.g. with help of

    http://prasannaadavi.com/2014/06/handling-special-characters-in-odata-queries.html

    How are special characters handled in an oData query?

    In your special case you should try encoding "<A" with "&lt;A"

    --> found in https://web.archive.org/web/20150101222238/http://msdn.microsoft.com/en-us/library/aa226544(SQL.80).aspx)