Skip to Content

<p>Using web services with Interactive Forms is very easy. The drawback is when web services are secured. The XFA technology and therefore Designer supports only web services without any authentication (transport and SOAP). Using scripting (only Java Script) allows calling web services that require basic authentication on the transport level. Basic authentication means to provide a username and a password.</p><p>If you want to use an open web service you can use Designer and use binding to provide/use request and response parameters. To call web services a new data connection in the “Data View” has to be created. Use “WSDL file” as the type of the data description. The data view shows three sections for each WSDL data connection. The first section is the request section where you can find parameters for the request. A response section for the response results. And as a third item a button to call the web Service. The WSDL description must be one file. Designer 7.1 does not support “import” statements in a WSDL. This means that you manually have to create a single WSDL for example for web services created with the NetWeaver Developer Studio (i.e. combine the bindings, config and porttypes file into one single file).</p><p>Usually, the form design is already finished when functionality is added using web services. Form fields that are already on the form have to be bound to the parameters (both request and response) of the web service. The most convenient way to do this is to use drag&drop from the “Data View” to the form. Drag the parameter from the data view and drop it onto a field. As result you can see the data binding under “Import/Export Bindings” on the “Binding” tab of the “object” palette.</p><p>After binding the request/response parameters to form fields, a button to call the web service has to be added to the form. The data connection in the “Data View” already provides a button that is configured to call a web service. So you can simple drag&drop this button onto the form and you are done.</p><p>It is also possible to drag and drop directly from “web service” data connection of the “Data View” onto the form (and not onto a field). In this case a new field is added to the form that already has an import/export binding set. This is the same behavior as the standard drag&drop from other data connections. For a schema or a “XML data” data connection the default binding is set.</p><p>Alternatively it is also possible to specify the Import/Export binding by clicking on the little triangle to the right of the text field that contain the import/export binding (this is similar to specifying the default binding).</p><p>It is important to understand that the default binding describes whereto in the data a field is bound. The import/export binding describes to which web services (yes, binding to multiple web services is possible) a field is bound to.</p><p>To call web services from Adobe Reader the form has to include the right “form online”. This means Reader rights have to be applied by rendering the form through ADS and making sure this bit is set. If Acrobat is used it is not necessary to add Reader rights (but that usually not the case in the SAP environment).</p>h4. Advanced use of web services

<p>A web service can also return a table structure. The import/export binding then contains a “[*]” in the binding expression (this is also similar to the default binding). Since a table structure usually changes the layout of a form, a re-merge has to be performed. This can be set on the “Execute” tab of the “Object” palette of a button that calls a web service. The “Re-merge Form Data” option has to be checked.</p><p>To include a table structure in the request section it is necessary to use at least Reader 8.1.0 since previous versions of Reader include only the last row due to a Reader bug.</p><p>Another important scenario is to call more than one web service with one button or to call a web service even without having the user to press a button. To achieve this scripting has to be used.</p><p>The script to call a web service looks as follows.<br />xfa.connectionSet.<data connection name>.execute(0);<br />The parameter says if a re-merge is performed (1) or not (0).</p><p>To call two or more web services it is sufficient to call execute for more than one (WSDL) data connection. This can be done in the click event or in the form:ready or layout:ready events. The latter are examples where no user interaction is necessary to call a web service.</p><p>One thing to consider is that a web service execution that also re-merges form data terminates the execution of the (event) script. So if multiple web services are called in one script only the last one can do a remerge.</p><p>In one of my next blogs I will write about secured web services.</p>

To report this post you need to login first.

10 Comments

You must be Logged on to comment or reply to a post.

    1. Juergen Hauser Post author
      Hello Martin,

      you have to use the SOAP object in Acrobat Scripting. In my blog on “Useful documentation for developing Interactive Forms” there is a link that brings you directly to the Acrobat JavaScript reference. In that reference you can find a description of methods and examples how to use them.

      Using the SOAP object is not as convenient as using a data connection for a web service. You have to process the web service response and update form fields by hand.

      I started to write a blog on using the SOAP object but I haven’t finished that yet.
      Hope it helps for now.

      Cheers,
      Juergen

      (0) 
  1. Vivek Komarina
    Juergen,
      I have built a WDJ based Adobe Interactive form. My form has got a dynamically extendable table with dropdown boxes as table fields. This table is getting populated by the data provided by the WDJ Context node.

      I want this data to be submitted offline. For this, I have built a web service and integrated this webservice as you have specified using new data connection in Data View and binded the table structure fields to the web service request fields. Also, I have created the submit button from the webservice as specified in the blog.

      When I submit the data in the offline mode, only the last record is sent to the webservice and skipping all the other rows. You have talked about this bug in Adobe reader 7. But I am using Adobe reader 9.0.0 and Adobe Life Cycle designer 7.1. Can you please tell me if this is still a bug with Reader 9.0.0 and advice me here. Appreciate your response.

    Thanks!
    Vivek.

    (0) 
    1. Juergen Hauser Post author
      Hi Vivek,

      It should work with Reader 9. Please check your data bindings (esp. for the table row).
      You might want to post your question on the IFbA forum on SDN so more people can see your question and might be able to answer.

      Best regards,
      Juergen

      (0) 
  2. Trilochan Bagauli
    hi,
    i m not able to access abap webservice in interactive form,i m using designer 7.1,when i m giving the wsdl of abap webservice ,its giving error like wsdl is not correct, but when i m saving this wsdl in local system then i m able to create data connection,but at run time when we press the button its giving the error not able to connect with the given wsdl.
    please tell what i m doing wrong.

    note:- i m able to access java webservice successfuly.

    Thanks and Regards
    Trilochan

    (0) 
    1. Juergen Hauser Post author
      Hi,

      please post your question on the IFbA forum on SDN. And don’t forget to add additional details like if authentication is required, the Reader version or how you created the web service.

      Thanks,
      Juergen

      (0) 
  3. msap sdn
    Hello,
      Is it possible to describe the steps to put the data returned in a table on a pdf ?

    I’ve got a web service which returns a table but I’m not able to display the data.

    I think my ‘binding’ expression is not ok.
    Just drag and drop the response from the data view to the design view is not working.

    Other fields returned by my web service I can put on the pdf but not a table.

      Thanks for your help.

    Regards

    (0) 
    1. Juergen Hauser Post author
      Hi,

      Hard to say what’s not working. Dragging and dropping the table from the data view should work. You might want to check if you are using a dynamic PDF form. I recommend posting a question on the IFbA forum describing your problem in more details. Send me a message if no one replies to your question.

      Regards,
      Juergen

      (0) 
  4. Amit Upadhye
    The form is created using ALD8.0.we need to get data from SAP and populate them to field dropdown.
    Trying to establish connection using WSDL link ..
    But when we add a data connection in .XDP file of this form in ALD8, it is raising below error.

    Cannot load  the path or the URl,
    and check the path is correct and that the file is a valid WSDL file

    If we edit the file in Adobe Live Cycle ES the data connection correctly asks for user authorization to connect to SAP system and gets added correctly.

    Again in ES not able to retrieve the values … from the data base.

    (0) 

Leave a Reply