Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I made the following changes to soap_attachments.py under suds to get my own uploads to work. You may not need some of the changes that I've made to this, but hopefully it'll at least give you a start.</p> <pre><code>--- /home/craig/Downloads/soap_attachments.py 2011-07-08 20:38:55.708038918 -0400 +++ soap_attachments.py 2011-06-21 10:29:50.090243052 -0400 @@ -1,4 +1,8 @@ +import uuid +import re def with_soap_attachment(suds_method, attachment_data, *args, **kwargs): + HUD_ARM_SERVICE_URL = suds_method.client.wsdl.url + HUD_ARM_SERVICE_URL = HUD_ARM_SERVICE_URL.replace('wsdl','xsd') """ Add an attachment to a suds soap request. attachment_data is assumed to contain a list: @@ -16,7 +20,9 @@ soap_method = suds_method.method if len(attachment_data) == 3: + print "here" data, attachment_id, attachment_mimetype = attachment_data + attachment_id = uuid.uuid4() elif len(attachment_data) == 2: data, attachment_id = attachment_data attachment_mimetype = MIME_DEFAULT @@ -55,7 +61,7 @@ ]) # Build the full request - request_text = '\n'.join([ + request_text = '\r\n'.join([ '', '--%s' % boundary_id, soap_headers, </code></pre> <p>I then use:</p> <pre><code>f = open(dir_path + infile,'rb') data_file = f.read() data_file_type = mimetypes.guess_type(infile)[0] (filename,ext) = infile.split('.') ... clientargs = [...] identifier = with_soap_attachment(client.service.fooThing, [data_file, '1', data_file_type], credentials['foo'],credentials['bar'], morefoo) </code></pre> <p>You might not need all of these changes, but it's what got me going.</p> <p>Hope this helps!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload