title: SOAP envelopes to the sharepoint webservice to manage to upload a file
body: <p>I have to send SOAP envelopes to the sharepoint webservice to manage to upload a file to the sharepoint. But I don't want to use C# code.</p>
  
  <p>I use the webservice copy (_vti_bin/copy.aspx).</p>
  
  <p>I send the envelope with the header SOAPAction <a href="http://schemas.microsoft.com/sharepoint/soap/CopyIntoItems" rel="nofollow">http://schemas.microsoft.com/sharepoint/soap/CopyIntoItems</a></p>
  
  <p>Here is an example of SOAP envelope that I send:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"&gt;
      &lt;soap12:Body&gt;
          &lt;CopyIntoItems xmlns="http://schemas.microsoft.com/sharepoint/soap/"&gt;
          &lt;SourceUrl&gt;test.txt&lt;/SourceUrl&gt;
          &lt;DestinationUrls&gt;
              &lt;string&gt;[URLsite]/Files/test.txt&lt;/string&gt;
          &lt;/DestinationUrls&gt;
          &lt;Stream&gt;[stream of file]&lt;/Stream&gt;
          &lt;/CopyIntoItems&gt;
      &lt;/soap12:Body&gt;
  &lt;/soap12:Envelope&gt;
  </code></pre>
  
  <p>In the source, I put the filename.
  For the destination, I put the url of the website with the file name where the file should be uploaded.( and as well tested without the filename )
  For the stream file, it is encoded in base 64 the test file:</p>
  
  <pre><code>dGVzdHR0dHR0dHR0dA==
  </code></pre>
  
  <p>It does not work so I get this error:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;soap:Body&gt;
          &lt;CopyIntoItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/"&gt;  
              &lt;CopyIntoItemsResult&gt;0&lt;/CopyIntoItemsResult&gt;
              &lt;Results&gt;
                  &lt;CopyResult ErrorCode="Unknown" ErrorMessage="Object reference not set to an instance of an object." DestinationUrl="[URLsite]/Files/test.txt" /&gt;
              &lt;/Results&gt;
          &lt;/CopyIntoItemsResponse&gt;
      &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>I also tested DestinationUrl = "[URLsute] / Files"  -> I have the same error.
  If you see what may be blocking... it would be perfect.</p>
  
  <p>Moreover I don't really understand the FieldInformation which can be used in the envelope and should probably be used to set properties for saving the file. A small example would greatly help me.</p>
  
  <p>By the way i am very interested to get examples to activate the Sharepoint approval circuit and as well several examples of the Workflow.asmx webservice.
  By the way if you have an example to activate the Sharepoint approval circuit with the webservice Workflow.asmx, I'm interested.</p>
  
  <p>Thank a lot,</p>
  
  <p>Jimmy</p>