title: How to generate Soap Envelope and body for a class generated using XSD.exe in C#
body: <p>I have one XSD which in turn  use multiple XSDs. I have generated .cs file using XSD.exe. Webservice Operation which i would like to call expect request XML is of this class type. Problem i am facing is that host of this webservice expect a XML with soap envelope and Soap Body. When i have generated XML using serializing the object of .cs file, it does not have soap envelope and body. 
  I have tried finding this on net but nothing fruitful found. </p>
  
  <h2>Expected XML:</h2>
  
  <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;soap:Header&gt;&lt;wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;&lt;wsse:UsernameToken&gt;&lt;wsse:Username&gt;testuser&lt;/wsse:Username&gt;&lt;wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"&gt;testwelcome1&lt;/wsse:Password&gt;&lt;/wsse:UsernameToken&gt;&lt;/wsse:Security&gt;&lt;/soap:Header&gt;
      &lt;soap:Body xmlns:ns1="http://capabilities.nat.bt.com/xsd/EDM/EMP/ManageDocument/CreateFolder"&gt;
          &lt;ns1:CreateFolderRequest xmlns:ns2="http://wsi.nat.bt.com/2005/06/StandardHeader/" xmlns:ns3="http://capabilities.nat.bt.com/xsd/EDM/EMP/ManageDocument/Header/1.0"&gt;
              &lt;ns2:standardHeader&gt;
                  &lt;ns2:serviceState&gt;
                      &lt;ns2:stateCode&gt;OK&lt;/ns2:stateCode&gt;
                  &lt;/ns2:serviceState&gt;
                  &lt;ns2:serviceAddressing&gt;
                      &lt;ns2:from&gt;Dummy&lt;/ns2:from&gt;
                      &lt;ns2:to&gt;
                          &lt;ns2:address&gt;Dummy/ns2:address&gt;
                      &lt;/ns2:to&gt;
                      &lt;ns2:replyTo&gt;
                          &lt;ns2:address&gt;Dummy&lt;/ns2:address&gt;
                      &lt;/ns2:replyTo&gt;
                      &lt;ns2:messageId&gt;MessageID1&lt;/ns2:messageId&gt;
                      &lt;ns2:serviceName&gt;Dummy&lt;/ns2:serviceName&gt;
                      &lt;ns2:action&gt;AddDocumentRequest&lt;/ns2:action&gt;
                  &lt;/ns2:serviceAddressing&gt;
              &lt;/ns2:standardHeader&gt;
              &lt;ns3:HeaderRequest&gt;
                  &lt;ns3:AccountID&gt;sharePoint_user&lt;/ns3:AccountID&gt;
                  &lt;ns3:Password&gt;Dummy&lt;/ns3:Password&gt;
                  &lt;ns3:Domain&gt;Dummy&lt;/ns3:Domain&gt;
              &lt;/ns3:HeaderRequest&gt;
              &lt;ns1:RepositoryID&gt;Dummy&lt;/ns1:RepositoryID&gt;
              &lt;ns1:FolderName&gt;test_test_test_1&lt;/ns1:FolderName&gt;
              &lt;ns1:ParentID&gt;null&lt;/ns1:ParentID&gt;
              &lt;ns1:CreatedDate&gt;2012-03-02&lt;/ns1:CreatedDate&gt;
              &lt;ns1:OwnerID&gt;null&lt;/ns1:OwnerID&gt;
              &lt;ns1:ParentPath&gt;Test_Folder&lt;/ns1:ParentPath&gt;
          &lt;/ns1:CreateFolderRequest&gt;
      &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>Please help. sorry but i am new to this SOAP thing. </p>