Send the required soap message to invoke the specified method @param args: A list of args for the method invoked. @type args: list @param kwargs: Named (keyword) args for the method invoked. @type kwargs: dict @return: The result of the method invocat
(self, args, kwargs)
| 761 | return SimClient.injkey in kwargs.keys() |
| 762 | |
| 763 | def invoke(self, args, kwargs): |
| 764 | """ |
| 765 | Send the required soap message to invoke the specified method |
| 766 | @param args: A list of args for the method invoked. |
| 767 | @type args: list |
| 768 | @param kwargs: Named (keyword) args for the method invoked. |
| 769 | @type kwargs: dict |
| 770 | @return: The result of the method invocation. |
| 771 | @rtype: I{builtin} or I{subclass of} L{Object} |
| 772 | """ |
| 773 | simulation = kwargs[self.injkey] |
| 774 | msg = simulation.get('msg') |
| 775 | reply = simulation.get('reply') |
| 776 | fault = simulation.get('fault') |
| 777 | if msg is None: |
| 778 | if reply is not None: |
| 779 | return self.__reply(reply, args, kwargs) |
| 780 | if fault is not None: |
| 781 | return self.__fault(fault) |
| 782 | raise Exception('(reply|fault) expected when msg=None') |
| 783 | sax = Parser() |
| 784 | msg = sax.parse(string=msg) |
| 785 | return self.send(msg) |
| 786 | |
| 787 | def __reply(self, reply, args, kwargs): |
| 788 | """ simulate the reply """ |