Does Web Servicse API use Name or DisplayName of custom fields?
WS API is using Display Name and not Name of custom fields. To be exact it is using Display Name that is camel-cased with the first letter also capitalized and with no spaces.
In this example a custom field is created on a PortfolioItem object:
We use DisplayName in the query: