Hmmm this seems silly, so I feel silly. I have a custom operation on an Odata service which has a string parameter. It works fine when the string contains no special characters, but as soon as I include the ['] character I get:
<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\r\n<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\r\n <code></code>\r\n <message xml:lang=\"en-US\">Bad Request - Error in query syntax.</message>\r\n</error>
I am invoking the service with the following code:
new DataServiceContext(new Uri(svcUri)).Execute<string>(new Uri(relativeOperationUrl, UriKind.Relative));
I've tried encoding like this [& apos;] (xml encoding) and like this [%27] (url encoding) and the things is still blowing up.