-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Hello, I get
Traceback (most recent call last):
File "/tmp/suds/test.py", line 55, in <module>
wsdl = reader.open(url)
File "/tmp/suds/.venv/lib/python3.13/site-packages/suds/reader.py", line 109,
in open
wsdl = self.fn(url, self.options)
File "/tmp/suds/.venv/lib/python3.13/site-packages/suds/wsdl.py", line 164,
in __init__
d = reader.open(url)
File "/tmp/suds/.venv/lib/python3.13/site-packages/suds/reader.py", line 153,
in open
xml = self.__fetch(url)
File "/tmp/suds/.venv/lib/python3.13/site-packages/suds/reader.py", line 202,
in __fetch
return sax.parse(string=content)
~~~~~~~~~^^^^^^^^^^^^^^^^
File "/tmp/suds/.venv/lib/python3.13/site-packages/suds/sax/parser.py", line
124, in parse
timer = suds.metrics.Timer()
^^^^^^^^^^^^
AttributeError: module 'suds' has no attribute 'metrics'
Steps to reproduce:
- Run
mkdir /tmp/suds
cd /tmp/suds
python3 -m venv .venv
source .venv/bin/activate
pip install git+https://github.com/suds-community/suds- Create test.py file in /tmp/suds
# example WSDL taken from https://en.wikipedia.org/wiki/Web_Services_Description_Language
wsdl = '''
<?xml version="1.0" encoding="UTF-8"?>
<description xmlns="http://www.w3.org/ns/wsdl" xmlns:tns="http://www.tmsws.com/wsdl20sample" xmlns:whttp="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsoap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://www.tmsws.com/wsdl20sample">
<documentation>
This is a sample WSDL 2.0 document.
</documentation>
<!-- Abstract type -->
<types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.tmsws.com/wsdl20sample" targetNamespace="http://www.example.com/wsdl20sample">
<xs:element name="request"> ... </xs:element>
<xs:element name="response"> ... </xs:element>
</xs:schema>
</types>
<!-- Abstract interfaces -->
<interface name="Interface1">
<fault name="Error1" element="tns:response"/>
<operation name="Get" pattern="http://www.w3.org/ns/wsdl/in-out">
<input messageLabel="In" element="tns:request"/>
<output messageLabel="Out" element="tns:response"/>
</operation>
</interface>
<!-- Concrete Binding Over HTTP -->
<binding name="HttpBinding" interface="tns:Interface1" type="http://www.w3.org/ns/wsdl/http">
<operation ref="tns:Get" whttp:method="GET"/>
</binding>
<!-- Concrete Binding with SOAP-->
<binding name="SoapBinding" interface="tns:Interface1" type="http://www.w3.org/ns/wsdl/soap" wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/" wsoap:mepDefault="http://www.w3.org/2003/05/soap/mep/request-response">
<operation ref="tns:Get"/>
</binding>
<!-- Web Service offering endpoints for both bindings-->
<service name="Service1" interface="tns:Interface1">
<endpoint name="HttpEndpoint" binding="tns:HttpBinding" address="http://www.example.com/rest/"/>
<endpoint name="SoapEndpoint" binding="tns:SoapBinding" address="http://www.example.com/soap/"/>
</service>
</description>
'''
wsdl_file = '/tmp/test.wsdl'
with open(wsdl_file, 'w', encoding='utf-8') as fp:
fp.write(wsdl)
import suds
from suds.options import Options
from suds.reader import DefinitionsReader
from suds.wsdl import Definitions
import suds.transport.https
options = Options()
options.transport = suds.transport.https.HttpAuthenticated()
reader = DefinitionsReader(options, Definitions)
url = f'file://{wsdl_file}'
wsdl = reader.open(url)- Run it.
python3 test.pyIt seems that import suds.metrics is missing from suds/sax/parser.py file.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels