python - How to get unparsed XML from a suds response, and best django model field to use for storage -


I am using suds to request data from a third party using a wsdl. I am saving only some data for now, but I am paying for the data that I get, so I want to keep it all. I have decided that the best way to save this data is to capture the raw XML response in a database area, for both future use, I should decide that I want to start using different parts of the data And in the case of anomaly, I want to start as a paper mark. .

So I have two questions:

Is there an easy way to output raw XML received from suds.client object? In my quest for its answer, I have learned that it can be done through logging, but I was hoping that the information back to the database should not be put in the database area. I have also seen in the MessagePlugin.recieved () hook, but it can not really detect how this information can be reached after parsing, only that I can override that function and it Can get access to raw XML because it is being parsed (which is before I have decided whether it is actually saving the value or not) I have also detected the retxML option. What I would spend would like to use Prsed version and call two separate, as a Retksmel and second Parsed me twice. I have not found anything like this in a simple function suds client (such as response.as_xml () or something was equally simple) but my head may have a bubbling option around the client object .received () plugin Can be extended using hook which saves XML before saving as object parameter, is later referenced ... but such execution seems a little like mine A. It is difficult now, and I believe that it has been made somewhere in the Sud client, so I thought I would ask first.

The second part of my question is: Which kind of Dzena model would be best to handle ~ 100 KB text data in the form of raw XML? I was just going to use simple Extreme with a stupid Long Max_Lamp, but it seems wrong.

Thanks in advance. I resolved this by using flag reticle on client initialization:

 

client = client (settings.WSDL_ADDRESS, retxml = true) raw_reply = client.service. PersonSearch (soapified_search_object)

Then I was able to print a raw xml in the dynamic model. Insert my search in such a way as to the textfield () and then raw xml to get results without parsing results:

  parsed_result = client.service.PersonSearch (__ injection = {'Answer': raw_reply})   

I think if I wanted to touch the recovered envelope stuff with raw answer, I could use a python xml library to use the answer But as my existing code already took the information Received was that I wanted to suds client results I used it. / P>

Hope this helps someone else.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -