title: How does Dart leverage SOAP requests?
body: <p>I was looking up how to do SOAP requests within Dart.  When looking at HTTPRequest it really only mentions RESTful services and wanted to make sure that this can be done.</p>
  
  <p>Right now, I have my server, username, and password.  Trying to get a successful authentication via the service, so that way I have an auth token i can pass when doing subsequent calls.</p>
  
  <p>It seems for example in .NET, it does the following and then stores the credential in a server side session variable which I was using as a starting point to make this in Dart.</p>
  
  <pre><code>// create web service api object
  WebServiceAPI api = new WebServiceAPI();
  
  if (!String.IsNullOrEmpty(ConfigurationManager.AppSettings["ProxyUserName"]))
  {
      System.Net.NetworkCredential nc = new System.Net.NetworkCredential(ConfigurationManager.AppSettings["ProxyUserName"], ConfigurationManager.AppSettings["ProxyPassword"], ConfigurationManager.AppSettings["ProxyDomain"]);
      System.Net.CredentialCache cc = new System.Net.CredentialCache();
      cc.Add(new Uri(api.Url), "NTLM", nc);
      api.Credentials = cc;
  }
  
  api.AuthenticateCredential("api@admin", "admin", 0, 0);
  HttpContext.Current.Session["api"] = api;
  </code></pre>
  
  <p><strong>Edit:</strong>  I am adding some sample data such that if there is a hack we can leverage to get something working, we might be able to abstract it and genericize.</p>
  
  <pre><code>service asmx file:  
  http://127.0.0.1:1337/service.asmx
  
  Method we will be calling: (AuthenticateCredential)
  http://127.0.0.1:1337/service.asmx?op=AuthenticateCredential
  
  The sample SOAP request:
  POST /service.asmx HTTP/1.1
  Host: 127.0.0.1
  Content-Type: text/xml; charset=utf-8
  Content-Length: length
  SOAPAction: "http://foo.com/bar/320/Default/AuthenticateCredential"
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;soap:Body&gt;
      &lt;AuthenticateCredential xmlns="http://foo.com/barr/320/Default"&gt;
        &lt;UserName&gt;string&lt;/UserName&gt;
        &lt;Password&gt;string&lt;/Password&gt;
        &lt;CurrentSystemLoginID&gt;int&lt;/CurrentSystemLoginID&gt;
        &lt;CurrentCustomerID&gt;int&lt;/CurrentCustomerID&gt;
      &lt;/AuthenticateCredential&gt;
    &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>then naturally, I will have to write up and mod the <code>string,string,int,int</code> out of the envelope. such that the credentials are correct.</p>