Skip to content

Instantly share code, notes, and snippets.

@fuzzy0110
Created October 4, 2011 17:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fuzzy0110/1262204 to your computer and use it in GitHub Desktop.
Save fuzzy0110/1262204 to your computer and use it in GitHub Desktop.
Exemplo de consumo de web service utilizando Python e SUDS
from suds.client import Client
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
url = "http://zenbeta5/mpe_gplanc/aWS_GISA_SALDO_ESTOQUE.aspx?WSDL"
client = Client(url)
print client
materiais = client.factory.create("GPLANC_MaterialList")
char_array = client.factory.create("ArrayOfchar")
char_array.item.append("hello")
char_array.item.append("goodbye")
char_array.item.append("CARLOS-2011-05-06")
char_array.item.append("THA-003")
char_array.item.append("SP-14032011A")
char_array.item.append("material-B:0611")
char_array.item.append("TUB-01")
materiais.Itens = [char_array]
try:
result = client.service.Execute(materiais)
print result
except Exception, e:
print "sorry, not working"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment