Expand my Community achievements bar.

web service returning dataset

Avatar

Former Community Member
I have an asp.net web service I used for all my asp.net forms. I would like to use the same service for pdf forms. I have a test method which takes no parameters and sends an email. This works fine. Can I use a method which returns a dataset and if yes how? I tried the following code but get an error, oItems has no properties. How do I get values out of a dataset?



SOAP.wireDump = false;

var oListURL = "https://ao-wapps/webservices.asmx?wsdl";

var e;

try

{

var service = SOAP.connect(oListURL);

var oItems = service.GetInv("smith");

var nCount = 0;

var nLimit = 10;

for(var nItemCount in oItems)

{

for(var nItemNode in oItems[nItemCount])

{

if (nItemNode == "inet")

DropDownList2.addItem(oItems[nItemCount][nItemNode]);

}

if (++nCount >= nLimit)

break;

}

}

catch(e)

{

xfa.host.messageBox("Problem with list Call: " + e);

}
3 Replies

Avatar

Former Community Member
PDF Forms only support simple types through a web service (i.e. strings, int, float, xml wrapped in CData as examples). There is no container to hold the recordset hence it does not know what to do with the return.

Avatar

Former Community Member
ok, so how would I return data from a table with a web service?

Avatar

Former Community Member
If the DB can return XML then you can do that (wrap it in a CData section or the SOAP envelope will get confused). If not then returning a record at a time and assigning each column to a variable is also an option.