Trouble with .Net WebService and dataset

Good evening,

We are developing with VB.Net 2005 WebServices, working with your datasets. We started developing in the eval version of 5.6 and this was working fine. The data returned and populated many items on the form with no problem. When our eval expired, we purchased the latest copy and since then we have been getting the following error:

Line: 61
Char: 1235
Unexpected token “[”
//–>[<–XSElement ID:DepartmentListResponse]
Code:0
URL:http://localhost/ItemHQ/Default.aspx

We still have a version running on one server that works, but when we rebuilt it breaks again. Here is an example of the data calls that cause the error:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=“http://www.w3.org/1999/xhtml” >
<head id=“Head1” runat=“server”>
<title>NASGW: Main</title>
<script type=“text/javascript”>var isomorphicDir = “isomorphic/”;</script>
<script type=“text/javascript” src=“/isomorphic/system/modules/ISC_Core.js”></script>
<script type=“text/javascript” src=“/isomorphic/system/modules/ISC_Foundation.js”></script>
<script type=“text/javascript” src=“/isomorphic/system/modules/ISC_Containers.js”></script>
<script type=“text/javascript” src=“/isomorphic/system/modules/ISC_Grids.js”></script>
<script type=“text/javascript” src=“/isomorphic/system/modules/ISC_Forms.js”></script>
<script type=“text/javascript” src=“/isomorphic/system/modules/ISC_Databinding.js”></script>
<script type=“text/javascript” src=“/isomorphic/skins/SmartClient/load_skin.js”></script>
<script type=“text/javascript” src=“/DataSources/NASGW2.js”></script>
</head>
<body>
<form id=“Form1” runat=“server”></form>
<script type=“text/javascript”>

var nasgwService= isc.WebService.get(“http://localhost/WebServices/”);
var depDS = nasgwService.getFetchDS(“DepartmentList”, null, { recordXPath: “//Departments” });

isc.TreeGrid.create({
ID:“categoryTree”,
showHeader:false,
leaveScrollbarGap:false,
animateFolders:true,
canReparentNodes:false,
selectionType:“single”,
animateRowsMaxTime:750
});

depDS.fetchData(
{LoginType: “<%=Session(“LoginType”) %>”},
function (response, data, request) {
var dataTree = isc.Tree.create({
ID: “depTree”,
modelType: “parent”,
rootValue: “root”,
nameProperty: “name”,
idField: “id”,
parentIdField: “parentid”
});
dataTree.linkNodes(data);
categoryTree.setData(dataTree);
}
);

Here is a sample of the XML returned from the dataservice when opened and tested directly in IE:

<?xml version=“1.0” encoding=“utf-8” ?>

The webservice seems fine when opening in WSDL tab of your control panel, and returns the proper XML in the output box, so there does not seem to be anything wrong with the webservice (especially since it still works with the one build.) Please help! Thanks, J

Hello ga-1,

The most likely cause is a mixture of 5.6 and 5.7 resources in your browser cache. Note that when using <loadISC> tag with SmartClient server, we add the version to the URL to prevent this kind of mismatch - that’s a good pattern for you to use as well, to prevent end users experiencing these kinds of mismatches.

If that doesn’t solve the problem, can you provide Developer Console logs from Internet Explorer that have the RPCManager log category set to DEBUG and show the error. This will help us understand where in your application flow this is happening.

logs sent

I sent the logs to you via email because they were too big to post here. I cleared the cache many times during the process of creating the datasource and testing and still I get the same error. I am trying now with 5.7. We are now getting the same issue on the other server as well, developing from a different box. I did notice when I was creating the datasource that the [ character appeared in front of one of the first node when I clicked show messages. This is the character that is showing up in the error (see first previous post). It dissapeared when I refreshed and I haven’t been able to reproduce that error. Please advise. Thanks, GA-1

Through offline interaction it was determined that this resulted from a call to webservice.getFetchDS() in which resultType, which is a required parameter, was not supplied. Through a series of happy accidents this worked anyway in 5.6, but not in 5.7.

You will hit this issue if you have code like:

var service = isc.WebService.get([i]serviceNamespace[/i]);

var ds = service.getFetchDS(
    "[i]operationName[/i]",
    null,
    {recordXPath: "//SomeXPath"}
);

ds.fetchData();

You can modify this code to:

var ds = isc.DataSource.create({
      serviceNamespace : [i]serviceNamespace[/i],

      operationBindings : [
      {
           operationType: "fetch",
           wsOperation:"[i]operationName[/i]",
           recordXPath:"//SomeXPath"
      }]
});
ds.fetchData();