title: Using DLL references of WCF service in another WCF service
body: <p>Sorry for the long question in the first place. I would rather prefer to come up with a shorter question but this is the most stripped version I could provide that I can clearly explain my point.</p>
  
  <p>I have been trying to deliver a wrapper service to our client which should provide multiple services in it. Idea behind it is to reduce multiple calls to a one call and return a single object which has other associated objects in it. To illustrate my point, let me give following example:</p>
  
  <p>Let's say we have following services:</p>
  
  <ul>
  <li>MyCompany.Services.Donation</li>
  <li>MyCompany.Services.Payment</li>
  <li>MyCompany.Services.PartialPayment</li>
  </ul>
  
  <p>Normally client should query Donation service (with a donationID) to get donation information, and then using the retrieved donation information, they should query Payment service to get payment related details, and if the payment is done in multiple small payments, using retrieved payment information, they should query PartialPayment service to get all donation information for a particular Donor.</p>
  
  <p>Instead of client doing this, I am going to provide a wrapper service to accept donationID as a single parameter and return a class similar to this:</p>
  
  <pre><code>[DataContract(Namespace = "http://MyCompany.Services.DonationDetail")]
  public class DonationDetail
  {
       [DataMember]
       public MyCompany.Services.Donation.Record donationRecord;
       [DataMember]
       public PaymentDetail paymentDetail;    
  }
  
  [DataContract(Namespace = "http://MyCompany.Services.DonationDetail")]
  public class PaymentDetail
  {
       [DataMember]
       public MyCompany.Services.Payment.Record paymentRecord;
       [DataMember]
       public List&lt;MyCompany.Services.PartialPayment.Record&gt; partialPayments;
  }
  </code></pre>
  
  <p>So an instance of DonationDetail record should return all relevant information with that donation.</p>
  
  <p>My problem arises when I use these individual services DLL's* in my wrapper service since any class I pass to client using wrapper service becomes part of the wrapper service and client can't use them right away with the corresponding types they retrieved using service references without writing a custom construction method to convert one type to another - although they are same objects. Instead of referring classes in original namespace, service uses following classes something like that now for the classes mentioned above:</p>
  
  <ul>
  <li>DonationDetail.Record (Donation Record - I would expect MyCompany.Services.Donation.Record)</li>
  <li>DonationDetail.Record1 (Payment Record - I would expect MyCompany.Services.Payment .Record)</li>
  <li>DonationDetail.Record2 (PartialPayment Record - I would expect MyCompany.Services.PartialPayment.Record)</li>
  </ul>
  
  <p>Is there a way to provide such an interface without a custom constructor? So, if they use "PartialPayment" namespace for the MyCompany.Services.PartialPayment WCF service, can they do something below after DonationDetail is retrieved via wrapper service?</p>
  
  <pre><code>PartialPayment.Record partialPayment = dDetailObj.paymentDetail.partialPayments[0];
  </code></pre>
  
  <p>*: Don't ask me why I don't use service references unless that is the cause of the problem, since that option gives me other problems to me at this point) </p>