-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suds.MethodNotFound: Method not found: 'ATWS.ATWSSoap.__len__' #79
Comments
What if you step back to python 3.7?
…On Mon, 20 Apr 2020, 8:57 am ewanhamilton, ***@***.***> wrote:
Windows 10 x64
Python 3.8.0
ATWS 5.5
Example code. Have tried just import atws and the full import. Same exact
error on both.
`import atws
import atws.monkeypatch.attributes
username = "x"
password = "x"
at = atws.connect(username=username, password=password, apiversion=1.6,
integrationcode='x')
query = atws.Query('Ticket')
query.WHERE('id',query.GreaterThan,1)
print(query.pretty_print())
tickets = at.query(query)
`
Terminal output:
`Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32
bit (Intel)] on win32
runfile('C:/Users/Ewan/PycharmProjects/game/base.py',
wdir='C:/Users/Ewan/PycharmProjects/game')
Suds version (0.6) not ideal. Please use 0.7
Ticket id 1 Traceback (most recent call last): File "C:\Program
Files\JetBrains\PyCharm Community Edition
2019.3\plugins\python-ce\helpers\pydev\_pydevd_bundle\pydevd_thrift.py",
line 274, in frame_vars_to_struct value = var_to_struct(v, str(k),
evaluate_full_value=eval_full_val) File "C:\Program Files\JetBrains\PyCharm
Community Edition
2019.3\plugins\python-ce\helpers\pydev\_pydevd_bundle\pydevd_thrift.py",
line 358, in var_to_struct elif hasattr(v, '__len__') and not is_string(v):
File
"C:\Users\Ewan\PycharmProjects\game\venv\lib\site-packages\atws\connection.py",
line 233, in __getattr__ return getattr(self.client.service,attr) File
"C:\Users\Ewan\PycharmProjects\game\venv\lib\site-packages\suds\client.py",
line 283, in __getattr__ return getattr(port, name) File
"C:\Users\Ewan\PycharmProjects\game\venv\lib\site-packages\suds\client.py",
line 387, in __getattr__ return getattr(m, name) File
"C:\Users\Ewan\PycharmProjects\game\venv\lib\site-packages\suds\client.py",
line 478, in __getattr__ return self[name] File
"C:\Users\Ewan\PycharmProjects\game\venv\lib\site-packages\suds\client.py",
line 491, in __getitem__ raise MethodNotFound(qn) suds.MethodNotFound:
Method not found: 'ATWS.ATWSSoap.__len__' Unexpected error, recovered
safely. `
I'm able to successfully query it without using a module for it. Such as:
`from requests import Request, Session
import base64
import sys
username = "x"
password = "x"
query = ""
url = "https://webservices4.autotask.net/atservices/1.6/atws.asmx"
body = """
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='
http://www.w3.org/2001/XMLSchema'>
soap:Header
x
</soap:Header>
soap:Body"""
body += query
body += """</soap:Body>
</soap:Envelope>"""
headers = {
'Content-Type': "text/xml; charset=utf-8",
'Content-Length': str(sys.getsizeof(body)),
'Authorization': "Basic " + bytes.decode(base64.b64encode(bytes(username +
":" + password, "utf-8"))),
'Accept': "application/json"
}
s = Session()
req = Request('POST', url, data=body, headers=headers)
prepped = req.prepare()
resp = s.send(prepped)
print(resp.content)
`
Returns
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32
bit (Intel)] on win32 runfile('C:/Users/Ewan/PycharmProjects/game/base.py',
wdir='C:/Users/Ewan/PycharmProjects/game') b'<?xml version="1.0"
encoding="utf-8"?><soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
http://www.w3.org/2001/XMLSchema"><soap:Body><getThresholdAndUsageInfoResponse
xmlns="http://autotask.net/ATWS/v1_6/"><getThresholdAndUsageInfoResult><ReturnCode>1</ReturnCode><EntityResults
/><EntityResultType /><Errors
/><EntityReturnInfoResults><EntityReturnInfo><EntityId>0</EntityId><DatabaseAction>None</DatabaseAction><DuplicateStatus><Found>false</Found><Ignored>false</Ignored></DuplicateStatus><Message>ThresholdOfExternalRequest:
10000; TimeframeOfLimitation: 60; numberOfExternalRequest:
293;</Message></EntityReturnInfo></EntityReturnInfoResults></getThresholdAndUsageInfoResult></getThresholdAndUsageInfoResponse></soap:Body></soap:Envelope>'
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#79>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIM745S3AUM5ZZ4L2LS2OLRNNQR5ANCNFSM4ML6I6LA>
.
|
I experience(d) this issue as well. It only happens when running in PyCharm and IIRC reverting to 3.7 did resolve the issue for me. It has to do with the variable debugger and ultimately the functionality wasn't impacted. I continued to use 3.8. YMMV? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Windows 10 x64
Python 3.8.0
ATWS 5.5
Example code. Have tried just import atws and the full import. Same exact error on both.
Terminal output:
I'm able to successfully query it without using a module for it. Such as:
Returns
The text was updated successfully, but these errors were encountered: