Highlighted

web service returning dataset

Avatar

17-03-2009

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);

}

Replies

Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

17-03-2009

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.
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

17-03-2009

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.