I'm starting to implement a web service using Spyne. So far the generated WSDL looks good to the consuming client (either the machine client and the human client).
The only thing is they (the human client) have defined a protocol where messages sent back and forth trhrough web servces don't expect a return value (if you are curious, it's because the protocol relies on async calls in the opposite direction to give return feedback after some task has been completed).
So they are asking me to remove the relevant return Message
from the WSDL definition. But I don't seem to find a way.
class BusinessTransactionLogSend(ServiceBase):
__service_name__ = "BusinessTransactionLogSend"
__namespace__ = "tns"
__port_types__ = ['IBusinessTransactionLogSend']
@rpc(TransactionLog, _body_style="wrapped",
_in_variable_names={'parameters': 'Log'},
_args=['Log'],
_port_type="IBusinessTransactionLogSend",
_returns=None,
_out_message_name='LogResponse')
def Log(ctx, parameters):
time.sleep(1)
this is the service and the RPC Log
. I've tried putting _returns=None
but the WSDL still has
<wsdl:types>
<xs:schema targetNamespace="https://www.zz/" elementFormDefault="qualified">
<xs:import namespace="tns"/>
<xs:complexType name="LogResponse"/>
<xs:complexType name="Log">
...
...
<wsdl:message name="LogResponse">
<wsdl:part name="LogResponse" element="tns:LogResponse"/>
</wsdl:message>
...
<wsdl:portType name="IBusinessTransactionLogSend">
<wsdl:operation name="Log" parameterOrder="Log">
<wsdl:input name="Log" message="tns:Log"/>
<wsdl:output name="LogResponse" message="tns:LogResponse"/>
</wsdl:operation>
</wsdl:portType>
...
Their SOAP/WSDL parser is confused by this LogResponse
message.
Is there any way to skip this or instruct Spyne not to generate Type and Message for a void return value?
I could write a filter (or maybe it's called listener for events), it seems to appear from looking around, but
- I haven't found a complete example nor a good documentation
- it seems to me better to tell Spyne to do the chore than me
Of course I could try telling my client to just ignore any xxxResponse
message in the WSDL, but I am afraid that their terrible SAP-Based client would still complain
Thanks W