Expand my Community achievements bar.

About live cycle submitting data to xml

Avatar

Former Community Member
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 ?
14 Replies

Avatar

Former Community Member
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.

Avatar

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

Avatar

Former Community Member
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.

Avatar

Former Community Member
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.

Avatar

Former Community Member
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?

Avatar

Former Community Member
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 ?

Avatar

Former Community Member
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.

Avatar

Former Community Member
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?

Avatar

Former Community Member
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.

Avatar

Former Community Member
Paul --



Thank you for your help. I was able to get this to work, by using javascript you sent to load values to a field. However, i had two text boxes and a check box on the form, and only the values for the two textboxes was sent in the xml.



Does this indicate that i am missing something? I would think that checkbox values would be stored in the xml, and should have been loaded using the script code: FieldName.rawValue = xfa.datasets.data.saveXML("pretty"); Does this script not work for anything other than textboxes ?

Avatar

Former Community Member
Yes ..the checkbox binding is set to none (indicating do not include it in the data set - like I did for the temp field). Change it to Normal if you want it to appear in the dataset.

Avatar

Former Community Member
I want to have a generic webservice catch many different forms, and process them, by submitting data to database, and potentially other things. How would you suggest i set up the form so that i can tell what type of form instance it is ?



Is there a way that i can have "FormType" in the xml, hard coded so that the end user of the form cannot change its value. Then i could look for this node or attribute in the webservice, and know which form type i was processing (that is, "basketball signup" vs "baseball signup", etc)



Thanks much for any input.

Avatar

Former Community Member
Just put a field in the form called FormType and put a defult value for the form you want. As long as its binding is set to Vormal it will appear in the data. You coudl hide the field or make it ReadOnly so the user cannot change it.

Avatar

Former Community Member
Paul --



I am curious if you know of any limitations to this approach. For example, if i had a form with hundreds of fields, do you think this apporach would work for submitting the xml to a web service ?



Are there other ways to do this? Are there better ways ?