使用python消耗Web服务 [英] Consuming a web services using python

查看:124
本文介绍了使用python消耗Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个用户名,密码和一个ID(使用这些详细信息创建的测试帐户,用于网站中的Web服务测试)
我需要一个示例Python代码,该如何调用Biller ID.以及提供的用户名密码和ID号.

我尝试了以下操作:但是提供了验证错误..但是提供的用户名密码是正确的..代码中有一些错误..这没有拉动Web服务.有人可以改正吗..尝试了很多谷歌搜索以更改代码..陷入困境.:confused:::( <

Hi All,

I have a Username, Password and a ID ( A test account created with these details for webservice test in a website)
I need a example Python code how i can call the billder ID. with provided username password and ID number.

I tryed the below:bUT GIVING AUTHENTICATION ERROR.. but the provided username password is correct.. there is some error in code.. which not pulling the webservices. Can someone please correct it.. Tryed lot of googling to alter code.. went into vein.:confused: :((

from ZSI import client
from ZSI import wstools
from ZSI.auth import AUTH
from DownloadInvoice_client import *
import sys


#from UploadInvoice_client import *

from pprint import pprint

authCred = (AUTH.zsibasic, ''username'', ''password'' )



locator = DownloadInvoiceLocator()
binding = locator.getDownloadInvoiceSoap(auth=authCred)


request = GetInvoiceListWithIDsSoapIn()
request._ArchiveData = True
request._eBillAccountID = 4875218457455365411

result = binding.GetInvoiceListWithIDs(request)


request = GetInvoiceByIDSoapIn()
request._eBillAccountID = 4875218457455365411
request._ArchiveData = False
result = binding.GetInvoiceByID(request)

for p in result._GetInvoiceByIDResult._InvoiceReportWithID:
    
    
print p._BillerID

推荐答案

这是一个完整的猜测,因为我并不真正了解Python,但是如果您收到身份验证错误,则意味着连接实际上正在工作,您只是向Web服务提供了错误的凭据.

我会尝试将用户名与域结合使用,例如:

It''s a complete guess as I don''t really know Python, but if you''re getting an authentication error that means the underlying connection is actually working, you''re just supplying the wrong credentials to the webservice.

I would try the username in combination with the domain like this:

authCred = (AUTH.zsibasic, ''domain\username'', ''password'' )



如果失败,请尝试使用您的AUTH库提供的不同类型的身份验证,例如:



failing that, experiment with the different types of authentication your AUTH library offers, eg:

authCred = (AUTH.zsintlm, ''domain\username'', ''password'' )


[电子邮件地址已删除] .... i是python的新手,希望您能收到我的味精..... now后,我能帮我发邮件给我.....我刚完成我的BE计算机

那我该怎么办? .net c3或Python的美好未来?
我不知道python那么强.net C#吗?请帮助我

哪种语言很难?
[email address deleted]....i am new in python hope u will give me help me pls mail me when u got my msg .....now i have just completed my B.E computer

so what i have to do ? good future in .net c3 or Python ?
i dont know python is tought then .net c#? hepl me pls

which language it tough ?


这篇关于使用python消耗Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆