Click here to Skip to main content
12,692,778 members (33,467 online)
Rate this:
Please Sign up or sign in to vote.
See more: Mobile WCF Ajax Android REST
Bit of an odd one here.

I have a RESTful WCF service which I'm calling from Javascript. Since the service is hosted in a different domain to the web app, I've run into the CORS problem, but resolved this by adding the appropriate headers to the Response in IIS. This seems to be all hunky dory under IE & far so good...

I've now begun to test this on a Galaxy Tab, using the standard Android browser, but when my call returns, I'm getting status === 0 and empty responseText - precisely what was happening under FF before I'd added the CORS headers....

My Google-Fu appears to have let me down on this one - can't find any information as to what I need to do differently on Android...and I assume I'm going to run into the same problem with iPads and Crackberrys....

As a workaround, I've tried using jQuery.ajax - again, on IE/FF all is fine, but under Android, the jQuery call *appears* to do absolutely nothing...

Anyone shed any light on what I may be doing wrong / what I need to tweak?

OK - jQuery calls do actually appear to be doing something now, but I'm always hitting my error: handler, err.statusText === "error" (helpful), err.status === 0.... the plot thickens....
Posted 15-May-12 1:25am
Updated 15-May-12 1:44am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I'm having the same issue (no solution found yet). Did you ever find a fix for this?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 11 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100