Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Form not loading from XML on initialize or form:ready

Avatar

Former Community Member
I am using javascript to retrieve data (XML) from a web service to prepopulate fields on the form using xfa.data.loadXML.



It works fine on the click event, but ideally the fields would be prepopulated without any human intervention. Is there some reason (possibly security) that this functionality does not work on the initialize or form:ready events?



Thanks
4 Replies

Avatar

Former Community Member
Can you give us more info on how you're using xfa.data.loadXML with a webservice? Why are you doing that instead of using a Designer data connection to the web service, or the Acrobat SOAP object?



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
I'm interfacing to a .NET web service. I tried using a web service data connection, but it seems that the Adobe SOAP is different from the SOAP that my .NET web method was expecting (method parameters are passed differently - and I called Adobe who do not offically support .NET).



So I'm manually calling my web service in javascript on the click event of a button, which works fine including loading my data into the form - the call looks something like this:



var cURL = "http://localhost/WebService/WebService.wsdl";

SOAP.wireDump = true;

var service = SOAP.connect(cURL);

var result = service.GetData ();

xfa.data.loadXML(result, 0,1);



But what I really want to do is have this code executed as the form is loaded i.e. on the initialize or form:load events, rather than have the user click a button.



Thanks

Avatar

Former Community Member
Try it on the doc:ready event. If not, take a look at the console (CTRL-J) and see what error is being thrown.



Chris

Adobe Enterprise Developer Support