私は web-api を見始めたばかりで、小さな自己ホスティング プロジェクトをセットアップしました。基本的なコントローラーをセットアップし、ブラウザーでポイントしようとすると結果が返されました。
今、jquery.getを使ってそれを呼び出そうとすると
例えば
$.get("http://<my ip>:8082/api/stats/single/1/i")                 
    .done(function(result) {
        alert("results");
     })
    .error(function(result) { 
       alert(result.status + " " + result.responseText); }
 );};
エラーが発生します (404 undefined)
上記の結果をフィドルで見ると、期待どおりのjson結果が表示され、生のヘッダーは次のとおりです...
 HTTP/1.1 200 OK
 Content-Length: 415
 Content-Type: application/json; charset=utf-8
 Server: Microsoft-HTTPAPI/2.0
 Date: Tue, 18 Jun 2013 13:04:03 GMT
テスト データを提供することがわかっている別のリモート サーバーで jquery を試すと、.get は正しく返されます。このサーバーからの生のヘッダーにはもっと多くのものがあることに気付きました...
  HTTP/1.1 200 OK
  Cache-Control: no-cache 
  Pragma: no-cache
  Content-Length: 431
  Content-Type: application/json; charset=utf-8
  Content-Encoding: gzip
  Expires: -1
  Vary: Accept-Encoding
  Server: Microsoft-IIS/8.0
  Set-Cookie:   ARRAffinity=462716b27beb795c09df205e893d3e263b1ec9b710c92f7c4203f4b63ac1aed2;Path=/;Domain=sampleservices.devexpress.com
   Set-Cookie: ASP.NET_SessionId=j4sdehjie1h0cv2rukxnudw3; path=/; HttpOnly
   Access-Control-Allow-Origin: null
   Access-Control-Allow-Credentials: true
   X-AspNet-Version: 4.0.30319
   X-Powered-By: ASP.NET
   X-Powered-By: ARR/2.5
   X-Powered-By: ASP.NET
   Set-Cookie: WAWebSiteSID=14a8502027ea4cc3a9e65036ed421c5e; Path=/; HttpOnly
   Date: Tue, 18 Jun 2013 13:26:52 GMT
私の web-api テストが $.get??
(質問への回答)..
クロムでクエリを使用すると、
HTTP/1.1 200 OK Content-Length: 405 Content-Type: アプリケーション/xml; charset=utf-8 サーバー: Microsoft-HTTPAPI/2.0 日付: 2013 年 6 月 19 日水曜日 05:34:33 GMT
<ArrayOfStateController.State xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebApiEquipmentStatus"><StateController.State><Description>state1 description</Description><Name>state1</Name></StateController.State><StateController.State><Description>state2 description</Description><Name>state2</Name></StateController.State></ArrayOfStateController.State>
そしてjqueryを実行すると、フィドラーで次のように表示されます
HTTP/1.1 200 OK
Content-Length: 107
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Wed, 19 Jun 2013 05:35:58 GMT
[{"Name":"state1","Description":"state1 description"},{"Name":"state2","Description":"state2 description"}]
[編集]
提案から、私は以下を試しました..
 enter code here
enter code here
$.ajax.crossDomain = true;          
                    getSingle = function () {
                        $.getJSON("http://<ip>/api/state/single/1/i?callback=process", 
                            {header: 'Access-Control-Allow-Origin: *'})
                            .done(function (result) {
                                var process = function(data) {
                                    $("#results").text(data.toString());
                                };
                            })
                            .error(function (result) {
                                $("#results").text(result.status + " " + result.responseText);
                            });
                    };
Chrome コンソール ウィンドウを見ると、まだ
"XMLHttpRequest cannot load http://<ip>:8082/api/state/single/1/i?callback=process. Origin null is not allowed by Access-Control-Allow-Origin. "
私は一日中この件についてグーグルで調べましたが、これを解決する方法を示すものは何もないようです(イントロレベルで)