title: Shall I use using statement or dependency injection for web service client
body: <p>I've recently written the a pieces of codes that involve Soap Web service call. </p>
  
  <p>Example codes as below is perfectly working fine.   The only problem is I couldn't do unit test the code as I use 'using' statement. I can use Constructor based Dependency Injection using MS Unity dependency injector.  </p>
  
  <p>The question is whether I shall use dependency injector for this or not. The reason of using 'Using' statement is I want to dispose the object after method called.</p>
  
  <pre><code>private ResultSet GetLookupMailingData()
      {
          try
          {
              using (var client = new NDataAccessSoapClient())
              {
                  var result = client.GetLookupData(XMLLookupDataTypes.xldtMailings, "");
                  return Deserialize&lt;ResultSet&gt;(result);
              }
          }
          catch (Exception)
          {
              return new ResultSet();
          }
      }
  </code></pre>