2013-06-04 123 views
0

任何人都可以幫助我嗎?我的網絡服務給我一個錯誤。當我打網絡服務器時發生500內部服務器錯誤

500內部服務器錯誤and 304不Modified`

這將返回我的XML數據。我無法獲得所需數據的正文。

var soapMessage ='<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <HelloWorld xmlns="http://5.79.57.16:8095/" /> </soap:Body> </soap:Envelope>' ; 

$j.ajax({ 
     url: 'http://www.lsbo.co.uk:8095/Service1.asmx/HelloWorld', 
     type: "POST", 
     data: soapMessage, 
     dataType: "xml", 
     contentType: "text/xml; charset=utf-8", 
     statusCode: { 
      200: function() { 
       if (304 == jqxhr.status) 
        alert("not modified"); // does not fire 
      } 
     }, 
     error: function (responseData) { 
      alert("Error: " + jQuery.parseXML(responseData)); 
     }, 
    }).done(function (data) { 
     alert("Hye Successfull"); 
    }); 
+0

看起來像一個跨域請求。在這種情況下,您可能必須使用'jsonp' –

+1

錯誤500從服務器端來回傳輸,無法對JavaScript代碼執行任何操作。 –

+1

那麼,如果你打* web服務,你期望什麼? – KooiInc

回答

0

500是內部服務錯誤。我的猜測是,你正在向服務器發送一些數據,而不是期望的。乍一看,您的Ajax請求看起來很好。我會在調試中爲您的服務設置一箇中斷點,並查看它正在獲取的數據以及它是否與期望的數據不同。

相關問題