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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:27:37+00:00 2026-05-18T10:27:37+00:00

I have a client submitting a web-request (POST) of XML data to a server.

  • 0

I have a client submitting a web-request (POST) of XML data to a server. The head of the XML reads <?xml version="1.0" encoding="utf-16"?> but the data is truly utf-8. We are trying to intercept the existing stream (and everybody involved realizes this, we’re trying to put in a store-and-forward so if there’s any downtime we can at least buffer the requests) but IIS seems to be rejecting the XML because the actual encoding doesn’t match the stated encoding.

If we manually (using a string as our originating value in a test-client app) force the encoded bytestream and set the encoding value within the string to either UTF-32 or UTF-8 in C# and shove it into our WCF method, it works fine.

But sending in UTF-8 encoded values with a header in the file that reads UTF-16, it bombs out. Lastly, and most exasperatingly, I’m not the primary dev on this, I’ve had my eyes on it a grand total of 6 hours over 4 days, and I’m being tasked from on high with finding a spare bit of magic laying about. Anybody got some ideas?

So my issue is with either IIS or ASP.NET, I realize that. I’m just not sure what and where to kick this damned thing, and not sure what details I’m missing for the question. I did hash this out in the chatroom prior to posting here, and a few details more were unearthed, but if you have questions, I’m open to answering them, as I can. You just ask what you want to see, and I’ll share. And I’m going to forego going ahead and posting lots and lots of C# and web.config code because, honestly, I don’t know what’s the best starting point to approach this particular problem.

So there’s no way to fix the header on the client end?

Not at this time. Just spent 30 minutes on a group support call, and their primary dev for this project is out for the next 10 days, and our sales group has promised our product up by the end of this week

Does it throw an error that could be trapped?

No. The client reports a 400 error. That’s the extent of our ability to track this puppy down, right now. I’m hoping somebody here with more familiarity on IIS fixes that for me 😉


So I’m looking for either

  • an ASP.NET or IIS solution that allows me to tell the input that I don’t care what it’s stated encoding is, tyvm, I know better, OR
  • a WCF way of intercepting the stream before it hits my class methods and then rewrite the string on the fly by examining for the <?xml version="1.0" encoding="utf-16"?> on this particular request.
  • 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-18T10:27:38+00:00Added an answer on May 18, 2026 at 10:27 am

    You might consider implementing you’re own decoder. See the following SO question: Configuring the .NET WCF UTF-8 deserializer to modify/discard non-shortest form chars instead of throwing an exception?

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

Sidebar

Related Questions

We have client server based app which saves user related data into a zip
i have client-server app, I'm managing connections with Threads and handlers inside app, but
I have a Django form that needs to do some client-side validation before submitting
I have client/server applications and a very simple protocol for communication. More precisely, it's
I have Client-Server environment and developed a project for Client-Server. I need to share
I have client/server application where the client app will open files. Those files get
I have client-server app. Client on C++, server on Java. I am sending byte-stream
I am developing an application in C# WPF which will have Client-Server architecture (Client
I have client for web interface to long running process. I'd like to have
I've have a client that is using a third party piece of web software.

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.