I'm migrating some projects to python on sql 2017, and I ran into a problem about the suds library.
EXEC sp_execute_external_script
@language = N'Python',
@script = N'
from suds.client import Client
url="https://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl"
client = Client(url)'
Exit
Msg 39004, Level 16, State 20, Line 0 Script error 'Python' during the execution of 'sp_execute_external_script' with HRESULT 0x80004004. Msg 39019, Level 16, State 2, Line 0 Error in external script:
Error in execution. Check the output for more information. Traceback (most recent call last): File "", line 5, in File "D: \ MSSQL \ MSSQL14.MSSQLSERVER \ MSSQL \ ExtensibilityData \ MSSQLSERVER01 \ 2BB630CA-1241-4B83-B33A-195C1B7C98A2 \ sqlindb.py", line 29, in transform from suds.client import Client File "D: \ MSSQL \ MSSQL14.MSSQLSERVER \ PYTHON_SERVICES \ lib \ site-packages \ suds \ client.py", line 242 except Exception, e: ^ SyntaxError: invalid syntax
SqlSatelliteCall error: Error in execution. Check the output for more information. STDOUT message (s) from the external script: SqlSatelliteCall function failed. Please see the console output for more information. Traceback (most recent call last): File "D: \ MSSQL \ MSSQL14.MSSQLSERVER \ PYTHON_SERVICES \ lib \ site-packages \ revoscalepy \ computecontext \ RxInSqlServer.py", line 406, in rx_sql_satellite_call rx_native_call ("SqlSatelliteCall", params) File "D: \ MSSQL \ MSSQL14.MSSQLSERVER \ PYTHON_SERVICES \ lib \ site-packages \ revoscalepy \ RxSerializable.py", line 291, in rx_native_call ret = px_call (functionname, params) RuntimeError: revoscalepy function failed.
It is in the line in question where the exception of the client.py file occurs
def create(self, name):
"""
create a WSDL type by name
@param name: The name of a type defined in the WSDL.
@type name: str
@return: The requested object.
@rtype: L{Object}
"""
timer = metrics.Timer()
timer.start()
type = self.resolver.find(name)
if type is None:
raise TypeNotFound(name)
if type.enum():
result = InstFactory.object(name)
for e, a in type.children():
setattr(result, e.name, e.name)
else:
try:
result = self.builder.build(type)
except Exception, e:
log.error("create '%s' failed", name, exc_info=True)
raise BuildError(name, e)
timer.stop()
metrics.log.debug('%s created: %s', name, timer)
return result
the python version is 3.5.2 Continuum.