Expand my Community achievements bar.

SOLVED

Getting data from a WSDL service

Avatar

Level 7

I would like to populate a repeating subform with information retrieved form a WSDL service.

Through a form, I submit an id which is used in the workflow to get multple rows. The result is assigned to an XML variable which displays as a text field in the form.

How can I merge the XML variable's data within the PDF ?

Aditya

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

In the script on the Button that executes the wsdl, comment out the 2nd last line.

xfa.data.nodes.remove(oRemoveNode);

When the node is removed it is remerging the data dom with the template and thuscausinng the DDlist to clear.

paul

View solution in original post

30 Replies

Avatar

Level 4

Hi,

This question is way  above my skill level (sorry)  but if its any help i know that J P Terry's Creating Dynamic Forms with livecycle has examples (including code) for getting info from a wsdl. 

good luck; i'd be interested to kow who you get on.

Avatar

Former Community Member

If the wsdl is returning an XML structure for you to deal with then you will have to recieve the XML, load it into the datadom and merge it onto the form yourself. There is no automatic binding at that level because the form cannot see into the XML that is being returned.

Paul

Avatar

Level 7

In that case, how would I be able to load the XML to the client computer ?

Can you suggest an alternate way to achieve the same ?

Aditya

Avatar

Former Community Member

That is the only way that I know of ....how much data are we talking about? As I said we can load the returned xml into the data dom easily enough....it now becomes a question of where you want to load it.

Is this data for the entire form or is it meant to augment data that is already there (i.e. populating droplist values).

Paul

Avatar

Level 7

I am new to this... .Do you have a sample script or a guide that will help me achieve what you suggested ?

The data is for the entire form.

Aditya

Avatar

Former Community Member

The script woudl be very dependant on the XML that is returned .....do you have a sample of that?

Paul

Avatar

Level 7

I don't really have a sample. However, how would you return the sample below

<?xml version="1.0" encoding="UTF-8"?><br /><form1><br /> <Details><br /> <service_manager_firstname>Sam</service_manager_firstname><br /> <service_manager_MI>I</service_manager_MI><br /> <service_manager_lastname>Manager</service_manager_lastname><br /> </Details><br /></form1>

Aditya

Avatar

Former Community Member

I have a sample but you uses a LiveCycle Service as its web service. I am concerned that it will not make much sense unless you know the structure of teh XML that is coming back. Do you have a LiveCycle server?

Paul

Avatar

Level 7

Yes I do.... Why don't I explain what I am trying to do. I would ideally like to pre fill data in the form through HTTP Post/Web Service.

My best guess is to insert the data in an XML and merge it with the form.

Is it possible to submit a PDF as an input file to a Workflow through WSDL ? OR would I have to write a HTTP post servlet ?

Aditya

Avatar

Former Community Member

The retrieving of information to a form via a web service is done to augment the form. For example to populate a list of departments based on who you logged in as. It is not normally used to merge complete pages of data that represent a completed form. I will post apdf and lca file that you can deploy. This form will make a web service call and will get all the users in the usertable that have a certain searchg criteria (i.e. c*).

This will built on a Jboss/MySQL system so you may have to adjust the ports that were used as well you wil have to modify the WSDL being addressed in the form to point to your server.

I had to rename the lca file .txt to get it into the forum post. Just rename itto lca and you shoudl be OK.

The submission to a workflow is done as a post operation 9not through a WS call and is taken care fo for you if you do it the right way (the servlets are already written for you). The variable that holds the form references the Renderer that will display the form but also has a submit aspect to it that says what to do when the form is submitted. This shodul be handled for you by default.

Paul

Avatar

Level 7

The fill list button doesn't work. I tried to create a dataconnection to verify connectivity and it worked fine. I also update the server link to the one used in the working dataconnection.

I think there is an issue with the code... Any suggestions.

I am using the server string http://vm-adobe02.gs-inc.com:8080/soap/services/DBLookup.wsdl

Aditya

Avatar

Former Community Member

Are you using Acrtobat or Reader to display the form? Reader will not do a WS call woithout Reader Extending it. I will assume you are using Acrobat ....hit Ctrl-J and see if there are any messages in the javascript console.

Paul

Avatar

Level 1

Thank you - this was quite helpful. 

Avatar

Level 7

Yes, I am using Acrobat. Below is the error message.

Built-in Functions Version 9.0
Acrobat Annotations / Collaboration Built-in Wizard Functions Version 9.0
Acrobat SOAP 9.0
Start list retrieval
Problem with list Call: TypeError: service.getAllServiceNames is not a function

Avatar

Former Community Member

Are you using scripting to make your web service call or are you using the LiveCycle Designer UI to make teh call?

Paul

Avatar

Level 7

Scripting, I guess. I am using the file and LCA to you uploaded. All I did was changed the connection URL.

Aditya

Avatar

Former Community Member

Ok then you probably did not set up the form to make the call correctly. You have to open the DtaaConnection window and look at teh properties. Then modify the WSDL ...it is probably still pointing to my server.

Paul

Avatar

Level 7

Wait a minute, I haven't setup any WSDL data connection yet. I thought your script would connect to it.

SOAP.wireDump = false;

var cListURL = "http://vm-adobe02.gs-inc.com:8080/soap/services/DBLookup.wsdl";

var service = SOAP.connect(cListURL);

Aditya

Avatar

Former Community Member

In the form there is a call to the web service that you created with the lca. It is in this format:

http://servername:portnumber/soap/services/procesname?wsdl

The form is set to my server and you cannot reach that so that is why you are getting the error. Open the form in Designer, then click on the DataView Tab. There shodul be a DataConnection already defined (you will probably get an error saying that it cannot resolve the wsdl). Highlight the DataConnection root node and right mouse clcik and choose properties. Go through the screens and when it shows you the wsdl modify it to point to your server and port number.

Paul

Avatar

Level 7

Is this the server ? "http://www.xmethods.net/wsdl/query.wsdl"

I did not find any data connection. If you are referencing the server above, I think it is trying to connect using the Fill List button and I have already changed the URL to my server within the javascript.

Aditya

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----