404 error when attempting to retrieve results from odata link from VB.NET
So I'm working on a project that will retrieve data from an ad hoc query odata link in one of our CRM environments. But no matter what I try, I'm getting either a 404 error. or a 401 error.
I am using the vb.net web client object.
I've tried FIVE different methods of authentication.
- None (401)
- Basic (404)
- Default Network Credential (404)
- Created Network Credential (404)
- Basic + Created Network Credential (404)
I am 100% positive that the URL is correct. I can paste it right into my browser no problem.
I've also fiddled around with the web.config on my CRM web server. Currrently, there is this:
<location path="AdHocQuery.ashx">
<!-- System.webServer is for II7 (Vista and Longhorn Server)-->
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" />
<basicAuthentication enabled="true" realm="ad" defaultLogonDomain="ad" />
<windowsAuthentication enabled="true" authPersistSingleRequest="false" /></authentication>
</security>
</system.webServer>
</location>
And basically, here's what my VB code looks like:
(Why doesn't this forum have an “Insert Code” option? Sheesh)
Comments
-
finally got this figured out, after a whole lot of trial and error. I was able to get it working using the preferred method of Default Network Credential - the only way I could come up with to actually not have to store a password somewhere.
After looking in the IIS logs on our learning environment, I saw three requests each time I ran the global change in our dev server…. the first was a 401, then a 302 then a 404 for the generic error page. I didn't even realize it but the generic error page does not exist, so IIS was getting an actual 500 error then redirecting to the generic error page, and since that didn't exist, it was a 404.
This was in my web.config on the learning server<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
When I removed the defaultRedirect attribute, IIS started returning a 500 error instead, and I looked in the server Event Viewer and saw that the user I set up didn't actually have permission to run the ad hoc query!
1
Categories
- All Categories
- New eTapestry Home Community
- New K-12 Community Home (TEST)
- New Higher Education Home Page (Test)
- New Impact Edge Community TEST
- New YourCause Community TEST
- New SKY Community TEST
- New Grantmaking TEST Community
- New Altru Test Community
- New bbcon Community - TEST
- 12 Blackbaud Agents for Good™
- New Raiser's Edge NXT Community
- 8 Blackbaud Community Help
- 223 bbcon®
- 1.4K Blackbaud Altru®
- 411 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.2K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 16 donorCentrics®
- 361 Blackbaud eTapestry®
- 2.7K Blackbaud Financial Edge NXT®
- 688 Blackbaud Grantmaking™
- 604 Blackbaud Education Management Solutions for Higher Education
- 3.3K Blackbaud Education Management Solutions for K-12 Schools
- 954 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 85 JustGiving® from Blackbaud®
- 7.1K Blackbaud Raiser's Edge NXT®
- 4K SKY Developer
- 258 ResearchPoint™
- 124 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 249 Member Lounge (Just for Fun)
- 40 Blackbaud Community Challenges
- 37 PowerUp Challenges
- 3 (Closed) PowerUp Challenge: Grid View Batch
- 3 (Closed) PowerUp Challenge: Chat for Blackbaud AI
- 3 (Closed) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 829 Community News
- 3.1K Jobs Board
- 57 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
