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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:00:30+00:00 2026-06-02T12:00:30+00:00

My .NET ASMX webservice is accepting requests from a client I don’t have direct

  • 0

My .NET ASMX webservice is accepting requests from a client I don’t have direct control over. It’s sending a request that looks like this:

POST /Service.asmx HTTP/1.1
Connection: Keep-Alive
Pragma: no-cache
Content-Length: 1382
Content-Type: text/xml
Accept: text/xml
Host: localhost
User-Agent: Borland SOAP 1.1
SOAPAction: "http://domain.com/InsertRecords"

<?xml version="1.0"?>
<SOAP-ENV:Envelope... <v>ÄLMÅ BÄCK</v></SOAP-ENV:Envelope>

In my WebMethod, the string ÄLMÅ BÄCK gets munged to ??LM?? B??CK — typical encoding mess-up.

In my testing I’ve found that if I simply tweak the content-type header, all is well:

Content-Type: text/xml; charset=utf-8

Why is .NET choosing an encoding other than utf-8 when it’s unspecified, and is there any way I can coerce this ASMX to use UTF-8 encoding?

  • 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-06-02T12:00:31+00:00Added an answer on June 2, 2026 at 12:00 pm

    The following code run before the web service handler is invoked resulted in the HTTP Request correctly decoded:

    if (HttpContext.Current.Request.ContentType == "text/xml") {
        HttpContext.Current.Request.ContentType = "text/xml; charset=UTF-8";
    }
    

    This feels a bit hacky, but I believe it’ll work well for my circumstances. I’m still very interested in some background information on why this was an issue at all, and if there’s a better way to pull this off (besides getting the client to be more explicit about the encoding).

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

Sidebar

Related Questions

I have an asp.net .asmx webservice written to handle requests from a third party
I have an ASP.NET webservice (.asmx) with a simple method that reads something from
I have an old style .NET ASMX (SOAP/XML) webservice that is used to upload
We have an ASMX web service which we invoke from our ASP.NET application using
I've written an ASP.NET webservice (.asmx style rather than WCF) and I have the
I'm trying to call an ASP.NET .asmx webservice, from javascript, using other than the
I'm doing some pre-processing of an XML document in a ASMX Webservice (Legacy .NET
I have a messaging system that is a .NET 2 ASMX web service, very
I have am asp.net 3.5 web site with a asmx web service and a
I have a .NET web service (using asmx...have not upgraded to WCF yet) that

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.