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 6629403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:15:18+00:00 2026-05-25T22:15:18+00:00

I have a REStful WCF web service (using a substantially modified WCF Rest Starter

  • 0

I have a REStful WCF web service (using a substantially modified WCF Rest Starter Kit) and the data contracts are simple POCOs marked with [Serializable] and [XmlType] (with members tagged with [XmlElement] or [XmlAttribute] where appropriate).

Somewhere inside WCF an instance of XmlSerializer is created which generates the output with no indentation or spacing between XML nodes, which is fine for automated processes, but makes debugging harder as I have to manually format the XML output myself.

I want to use XmlWriterSettings so it will automatically format the XML before it gets sent down the pipe, but I can’t see where I could inject it.

I used Reflector to find where XmlSerializer is instantiated within WCF and it shows up inside a few nested internal classes isnide XmlSerializerOperationBehavior, but beyond that I’m stuck.

Ta!

  • 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-25T22:15:19+00:00Added an answer on May 25, 2026 at 10:15 pm

    The XmlWriterSettings object isn’t passed to the constructor to the XmlSerializer, but to the XmlWriter which will be then passed to the serializer when it’s time to write the object out. The place where you can change that is a custom message encoder (responsible for converting between the XML Infoset in the message and the actual bytes in the wire). One good sample of a custom encoder which creates a XmlWriter instance is the “Custom Text Encoder“.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF web service that implements a RESTful interface. We're using the
I have a simple web service I wrote using Webmatrix that returns data in
I'm trying to consume a RESTful web service using WCF. I have no control
I have a WCF RESTful web service (using the webHttpBinding) running under IIS, exposed
I have a ReSTful web service which needs to parse locale-sensitive data from the
I have a RESTful WCF web service that processes huge XML files that are
I have a RESTful WCF web service called "Palladium" as a project in my
I have a WCF Web Api Restful webservice. I want every single service call
I have developed an rest enable wcf service by using the following link http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/simplerestservice11172009221218PM/simplerestservice.aspx
I am exploring the idea of implementing a web service api using WCF Data

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.