I'm setting up a client that will play the files found in a folder to a WebService SOAP
This WebService has two methods that we will call MET1 and MET2 .
- When the files found end in .XML and start with LCL, then I run MET1
- When the files found end with .XML and start with CRC, then I run MET2
So far I've done this:
from zeep import Client
from xml.dom import minidom
import os
import glob
hasha = "9f56ccba6d88d2b089ab8a9fb40dd46f"
for file in glob.glob('M:\SARA.VEMBU\TRACKING\SINERGIA\retorno\*.XML'):
for file in glob.glob('M:\SARA.VEMBU\TRACKING\SINERGIA\retorno\LCL*'):
arquivo = minidom.parse(file)
arquivo = arquivo.toxml()
arquivo = arquivo[22:]
client = Client('http://teste.php?wsdl')
result = client.service.met1(arquivo, hasha)
print(result.met1Response)
for file in glob.glob('M:\SARA.VEMBU\TRACKING\SINERGIA\retorno\CRC*'):
arquivo = minidom.parse(file)
arquivo = arquivo.toxml()
arquivo = arquivo[22:]
client = Client('http://teste.php?wsdl')
result = client.service.met2(arquivo, hasha)
print(result.met2Response)
But the code does not return anything, even the folder containing files with suffix and indicated prefix
Note: I'm a beginner in Python