title: 'Microsoft.Web.Services3.Addressing.Address' cannot be serialized
body: <p>I'm trying to write a WCF wrapper web service for a WSE3/ASMX web service. 
  [The ugly reason why is that a 3rd party vendor won't support SSL and that is what's needed for BizTalk 2009 WCF adapter to work with WS-Security.  So if the vendor doesn't change - I need to call a local WCF web service...]  </p>
  
  <p>I followed this article to get the WSE3 proxy-builder built-in to VS2008: 
  <a href="http://blogs.imeta.co.uk/jyoung/archive/2008/08/29/345.aspx" rel="nofollow noreferrer">http://blogs.imeta.co.uk/jyoung/archive/2008/08/29/345.aspx</a>
  I make a web reference to the vendor's .asmx remote web service. </p>
  
  <p>I build and publish my webservice locally, and just try to bring it up in the browser, and get this error: </p>
  
  <blockquote>
    <p>System.InvalidOperationException: An
    exception was thrown in a call to a
    WSDL export extension:
    System.ServiceModel.Description.DataContractSerializerOperationBehavior
    contract:
    <a href="http://tempuri.org/:IValuationService" rel="nofollow noreferrer">http://tempuri.org/:IValuationService</a>
    ----> System.Runtime.Serialization.InvalidDataContractException:
    Type
    'Microsoft.Web.Services3.Addressing.Address'
    cannot be serialized. Consider marking
    it with the DataContractAttribute
    attribute, and marking all of its
    members you want serialized with the
    DataMemberAttribute attribute.  See
    the Microsoft .NET Framework
    documentation for other supported
    types.</p>
  </blockquote>
  
  <p>How can I make an object that I didn't write ('Microsoft.Web.Services3.Addressing.Address') serializeable?  Is it possible to accomplish what I am trying? </p>
  
  <p>Thanks,</p>
  
  <p>Neal Walters </p>
  
  <p><hr>
  Additional Info - Monday Nov 16, 2009:  </p>
  
  <hr>
  
  <pre><code>[ServiceContract]
  public interface IValuationService
  {
      [OperationContract]
      ExpressLync.ValuationServiceWse GetPropertyInfoSourceRecordPolicyNum(string PolicyNumber);
  }
  // end of interface 
  
  // here is part of reference.cs...
  public partial class ValuationServiceWse : Microsoft.Web.Services3.WebServicesClientProtocol {
  ...
  </code></pre>
  
  <p>The only place I can find any reference what-so-ever to 'Microsoft.Web.Services3.Addressing.Address'
  is here, on the metadata when I do a "go to definition" of the Microsoft.Web.Services3.WebServicesClientProtocol</p>
  
  <pre><code>using Microsoft.Web.Services3.Addressing;
  using Microsoft.Web.Services3.Design;
  using System;
  using System.Net;
  using System.Web.Services.Protocols;
  using System.Xml;
  
  namespace Microsoft.Web.Services3
  {
      public class WebServicesClientProtocol : SoapHttpClientProtocol
      {
          public WebServicesClientProtocol();
  
          public EndpointReference Destination { get; set; }
          public Pipeline Pipeline { get; set; }
          public SoapContext RequestSoapContext { get; }
          public bool RequireMtom { get; set; }
          public SoapContext ResponseSoapContext { get; }
          public string Url { get; set; }
          public bool UseDefaultCredentials { get; set; }
  
          public TSecurityToken GetClientCredential&lt;TSecurityToken&gt;() where TSecurityToken : Microsoft.Web.Services3.Security.Tokens.SecurityToken;
          protected override XmlReader GetReaderForMessage(SoapClientMessage message, int bufferSize);
          public TSecurityToken GetServiceCredential&lt;TSecurityToken&gt;() where TSecurityToken : Microsoft.Web.Services3.Security.Tokens.SecurityToken;
          protected override WebRequest GetWebRequest(Uri uri);
          protected override WebResponse GetWebResponse(WebRequest request);
          protected override WebResponse GetWebResponse(WebRequest request, IAsyncResult result);
          protected override XmlWriter GetWriterForMessage(SoapClientMessage message, int bufferSize);
          public void SetClientCredential&lt;TSecurityToken&gt;(TSecurityToken clientToken) where TSecurityToken : Microsoft.Web.Services3.Security.Tokens.SecurityToken;
          public void SetPolicy(Policy policy);
          public void SetPolicy(string policyName);
          public void SetServiceCredential&lt;TSecurityToken&gt;(TSecurityToken serviceToken) where TSecurityToken : Microsoft.Web.Services3.Security.Tokens.SecurityToken;
      }
  }
  </code></pre>
  
  <p>So in other words, how do I get rid of 'Microsoft.Web.Services3.Addressing.Address'? 
  It seems that EndpointReference is in the 'Microsoft.Web.Services3.Addressing.Address' object.  So if I use the WSE3 generated code, it tries to serialize it. </p>
  
  <p>So I think the solution will be to write yet another wrapper that is WSE3 free - and expose it via WCF.  But the trick is that the vendors web services has numerous large and complex objects - which now all inherit from Microsoft.Web.Services3.WebServicesClientProtocol (since I'm using the WS3 code generator).  I really don't want to manually build all of them again.  In the example above, "ValuationService" is just one of such objects.  </p>