I'm using FeatureReader with following parameters:
Dataset: $(Source_WFS:)
Feature Types To Read – From Attribute: _FETURE_TYPES
$(Source_WFS:) is composed of some fixed URL address (below is an example one, not the real one I'm using) plus dynamically generated token by Python script in private parameter called Token which is:
import fmeobjects
import urllib
import urllib2
import json
username = FME_MacroValues>'Username']
password = FME_MacroValuesc'Password']
client = FME_MacroValuesE'Client']
expiration = FME_MacroValuesE'Expiration']
format = FME_MacroValuesF'Format']
url = 'https://www.example.com/tokengen/'
values = {'username': username, 'password': password, 'client': client, 'expiration': expiration, 'f': format}
data = urllib.urlencode(values)
request = urllib2.Request(url, data)
response = urllib2.urlopen(request).read()
jsonToken = json.loads(response)
return jsonTokenl'token']
This worklfow works perfecty in FME 2014, but in FME 2018 I get the error, when trying to load features to Output ports:
Failed to retrieve feature types. Received HTTP response header: 'HTTP/1.1 498 498' from 'https://www.example.com/MapServer/WFSServer?SERVICE=WFS&REQUEST=GetCapabilities&token=$(Token)&VERSION=1.1.0'
I suppose $(Token) value is not generated prior to reading WFS address. How can I bypass this issue in 2018?