Hi all,
I am trying to call a webservice through javascript to return a dataset to bind it to a datagrid on the client side.
I am using a scriptmanager and registered the service by setting the service path.
I am calling a method on a Textbox onKeydown event to call the webservice method. The web service is returning the a data set. But the problem is am geting an exception stating the following
The server method 'GetDataSet' failed with the following error: System.InvalidOperationException-- A Circular reference was detected while serializing an object of type "System.Globalization.CultureInfo"
Please help me out.
See the following code to get an idea about the problem i have
<WebMethod(EnableSession:=True)> _PublicFunction GetDataSet(ByVal prefixTextAsString)As DataSet
Dim dtAs DataTabledt =New DataTable
Dim drAs DataRowdt =Me.GetSelectedTestSchema()
dr =Me.PopulateSelectedTestsRow("1020","dafda", dt)Try
dt.Rows.Add(dr)
Catch exAs ExceptionEndTry
Dim dsAs DataSet =New DataSet()ds.Tables.Add(dt)
Return dsEndFunction
Javascript code
function GenerateGrid(){
var myGrid = igtbl_getGridById("grdSelectedTests");
TestListService.GetDataSet("x",OnWebRequestComplete);
// myGrid.Control.Set_DataDataSource(TestListService.GetDataSet("x").Table[0]);
//
}
function OnWebRequestComplete(results)
{
'I am using the Infragistics ultraWebgrid
var grdControl = igtbl_getGridById("grdSelectedTests");grdControl.control.set_data(results);
}
Scriptmanager code
<asp:ScriptManagerID="ScriptManager1"runat="server">
<Services>
<asp:ServiceReferencePath="../AutoCompleteServices/TestListService.asmx"/></Services>
</asp:ScriptManager>
Hi,
According to my understanding to your problem, I don't think it's a AJAX specific issue. The exception is related to your server side code.
Can you debug your server side code to try to solve it?
Or you may post the code for methods:GetSelectedTestSchema() andPopulateSelectedTestsRow here.
We are marking this issue as "Answered". If you have any new findings or concerns, please feel free to unmark the issue.
I too am having the same problems.
I'm using C# to write my webservice, I have almost an identical setup for the client-side scripts.
I get this error even when returning an empty DataSet.
[WebMethod]public DataSet GetData() {return new DataSet(); }
Does anyone know what this error message is telling me? I tried debugging it, and no exception is thrown from the webservice and it works fine when I send a soap request to it.
Thanks,
Lee
You may try to overcome it by setting response format to XML. For instance:
[System.Web.Script.Services.ScriptMethod(ResponseFormat=System.Web.Script.Services.ResponseFormat.Xml)]
public DataSet GetData()
{
No comments:
Post a Comment