我的命令:python3 -mzeep https://pearson:m0bApP5@cms.powerschool.com/pearson-rest/services/PublicPortalServiceJSON?wsdl
我收到一个错误:
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://pearson:m0bApP5@cms.powerschool.com/pearson-rest/services/PublicPortalServiceJSON?wsdl
https://cms.powerschool.com/pearson-rest/services/PublicPortalServiceJSON?wsdl
使用 pearson 和 m0bApP5 手动进行身份验证是可行的,但为什么不这样做呢?
我也尝试使用此代码,但它也不起作用。
#!/usr/bin/env python3
from zeep import Client
from requests.auth import HTTPBasicAuth # or HTTPDigestAuth, or OAuth1, etc.
from requests import Session
from zeep.transports import Transport
session = Session()
session.auth = HTTPBasicAuth("pearson","m0bApP5")
url = "https://cms.powerschool.com/pearson-rest/services/PublicPortalServiceJSON?wsdl"
stransport = Transport(session=session)
client = Client(url,transport=stransport)
client.wsdl.dump()