I have the following SOAP Request, that I should be able to handle:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<LogoutNotification xmlns="urn:mace:shibboleth:2.0:sp:notify" type="global">
<SessionID>
_d5628602323819f716fcee04103ad5ef
</SessionID>
</LogoutNotification>
</s:Body>
</s:Envelope>
SessionID is simply the RPC parameter. That's easy to handle.
But how can I model the type
attribute in spyne? type
is either "global" or "local".
I currently have the following (and disabled validation to be able to simply ignore the attribute):
class LogoutNotificationService(Service):
@rpc(MandatoryUnicode, _returns=OKType,
_in_variable_names={'sessionid': 'SessionID'},
_out_variable_name='OK',
)
def LogoutNotification(ctx, sessionid):
pass # handle the request
For sake of completeness here are the used models:
class OKType(ComplexModel):
pass
class MandatoryUnicode(Unicode):
class Attributes(Unicode.Attributes):
nullable = False
min_occurs = 1
The schema is online. But there is no official WSDL for this containing the attribute.