From SMTX Wiki
Jump to navigation Jump to search

New feature since 17/11/2014.

You can now pull data from a Datastore Parameter, in a process.
The WebService needs a filterField, and potentially a SortField.

An example is made in our DEV : Datastore - GET - Address Book



Call Type: RetrieveList
Return Type: DataTable
XLST In: see example - note the HASH ! - see full sample below
XSLT Out : see example - no Hash here - see full sample below
Web Service Call Headers: none
WebService Call Fields:

- Filter<FieldName>: Will be needed to find the correct value in the Datastore Parameter.
- Sort<FieldName>: (optional) : sort the results by this field, the first entry will be chosen.

Only 1 entry can be chosen !
Multiple filters can be selected
sample form :
sample process:

The process first pulls data based on the field in the form.
Next, it asks in the process to select an email address and will then return the Name & Location. sample ticket : 2255

It is a bit complex how to set up the call in the process.
The step type is 'Webservice Call', but when you select a 'GET'-webservice, the Form section appears.
This allows you to fetch the fields from the datastore that you want (and use them as 'previously entered fields').
Note: add the fieldname (of the datastore parameter) in the new textfield, labeled 'Field name from webservice call'.

XSLT In Sample

<?xml version='1.0'?> <xsl:stylesheet xmlns:xsl='' version='1.0'> <xsl:template match='/SSPAdapterCall'> <soapenv:Envelope xmlns:soapenv='' xmlns:dat=""> <soapenv:Header/> <soapenv:Body> <dat:getEntries> <dat:p_strParameterName>Address Book</dat:p_strParameterName> <dat:p_strHash>1E6F5F9F37A94F572DEB3BCB87CF53635741C43C</dat:p_strHash> <dat:p_blnIsHidden>false</dat:p_blnIsHidden> <dat:p_strSortFieldName></dat:p_strSortFieldName> <dat:p_arr_strExistingNameValues> <xsl:for-each select="Field"> <xsl:variable name="FieldName" select="@Name"/> <xsl:if test="starts-with($FieldName, 'Filter')"> <dat:string> <xsl:value-of select="substring($FieldName, 7)" /> </dat:string> <dat:string> <xsl:value-of select="." /> </dat:string> </xsl:if> </xsl:for-each> </dat:p_arr_strExistingNameValues> </dat:getEntries> </soapenv:Body> </soapenv:Envelope> </xsl:template> </xsl:stylesheet>

XSLT Out Sample

<?xml version='1.0' ?> <xsl:stylesheet version='1.0' xmlns:xsl='' xmlns:soap='' xmlns:xsi='' xmlns:xsd='' xmlns:ds=''> <xsl:template match="/soap:Envelope/soap:Body/ds:getEntriesResponse"> <SSPAdapterResult> <Fields> <xsl:for-each select='//xsd:element[@name="Data"]/xsd:complexType/xsd:sequence/xsd:element'> <Field> <xsl:value-of select='@name' /> </Field> </xsl:for-each> </Fields> <Rows> <xsl:for-each select='//DocumentElement/Data'> <Row> <xsl:for-each select='*'> <Field> <xsl:attribute name="name"> <xsl:value-of select="local-name()" /> </xsl:attribute> <xsl:value-of select='.'/> </Field> </xsl:for-each> </Row> </xsl:for-each> </Rows> </SSPAdapterResult> </xsl:template> <xsl:template match="/soap:Envelope/soap:Body/soap:Fault"> <Error>code:<xsl:value-of select='soap:faultcode' /> <xsl:value-of select='soap:Code/soap:Value' /> - string:<xsl:value-of select='soap:faultstring' /> <xsl:value-of select='soap:Reason/soap:Text' /> </Error> </xsl:template> </xsl:stylesheet>