Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

<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>

10 Comments
Labels in this area