I'm using the 2011-05-17 Nightly
I'm trying to use data binding to WSDL and to bind a ListGrid to a WSDL data source and do a fetch on it and have it return the values and automatically populate the fields.
The first parameter of my request operation is a SessionId (see below for the JS encoded message). I want to populate this with the value of a global variable. I'm using the code below to do this.
However the SessionId argument is not being emitted in the call. I can't find anywhere in the documentation that describes how to explicitly set the arguments of a WSDL request operation short of using a WebService.callOperation(), but using this does not give me the data binding. I looked at the Salesforce example and the SessionID there is not an argument to the SOAP method but an extra parameter in before it.
So I'm a bit stuck. Can you help?
The WSDL operation:
I'm trying to use data binding to WSDL and to bind a ListGrid to a WSDL data source and do a fetch on it and have it return the values and automatically populate the fields.
The first parameter of my request operation is a SessionId (see below for the JS encoded message). I want to populate this with the value of a global variable. I'm using the code below to do this.
However the SessionId argument is not being emitted in the call. I can't find anywhere in the documentation that describes how to explicitly set the arguments of a WSDL request operation short of using a WebService.callOperation(), but using this does not give me the data binding. I looked at the Salesforce example and the SessionID there is not an argument to the SOAP method but an extra parameter in before it.
So I'm a bit stuck. Can you help?
Code:
var tradingPartnerDs = isc.DataSource.create({
serviceNamespace : ws.serviceNamespace,
wsOperation : "TPList",
fields : [ {
name : "ECGridID"
}, {
name : "NetworkID"
}, {
name : "NetworkName"
} ],
operationBindings : [ {
operationType : "fetch",
wsOperation : "TPList",
recordName : "TPList"
} ]
});
tradingPartnerDs.addMethods({
transformRequest : function(dsRequest) {
if (dsRequest.operationType == "fetch") {
console.log("fetch sessionId: " + sessionId);
var params = {
SessionId : sessionId
};
return isc.addProperties({}, params, dsRequest.data);
}
}
});
Code:
isc.XSElement.create({
ID:"TPList",
mustQualify:true,
fields:{
SessionID:{
name:"SessionID",
type:"string",
xmlMinOccurs:0,
xmlRequired:false
},
ShowInactive:{
name:"ShowInactive",
type:"boolean",
xmlRequired:true
}
}
})
Comment