Page tree
Skip to end of metadata
Go to start of metadata

Introduction

You can use web services in SmartForms to:

  • calculate field values
  • populate options for fields that have multiple selection choices, e.g. radio buttons, check boxes, drop down lists.

Consider a simple scenario where the form has to:

  • show a range of insurance policy type options and
  • calculate and display an insurance policy premium based on selected policy type and other user input such as age

To implement this, SmartForms will have to interact with business systems, .i.e. fetch available policy types and run premium calculations based on user profile. 

Prerequisites

SmartForms support web services described in Web Services Description Language (WSDL) 1.1 with RPC/literal style and that have SOAP endpoints. 

Table below lists types of web service calls that can be invoked by SmartForms:

Method TypeDescriptionArgumentsReturns

fieldName

fields
Get Field OptionsA webservice method that is invoked when SmartForms require to fetch a list of choice options for a fieldName of a field that has to display choice optionsAn array of field name+value pairs for those fields that are needed to determine which choice options to returnAn array of label+value pairs
Get Field ValueA webservice method that is invoked when SmartForms require to run a recalculation of a field valueName of a field which value requires recalculationAn array of field name+value pairs for those fields that are needed for field value recalculationA string representation of field value calculation result

To simplify implementation of custom webservices we have narrowed down the webservice interface properties:

Prerequisite NameValueComment
soap version1.1Please make sure that the envelope contains soap11 and not soap12 tags
stylerpc or documentMake sure that your webservice uses an appropriate style as it will ensure that marshalling rules are met accordingly. To minimise integration effort it is advised that you follow sample code as provided in Java, PHP and .NET (WCF) examples.
useliteralTo verify it, check that WSDL <soap:body> element contains use="literal" attribute

namespace

http://smartforms/v1/To verify it, check that WSDL elements contain namespace="http://smartforms/v1/" targetNamespace="http://smartforms/v1/" attributes
actionhttp://smartforms/v1/{methodName}

Make sure that soap:action attribute of soap:operation element is a concatenation of a namespace and method name, e.g. if

method name is calculateXYZ, the soap action must be named http://smartforms/v1/calculateXYZ

1st argumentfieldNameMake sure that the name of a first argument of a method is 'fieldName'
2nd argumentfieldsMake sure that the name of second argument of a method is "fields"


Samples presented in this article show how to enforce the above prerequisites within the software code.

The following instructions describe how to create sample webservice service for use by SmartForms:

Develop Webservice

Configure Form

  • No labels