Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7033323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:03:07+00:00 2026-05-28T01:03:07+00:00

We are consuming an ASMX service by adding a WCF Service Reference to our

  • 0

We are consuming an ASMX service by adding a WCF “Service Reference” to our project. When we do this, by default it is supposed to use the DataContractSerializer and if something goes wrong, it will fall back to the XmlSerializer.

I’ve tried forcing the DataContractSerializer when generating the proxy classes, but when I do that, they are incomplete and missing all of the custom classes used by the webservice (leaving only the interface for the Soap, SoapChannel, and the SoapClient class).

Well, something is going wrong and it is falling back to the use the XmlSerializer. I do not see any errors or warnings when I generate the reference.

How can I find out what is causing the DataContractSerializer to fail and fall back to the XmlSerializer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:03:08+00:00Added an answer on May 28, 2026 at 1:03 am

    Long story short is that we were unable to force VS to use the DataContractSerializer. Instead we ended up writing our own WCF Service Contracts that represented the webservice. When we consume the service we are instead creating the ChannelFactory generically by using our OWN Service Contracts. Below is the code that we used to create the channel.

     /// <summary>
     /// A generic webservice client that uses BasicHttpBinding
     /// </summary>
     /// <remarks>Adopted from: http://blog.bodurov.com/Create-a-WCF-Client-for-ASMX-Web-Service-Without-Using-Web-Proxy/
     /// </remarks>
     /// <typeparam name="T"></typeparam>
     public class WebServiceClient<T> : IDisposable
     {
         private readonly T channel;
         private readonly IClientChannel clientChannel;
    
         /// <summary>
         /// Use action to change some of the connection properties before creating the channel
         /// </summary>
         public WebServiceClient(string endpointUrl, string bindingConfigurationName)
         {
             BasicHttpBinding binding = new BasicHttpBinding(bindingConfigurationName);
    
             EndpointAddress address = new EndpointAddress(endpointUrl);
             ChannelFactory<T> factory = new ChannelFactory<T>(binding, address);
    
             this.clientChannel = (IClientChannel)factory.CreateChannel();
             this.channel = (T)this.clientChannel;
         }
    
         /// <summary>
         /// Use this property to call service methods
         /// </summary>
         public T Channel
         {
             get { return this.channel; }
         }
    
         /// <summary>
         /// Use this porperty when working with Session or Cookies
         /// </summary>
         public IClientChannel ClientChannel
         {
             get { return this.clientChannel; }
         }
    
         public void Dispose()
         {
             this.clientChannel.Dispose();
         }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am consuming a WCF Service from a webpart in Sharepoint 2007. But its
I have an ASMX webservice that returns XElement - (not an .svc WCF service)
While consuming a web service in my application I have two choices(ref. msdn) Adding
I am consuming a 3rd-party web service which has been implemented in WCF. My
This is my first time consuming a SOAP web service in ASP.Net and I
I am consuming a WCF service from a WP7 app. Both are in a
I have an ASMX Web Service set up to use the HTTP GET method.
I'm trying to consuming a client's web service using WCF. The client's web service
I am consuming a third party WCF service and its config is below (
This article talks about consuming WCF services in Silverlight, but claims: There will be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.