Expand my Community achievements bar.

Possible to submit xml data to LC process

Avatar

Level 4

Hi!

I have a tough one for you I think

I have created a simple LC Designer 8.2 form with 3 text fields. I also have a standard button set to submit. Submit as = xml data. In the submit to URL I write the url to my Livecycle server:    http://<servername>:8080/soap/services/GetFormXml  where I have set up a simple process with the name GetFormXml. The LC service take an xml variable as input.

When I try to submit I get en error in my Adobe acrobat saying:

Invalid Server Response    http://<servername>:8080/soap/services/GetFormXml

I am not sure everything is set correct on serversite, but we have called an LC service from .Net without problems

I would really like your help on:

- Is it possible to do it like this - submit button (in acrobat) call LC server service (SOAP endpoint should be activated out of the box)??

- If yes => please help with code example/explanations on the input variable etc

- Am I doing it correctly in Designer?

I hopy anyone outthere have solved it allready and can help me

Regards

/Thomas Groenbaek

Jyske Bank

3 Replies

Avatar

Former Community Member

Thomas,

You cannot POST data directly to a LiveCycle process.

Core services and custom processes, such as your GetFormXML, are accessed through endpoints. When you save and activate a custom short-lived process, three endpoints are automatically created - EJB, SOAP, and remoting. Additional endpoints include Watched Folder, Email, and Task Manager (for Workspace ES).

For you simple example the easiest solution would be to add a WSDL data connection. In the data connection wizard point to
http://localhost:8080/soap/services/GetFormXML?wsdl and you will be able to bind the input and output variables to the form.

If you want to do a POST, you will have to create a servlet and use the LiveCycle ES Java API for invocation. See http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/wwhelp/wwhimpl/js/html/wwhelp.htm?...

Steve

Avatar

Level 10

"Is it possible to do it like this - submit button (in acrobat) call LC server service (SOAP endpoint should be activated out of the box)?"

Kind of. The submit button in Acrobat actually does a HTTP submit request, and not a SOAP request. So you can't call the web service endpoint directly using that technique.

If you make your button Execute instead, then it'll make a Web Service call to a WSDL location. The problem is you can only bind fields from the form to the WSDL. That means you would have to put the entire form's data (xml) in a field so you can pass it as a parameter.

The easiest thing would be to have a servlet or an ASP.Net to post to using the HTTP Submit, then extract the data from the request object and then use the LC API to invoke LiveCycle.

"If yes => please help with code example/explanations on the input variable etc"

Use the HTTP Submit technique instead.


Jasmin

Avatar

Former Community Member

You are mixing protocols. The submission to the web service requires a Web Service call and the submit button you are programming is an HTTP post call. If you want to submit to the web service you will have to have a means of getting all of the data in the form into a single string. So to do this we create a single string input in the web service. When we expose the web service in the dataview in Designer this parameter will show up as an input (Create a new data connection and choose a wsdl, point the wsdl parameter at the wsdl for your process:

  http://<servername>:8080/soap/services/GetFormXmlhttp://<servername>:8080/soap/services/GetFormXml?wsdl?wsdl

This will create a tree view of your service in the Dataview hierarchy. Now create a field to hold all of the data in the form. Make it multi-line. We will eventually make it invisible and protected but for now leave it visible. Bind it to the input of the web service by dragging and dropping the input field (in the web service view) onto the newly created field. If it bound correctly an icon will appear beside it. Now we need a means to call the web service. Back in the hierarchy data view the last node will be an invoke button. Drag and drop that onto the form. Clicking this button will call our web service. We will hide this one eventually as well as we will give the user another (regular) button that we will code to populate our field with data and execute the web service. Create a new regular button on the form (this will be the button that the user clicks whne they are ready). On the click event set it to use Javascript commands and run on the client.  Now we need to populate the field with the data we will submit. To get all of the data from the form into the field use this command:

fieldname.rawValue = xfa.datasets.data("pretty");

This will put all of the data (in XML format) in that field.

Then add this command to cuase the invoke button to be pushed:

invokeBTN.execEvent("click");

Test your form .....remmeber that you recieving a string on the server...depending on what your intentions are you may have to change it to XML for other services to use it.

Hope that helps

Paul