This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I know this isn't the ideal place for this, but I am writing a REST client to talk to Sharepoint 2010's REST API (ListData.svc). The URL works when simply typed into the address bar of IE and returns XML of the collections. But in Firefox, Poster, RESTClient, and my code (using Jersey's rest client) I get 400 Bad Request. The URL is identical, and running a GET being typed into the address bar of IE. I tried sending accept headers asking for text/xml and not doing so. 400 every time.
I don't know "what gives", but I have a few hints that may help you solve the issue:
- A nice, and free, test tool for both SOAP and RESTful web services is soapUI: http://www.soapui.org - Use a packet sniffer, like for instance WireShark, to examine the successful requests from your browser.
As an additional exercise, compare with the unsuccessful requests. There is bound to be a difference.
Reasonable suggestions all. We eventually found this which advised us to switch away from anonymous authentication. Once done, it works in everything! Except my code. But at least now that all browsers, Poster and RESTClient, I can now at least know the problem is in my code.
I suspect that the new problem is differences in how I am presenting authentication credentials. I am using Jersey's rest client.
A simplistic test, but this ought to work, yes? That is how I pass my basic authentication credentials, right?
Joined: Mar 12, 2009
Found some articles saying that HTTPBasicAuthFilter used to have a bug that made it not work, but I am using 1.10, and they claim it should be fixed.