title: How to Pass List<Object> to SOAP API as a request
body: <p><strong>How to Pass List to SOAP API request from android</strong></p>
  
  <p>I know how to pass normal object, but at the time of passing the List I'm getting  following exception <em>Unable to cast object of type <code>'GTCFWebServices.Models.ToEmail'</code> to type 'System.Collections.Generic.List<code>1[GTCFWebServices.Models.ToEmail]</code>'.</em>
  This is expected soap <code>xml</code> request I need to pass <code>List&lt; ToEmail &gt;</code> as a request.</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:gtc="http://schemas.datacontract.org/2004/07/GTCFWebServices.Models"&gt;
     &lt;soapenv:Header/&gt;
     &lt;soapenv:Body&gt;
        &lt;tem:SendEmailNotificationToScannedUser&gt;
           &lt;!--Optional:--&gt;
           &lt;tem:fromEmail&gt;
              &lt;!--Optional:--&gt;
              &lt;gtc:ActivationCode&gt;6wDQ8&lt;/gtc:ActivationCode&gt;
              &lt;!--Optional:--&gt;
              &lt;gtc:Email&gt;?&lt;/gtc:Email&gt;
              &lt;!--Optional:--&gt;
              &lt;gtc:IsEmailHasToSent&gt;true&lt;/gtc:IsEmailHasToSent&gt;
              &lt;!--Optional:--&gt;
              &lt;gtc:Name&gt;Snehal Jadhav&lt;/gtc:Name&gt;
              &lt;!--Optional:--&gt;
              &lt;gtc:PhoneNumber&gt;?&lt;/gtc:PhoneNumber&gt;
              &lt;!--Optional:--&gt;
              &lt;gtc:ProfileImageName&gt;?&lt;/gtc:ProfileImageName&gt;
              &lt;!--Optional:--&gt;
              &lt;gtc:UniversityImageName&gt;?&lt;/gtc:UniversityImageName&gt;
              &lt;!--Optional:--&gt;
              &lt;gtc:UniversityName&gt;?&lt;/gtc:UniversityName&gt;
           &lt;/tem:fromEmail&gt;
           &lt;!--Optional:--&gt;
           &lt;tem:scannedUsers&gt;
              &lt;!--Zero or more repetitions:--&gt;
              &lt;gtc:ToEmail&gt;
                 &lt;!--Optional:--&gt;
                 &lt;gtc:Body&gt;body&lt;/gtc:Body&gt;
                 &lt;!--Optional:--&gt;
                 &lt;gtc:CC&gt;
                    &lt;!--Zero or more repetitions:--&gt;
                    &lt;gtc:Contact&gt;
                       &lt;!--Optional:--&gt;
                       &lt;gtc:Email&gt;?&lt;/gtc:Email&gt;
                       &lt;!--Optional:--&gt;
                       &lt;gtc:FirstName&gt;?&lt;/gtc:FirstName&gt;
                       &lt;!--Optional:--&gt;
                       &lt;gtc:LastName&gt;?&lt;/gtc:LastName&gt;
                    &lt;/gtc:Contact&gt;
                 &lt;/gtc:CC&gt;
                 &lt;!--Optional:--&gt;
                 &lt;gtc:ScannedUserId&gt;1&lt;/gtc:ScannedUserId&gt;
                 &lt;!--Optional:--&gt;
                 &lt;gtc:Subject&gt;?&lt;/gtc:Subject&gt;
                 &lt;!--Optional:--&gt;
                 &lt;gtc:To&gt;
                    &lt;!--Zero or more repetitions:--&gt;
                    &lt;gtc:Contact&gt;
                       &lt;!--Optional:--&gt;
                       &lt;gtc:Email&gt;?&lt;/gtc:Email&gt;
                       &lt;!--Optional:--&gt;
                       &lt;gtc:FirstName&gt;?&lt;/gtc:FirstName&gt;
                       &lt;!--Optional:--&gt;
                       &lt;gtc:LastName&gt;?&lt;/gtc:LastName&gt;
                    &lt;/gtc:Contact&gt;
                 &lt;/gtc:To&gt;
              &lt;/gtc:ToEmail&gt;
           &lt;/tem:scannedUsers&gt;
        &lt;/tem:SendEmailNotificationToScannedUser&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>