Created
October 4, 2011 17:11
-
-
Save fuzzy0110/1262204 to your computer and use it in GitHub Desktop.
Exemplo de consumo de web service utilizando Python e SUDS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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