Skip to main content

I’m trying to retrieve a WebConnection using the FMENamedConnectionManager in a PythonCreator as described here.

Content of the PythonCreator:

import fmeobjects
import fmewebservices

class FeatureCreator(object):
def __init__(self):
fmewebservices.FMENamedConnectionManager.getNamedConnection('SAP S4')

def input(self, feature: fmeobjects.FMEFeature):
pass

def close(self):
pass

The execution fails with the Error
Python Exception <TypeError>: descriptor 'getNamedConnection' for 'fmewebservices.FMENamedConnectionManager' objects doesn't apply to a 'str' object

even though the documentation clearly states that the first parameter must be a string object (connectionName (str))

What am I doing wrong?

Try invoking the FMENamedConnectionManager as a class instance:

fmewebservices.FMENamedConnectionManager().getNamedConnection('SAP S4')

See also:

 


Try invoking the FMENamedConnectionManager as a class instance:

fmewebservices.FMENamedConnectionManager().getNamedConnection('SAP S4')

 

Thanks, this worked. The documentation was a bit misleading in this regard. ​