Highlighted

About live cycle submitting data to xml

Avatar

Guest

30-03-2009

I see much documentation regarding live cycle submitting its data in xml format, but i haven't found any comprehensible examples. Can someone point me to an example where a form created in LiveCycle has its xml processed ?

Replies

Highlighted

pguerett

30-03-2009

The processing of the xml is done on the server side. From a designer perspective it Posts the xml to the server and its job is done. It would depend on what you want to do with the XML on the server side that woudl dictate where to start looking.
Highlighted

Avatar

Guest

31-03-2009

I would like to read the xml on the server side, determining what fields where in the form, and what their values where.
Highlighted

pguerett

31-03-2009

Then it is no different than submitting an HTML page to the server. You write a program to recieve the inbound transmission and get teh name value pairs back out. This is exactly the same thing except you are recieving an XML file. You can load that file in an XML parser and get the fields that you want.
Highlighted

Avatar

Guest

31-03-2009

I have written a webservice, and am hitting it when submitting the liveCycle form. What values do i have to send to the webservice, so that i can get the xml document which represents the filled out form.
Highlighted

pguerett

31-03-2009

Ah ...that is different. The webservice defines inputs and outputs. You can define a unique input for each field on the form then bind the web service fields to the form fields (if you have a lot of fields this gets very tedious).



Another way to solve the issue involves creating a single field (usually hidden) on the form (make it multiline). Then bind the input of the web service to this field. Now you need to populate the field with the data in the datadom. To do this use this command:



FieldName.rawValue = xfa.datasets.data.saveXML("pretty");



This will take the xml data from the form and put it into that field. Now when you invoke the web service that data will be included in the web service call. Note that because you are sending XML data you may have to wrap it in a CData section. You can add this in the script that is being called. I woudl create a regular button (visible to the user) that they woudl click as the submit. You can have the code to populate th efield and add the CData section then call the webservice. Put the Web Service buttton on the form and make it invisible. Then use this code as the last line on the visible button:



InvokeBTN.execEvent("click");



Make sense?
Highlighted

Avatar

Guest

31-03-2009

I understand what you are saying. But i don't have the experience with the designer to make it happen. Would you tell me the steps to get the script to run against the object ? I have named a text field in the bindings tab of the object palette, will that suffice for renaming of the field ?
Highlighted

pguerett

31-03-2009

Have you been able to get your WSDL into the Dataview Tab? If so then you will see the structure of your web service in a Tree view. You can take your input field (from the tree view and drag and drop it onto the field that will hold all of your data). A little icon will appear beside it indicating that it is bound. Now drag the InvokeBTN from the DataView onto the form. This is the execute button for the web service. Now make the button invisible by changing the presence property on the Object palette. Now all that is left is to drag th erugular button onto th eform and add the code as per my previous message.
Highlighted

Avatar

Guest

31-03-2009

I have previously set a connection to my webservice asmx using the button execute event's web servie url.



I do have a treeview in the data view tab, and have icons to the right of one of my text fields and my submit to database button.



I don't understand, "take your input field and drag and drop it onto the field that will hold all of your data"



On my form are 1 check box, three text fields, one of which is to be hidden. In dataview, i see none of these in the tree.



Also, please, how do i enter the command code for my new button?
Highlighted

pguerett

31-03-2009

Is your web service public facing? Can I hit it from here? It woudl be easier for me to do it than describe all of the steps. If you want to send the form to livecycle8@gmail.com I will do whati can and send it back.