Skip to content

Commit a1a0e08

Browse files
committed
Fix generating signature for empty wsdl messages (#452)
1 parent 5fa74e0 commit a1a0e08

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
exception (#527)
66
- Update packaging (stop using find_packages()) (#529)
77
- Properly handle None values when rendering complex types (#526)
8+
- Fix generating signature for empty wsdl messages (#452)
89

910

1011
2.3.0 (2017-08-06)

src/zeep/wsdl/messages/soap.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ def signature(self, as_output=False):
132132
return None
133133
return self.envelope.type.signature(schema=self.wsdl.types, standalone=False)
134134

135-
parts = [self.body.type.signature(schema=self.wsdl.types, standalone=False)]
135+
if self.body:
136+
parts = [self.body.type.signature(schema=self.wsdl.types, standalone=False)]
137+
else:
138+
parts = []
136139
if self.header.type._element:
137140
parts.append('_soapheaders={%s}' % self.header.type.signature(
138141
schema=self.wsdl.types, standalone=False))

tests/test_wsdl_messages_document.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,8 +1321,9 @@ def test_empty_input_parse():
13211321

13221322
binding = root.bindings['{http://tests.python-zeep.org/}Binding']
13231323
operation = binding.get('getResult')
1324-
serialized = operation.input.serialize()
1324+
assert operation.input.signature() == ''
13251325

1326+
serialized = operation.input.serialize()
13261327
expected = """
13271328
<?xml version="1.0"?>
13281329
<soap-env:Envelope

0 commit comments

Comments
 (0)