I am trying to use the TreeGrid with a .Net webservice but with no success. The webservice is called successfully and a response is received, but still the TreeGrid doesnt display any data. I have tried the TreeGrid with an xml source and it works fine. The code I have using is listed below.
isc.SchemaSet.create({
serviceNamespace:"http://tempuri.org/",
schema:[
isc.XSElement.create({
mustQualify:true,
ID:"GetBudgetSheet",
fields:{}
})
,
isc.XSElement.create({
mustQualify:true,
ID:"GetBudgetSheetResponse",
fields:{
GetBudgetSheetResult:{type:"string", xmlRequired:false, name:"GetBudgetSheetResult"}
}
})
],
schemaNamespace:"http://tempuri.org/",
qualifyAll:true
})
isc.WebService.create({
dataURL:"http://localhost:57225/GridService.asmx",
serviceNamespace:"http://tempuri.org/",
soapStyle:"rpc",
operations:[
{inputEncoding:"literal", outputEncoding:"literal", soapStyle:"document", name:"GetBudgetSheet",
inputMessage:"GetBudgetSheetSoapIn",soapAction:"http://tempuri.org/GetBudgetSheet",
outputMessage:"GetBudgetSheetSoapOut"}
],
messages:[
isc.WSDLMessage.create({
ID:"message:GetBudgetSheetSoapIn",
fields:{
GetBudgetSheet:{type:"GetBudgetSheet", xmlRequired:true, name:"GetBudgetSheet"}
}
})
,
isc.WSDLMessage.create({
ID:"message:GetBudgetSheetSoapOut",
fields:{
GetBudgetSheetResponse:{type:"GetBudgetSheetResponse", xmlRequired:true, name:"GetBudgetSheetResponse"}
}
})
]
})
isc.TreeGrid.create({
ID: "transactionTree",
left: 220,
top: 200,
width: 600,
height: 400,
nodeIcon:"icons/16/person.png",
folderIcon:"icons/16/person.png",
showOpenIcons:false,
showDropIcons:false,
closedIconSuffix:"",
alternateRecordFrequency:1,
alternateRecordStyles:true
});
var transactionsDS = isc.DataSource.create({
ID: "transactionsDS",
dataFormat:"xml",
serviceNamespace: "http://tempuri.org/",
recordXPath: "//Level",
operationBindings : [
{operationType: "fetch", wsOperation:"GetBudgetSheet"}
],
fields:[
{name:"LevelID", primaryKey:true, valueXPath:"LevelID", type:"long"},
{name:"AccountName", valueXPath:"AccountName"}
]
});
transactionTree.setDataSource(transactionsDS);
transactionTree.fetchData();
The following is the log from the developer console.
Request:
{
actionURL:"http://localhost:57225/GridService.asmx",
showPrompt:true,
transport:"xmlHttpRequest",
useSimpleHttp:true,
promptStyle:"dialog",
httpMethod:"POST",
contentType:"text/xml",
httpHeaders:{
SOAPAction:"http://tempuri.org/GetBudgetSheet"
},
sendNoQueue:true,
callback:{
target:null,
methodName:"$37c"
},
willHandleError:true,
serverOutputAsString:true,
clientContext:{
parentNode:{
undefined:null,
_parent_isc_ResultTree_3:null,
$399:"/",
_isOpen_isc_ResultTree_3:true,
$40a:"transactionsDS",
$27g:"loaded",
children:[
]
},
relationship:{
childDS:null,
parentDS:null,
isFolderProperty:null,
rootValue:null,
idField:"id",
parentIdField:"parentId"
},
childrenReplyCallback:null
},
data:"<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' \n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><soap:Header></soap:Header><soap:Body>\r<ns0:GetBudgetSheet \n xmlns:ns0=\"http://tempuri.org/\">\r <ns0:parentId></ns0:parentId>\r</ns0:GetBudgetSheet>\r</soap:Body></soap:Envelope>"
}
Response:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetBudgetSheetResponse xmlns="http://tempuri.org/"><GetBudgetSheetResult><List><Level><LevelID>2</LevelID><AccountName> - EP</AccountName><ParentLevelID>0</ParentLevelID></Level><Level><LevelID>6</LevelID><AccountName>Account 1</AccountName><ParentLevelID>2</ParentLevelID></Level><Level><LevelID>7</LevelID><AccountName>Account 2</AccountName><ParentLevelID>2</ParentLevelID></Level><Level><LevelID>8</LevelID><AccountName>Account 3</AccountName><ParentLevelID>2</ParentLevelID></Level><Level><LevelID>9</LevelID><AccountName>Account 4</AccountName><ParentLevelID>2</ParentLevelID></Level></List></GetBudgetSheetResult></GetBudgetSheetResponse></soap:Body></soap:Envelope>