python - how to prevent SUDS from checking WSDL -


I am now writing simple OpenERP module for my client. I use a suit to join the bank, to get the statement.

I wrote a xml request, which works without problems, I get the answer from the bank, it looks okay. The problem is that the response to the type of bank usage, which is not defined in WSDL (I wrote to bank support that they have a bug).

Tracebacks (Most recent call final): File "example3.py", Line 112, & lt; Module & gt; wiadomosc = client.service.GetStatement (__ inject = { "message": XML}), file "/usr/lib/python2.7/dist-packages/suds/client.py", line 542 __call__ return client.invoke (Arg, quad) file "/usr/lib/python2.7/dist-packages/suds/client.py", line 773, back to self (msg) file "/usr/lib/python2.7/dist -package / suds / client.py ", line 647, sending results in the = self.sauded (binding, reply message) file" /usr/lib/python2.7/dist-packages/suds/client.py " Line 684, in the successful answer, result = binding .get_reply (auto-method, answer) file "/usr/lib/python2.7/dist-packages/suds/bindings/bindi ng.py ", line 156, get_reply result = self .replycomposite (rtypes, nodes) file" /usr/lib/python2.7/dist-packages/suds/bindings/binding.py ", line 230, replycomposite sobject = Unmarshaller.process (node ​​solved) file "/ usr /lib/python2.7/dist-packages/suds/umx/typed.py", line 66, process return core. The process (self, content) file "/usr/lib/python2.7/dist-packages/suds/umx/core.py", line 48, the self.append (content) file in the process returns "/ usr / lib / python2 Self.append_children (content) file "/usr/lib/python2.7/dist-packages/suds/umx/core.py" in the app .7 / dist-packages / suds / umx / core.py ", line 63 , Line 140, append_children cval = self.append (cont) file "/ usr / lib / Python2.7 / dist-packages / suds / umx / core.py", line 61, append self.start (content) file " /usr/lib/python2.7/dist-packages/suds/umx/typed.py ", line 80, starts increased TypeNotFound (content.node.qname (in)) suds.TypeNotFound: type not found: 'ns29: BkToCstmrStmt '

More type, they Donation

  .... ns37: BaselineStatus3Code ns32: BatchBookingIndicator ns33: BatchBookingIndicator ns36: BatchBookingIndicator ns30: BatchInformation1 ns31: BatchInformation2 ns29: BatchInformation2 ns39: BilateralLimitDetails3 ns27: BkToCstmrCardRptType ns27: BkTxCdType ns27: BookgDtType ns10: BookingDate NS4: bool Ns1 6: Bull ns 2: Bull ns 15 ns bool 17: Bolding number ....  

there is no Biketiosismarstimti I Sud to get feedback from the server How can I make it, and not analyze it? Just build the tree?

Thanks

Still I do not know what is wrong in my code I resolved it like this:

  class message interceptor (suds.plugin.MessagePlugin): def __init __ (self, * args, ** kwargs): self.message = any DRF received (Self, context): a string #Print as #recieved xml "% s received byte"% lane (context.reply) self.message = context.reply #clean reference.reply = "" to prevent parse replies Reference message_interceptor = MessageInterceptor () Client = Client ('https: // Some-ed  

Now I can call client method

  XML = "RAW" ("" " & Lt; soapenv: envelope xmlns: soapenv = "http://schemas.xmlsoap.org/soap/envelope/" & lt; soapenv: header & gt; ... & lt; / soapenv: header & gt; & lt ; Soapenv: Body & gt; & lt; urn1: GetStatement & gt; ... & lt; / urn1: GetStatement & gt; & lt; / soapenv: Body & gt; & Lt; / Soapenv: envelope & gt; "Reaction = client.servi seat.gettestment (__eject = {'msg': xml})  

Now thinks that nothing was found from the server but the message that we received It is stored in

  message_interceptor.message  

. Now to get the normal dict objects from the message, I do it like this:

  import xmltodict message_interceptor.message = message_interceptor.message.replace ( 'ns17:', '') message_interceptor.message = message_interceptor.message.replace ( 'ns40:', '') message_interceptor.message = Message_interceptor.message .replace ('soap:', '') Foreplay = xmltodict.parse (message_interceptor.message) [ 'envelope'] [ 'body'] [ 'GetStatementResponse'] [ 'document']  

Now I normally respond suds using reactions I can.


Comments