Expand my Community achievements bar.

DataConnection.execute(0) does not return any value

Avatar

Level 2
Hi



I have a WSDL data connection when I try and programmatically execute the web service the method says it will return a boolean but nothing gets returned after the web service fails execution because the host isn't avaliable. Why doesn't the boolean get returned. Here is the code snippet i'm using.



var check = false;

check = xfa.connectionSet.DataConnection.execute(false);

var xml = txtXml.rawValue;



if (check)

{

xfa.datasets.data.loadXML(xml,false,true);

txtId.rawValue = appRef;

app.alert("Contract received and uploaded! ");

//this.access = "readOnly";

//xfa.layout.relayoutPageArea(0);

}

else

{

app.alert("Application failed to execute web service call.");

}



Please help!



Dylan
8 Replies

Avatar

Former Community Member
Try wrapping the statement in a try/catch:



try {

check = xfa.connectionSet.DataConnection.execute(false);

} catch (error) {

app.alert("error caught");

}



Ernest

Adobe Systems

Avatar

Level 2
Ernest I cannot thank you enough. It works.



Regards,



Dylan

Avatar

Former Community Member
Hi,



Is it possible to access database from a stand-alone PDF template.?



Please suggest me in this regard.

Avatar

Level 2
Hi Punugubati



It is posible, you would just need to reader extend the pdf(NB) and then create a data connection to the database.

Avatar

Former Community Member
Dear Dylan,



Tnx for the solution.



But I confused with pdf(NB)..?



what Pdf(NB) stands for..?

Avatar

Former Community Member
Dear Mr. Dylan,



What I thought to develop is to write a JDBC connection in the Stan-alone PDF template and access database.



example: PDF is designed in such a way that it should have "USERNAME" , "PASSWORD" , "LOGIN BUTTON" , so that PDF stand-alone template on every desktop should access the database on entering the correct credentials.



is it possible..?



if possible , please provite the solution..?