WP7 error: "The remote server returned an error: NotFound." - api

I have this code that it used to work, but at some specific time it stopped to work and returned the error "The remote server returned an error: NotFound."
WebClient deliciousWebClient = new WebClient();
deliciousWebClient.Credentials = Credentials;
deliciousWebClient.DownloadStringAsync(new Uri("https://api.del.icio.us/v1/tags/get"));
deliciousWebClient.DownloadStringCompleted += (s, ee) =>
{
if (ee.Error == null)
{
…
Any suggestion on this error?
In this code, the error is pointing to delicious endpoit, but the same error is happening with some other services...

The NotFound error is a classic 404 error, so it's possible that the API endpoint is down or that it changed on you.
I'd start by using Fiddler2 to make the requests manually. That'll help you figure out whether the issue is in your code somewhere or on the API side.
It's hard to get Fiddler working with the WP7 emulator, as you noted below. One trick I've used in the past when I got really desperate was to write a quick console app that used the same code that my Windows Phone app was executing. Then I was able to successfully intercept the traffic. It turned out that my request being properly formatted.

Related

Microsoft Graph snippets sample for ASP.NET Core 3.1 - Authentication error

As far as I know I have followed the instructions for setting up the Microsoft Graph sample https://github.com/microsoftgraph/aspnet-snippets-sample, including joining the Microsoft 365 Developer Program. However when I run the sample and attempt to log in with my new Developer Program user I get the following error message:
Authentication error "Value cannot be null. (Parameter 'value')"
The error us being caught in this routine:
options.Events.OnAuthenticationFailed = context => {
var error = WebUtility.UrlEncode(context.Exception.Message);
context.Response
.Redirect($"/Home/ErrorWithMessage?message=Authentication+error&debug={error}");
context.HandleResponse();
return Task.FromResult(0);
};
If I log in with my personal Microsoft account then everything works fine, so I'm guessing this has something to do with my Developer Program account. The error message isn't very helpful and there not stack trace to speak of. I've tried using Fiddler to see if there's any more information but with no luck either. Any ideas about what I might be doing wrong?
Tested and reproduced the issue. You are getting this error because, as you have created application in one tenant and accessing the application with the Developer Program account(another tenant).
The Solution would be provide Provision for the application (service principal creation) Consent the application with the developer Program account(needs to be admin) if you want to use the application in developer tenant and Please below call
https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=id&redirect_uri=https%3A%2F%2Flocalhost%3A44307%2F&prompt=admin_consent
After looking at the error messages in the output from the Kestrel web server I discovered that the line causing the problem was this one:
identity.AddClaim(new Claim(GraphClaimTypes.TimeZone, user.MailboxSettings.TimeZone));
and it was because the value of user.MailboxSettings.TimeZone was null. Once I set up a TimeZone in my developer account then everything works fine.

The CGI application did not return a valid set of HTTP errors. 502.3 - Bad Gateway: Forwarder Connection Error (ARR) on Azure ASP.NET Core App

All of a sudden we are seeing this random error / exception in our web application.
Failed to load resource: the server responded with a status of 502 (Bad Gateway).
In the Log Stream, we are seeing the following details, with specific error code as 502.3 - Bad Gateway: Forwarder Connection Error (ARR).
Also, sometimes in the browser itself we see "The CGI application did not return a valid set of HTTP errors." getting displayed.
Most of the searches for these error codes refer to "IIS / Proxy Server" configuration. But, we haven't changed any such settings.
The error happens very randomly and not specific to any user action/function. Same functionality works first and on second execution immediately after first one throws this error.
How to figure out what is causing this and how to fix?
I google this question, because the program was normal at the beginning, and the subsequent 502.3 error. After I checked the information on the Internet, I feel that it can only give us an inspiration, and it cannot solve your problem immediately.
So my suggestion is that first you browse post1 and post2 I provided.
Next, proceed to Troubleshoot according to the steps of the official documentation. Specific errors require specific analysis.

URL works fine from browser but from google plus we get a internal service error

The website URL works fine. The link from google maps on the phone works fine. For some reason when you google it in the browser (mobile browser or desktop) you get an Internal Service Error. Google said it was nothing on their end to be done.
Has anyone encountered this or have an idea of what's causing it? The error received is below.
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator and inform them of the time the error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Apache Server at www.thetechbuyer.com Port 80
As the error suggests, an Internal Server Error is internal to your webapp or web service on your host. It usually means that your program, whatever it is doing, has crashed. This could be because of misconfiguration, or a bug in your code, or something else - without knowing more (possibly a lot more) about your server environment, it is impossible to know what.
Check your server logs - they should have more information.
(It also isn't clear what this has to do with Google+.)

Custom JSON IErrorHandler in WCF returning StatusCode 200/504 when should return 400

I have a WCF service that among other bindings also uses WebHttpBinding for JSON inputs/results.
I made a custom IErrorHandler implementation in order to be able to set the StatusCode to 400 when something goes wrong and also return a JSON understandable message. It´s the straight implementation that you can find everywhere (nice way described here).
My problem is: when I test it locally using Visual Studio Web Development Server (Cassini) it works perfectly. However, when I deploy it to my test server (Windows 2008 with standard config for IIS and everything else) it does not work.
When I call it and debug with Firebug I get a HttpStatusCode 200 as a return and no response text. With Fiddler I get a HttpStatusCode 504 and no return at all. However, the behavior I expected (and what happens locally) is a call to the error callback of the ajax call with the responseText set.
I debugged it remotely and everything looks just fine. The execution pipeline is OK and all the classes are called as they should be just like they are locally, except it does not work.
Any suggestions? I´m pretty much out of options here to figure this out.
Thanks a lot!
if firebug and fiddler are giving different results, what happens if you telnet to it directly and perform a request (Something like:)
GET /VirtualDirectoryAndGetData HTTP/1.1
HOST: example.com
[carriage return]
It wouldn't surprise me if you're somehow getting odd headers/formatting back (to explain why firebug/fiddler disagree)
Another thing to test would be publishing to your dev machine to see if it's a machine-specific issue or a server vs dev webserver issue.
If it's happening anywhere outside VS, you might also try commenting out the lines where you set
rmp.StatusCode = System.Net.HttpStatusCode.BadRequest;
rmp.StatusDescription = "Bad request";
This may indicate whether it's a response code issue or an error handler issue.
If you can edit your question to include the results (with sensitive info removed), we'll see if we can track it down further.
Edit: after looking at the question again, it may well be that the server is erroring before it can send ANY response. FF might assume 200 by default, whereas ie might assume 504 (Gateway Timeout). This is total speculation but is possible. Do you see anything in the event logs?
I had a similar issue which I was able to solve. Take a look at the IIS settings. Details on how I overcame the issue are in this post: IErrorHandler returning wrong message body when HTTP status code is 401 Unauthorized

Error rendering Councillors Online web part: [The remote server returned an error: (400) Bad Request.]

I am implementing a WCF based solution and all was working fine until I started to process larger quantities of data.
The Solution worked well in DEV where we added large quantities of daata when we restored the site to QA we got this error . Error rendering Councillors Online web part: [The remote server returned an error: (400) Bad Request.]
Can anyone propose a solution to this problem?
Thank you
My WCF web.config looks as follows :
========================================================
This error can also come if you WCF Code return error -- Object reference not set to an *instance of an object*
As you can track through Fiddler
{"Detail":"Object reference not set to an instance of an object."}
As you can also user Log to treas it out