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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:11:10+00:00 2026-05-28T06:11:10+00:00

This is a problem we’ve seen discussed in other places, with a couple of

  • 0

This is a problem we’ve seen discussed in other places, with a couple of potential solutions, but we’re unable to get any of them to work.

We have an ASP.net webservice set up to return results as JSON. We use JQuery $.post to get the results (but that’s almost certainly not part of the issue.) When the results arrive on the client side, they have been wrapped in XML tags. So, instead of returning like this:

<?xml version="1.0" encoding="utf-8"?>
{data}

…they return like this…

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="[SomeURL.com]">{data}</string>

In the process of testing this we’ve discovered that the default in ASP.net 3.5 for webservice results was JSON, but that in ASP.net 4.0, this was changed to XML.

To try and test this we downloaded an ASP.net 3.5 test webservice application, and locally this output in JSON as expected. We then upgraded the application to 4.0, expecting this to begin outputting as XML. However, locally, it continued to output as JSON without the external tags.

Then, we moved this test application to our IIS 7.0 server, and it immediately began outputting as XML. This meant that the issue was to do with settings within IIS vs local settings.

We then found this post:

asmx web service returning xml instead of json in .net 4.0

…and have tried replacing the 4.0 Script Handler via web.config to the 3.5 version. However, this isn’t working either. After our web.config amends, we then have the following in IIS’ Handler Mappings area:

ScriptHandlerFactory – 3.5 version.
ScriptHandlerFactoryAppServices-Integrated-4.0 – 4.0 version.

…but also…

WebServiceHandlerFactory-Integrated – 2.0 version
WebServiceHandlerFactory-Integrated-4.0 – 4.0 version
WebServiceHandlerFactory-ISAPI-2.0
WebServiceHandlerFactory-ISAPI-2.0-64
WebServiceHandlerFactory-ISAPI-4.0_32bit
WebServiceHandlerFactory-ISAPI-4.0_64bit

So… that’s where we are – messing with IIS settings to try and get the webservice to send as JSON. We’re pretty certain that this is an IIS setting, or at least an ASP.net 4.0 vs 3.5 setting.

As background, the ASP.net webservice looks like this:

<System.Web.Script.Services.ScriptService(Namespace:="[SomeURL.com]")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class RequestM
Inherits System.Web.Services.WebService

<WebMethod()> _
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=False, XMLSerializeString:=False)> _
Public Function dataRequestJSON(ByVal JsonRequestObject As String) As String

    Try

        Dim MyNewDataRequest As New DataRequest(JsonRequestObject)
        Dim MyJsonResponse = MyNewDataRequest.JsonResponse
        Return MyJsonResponse

    Catch ex As Exception
        Return ex.Message
    End Try

End Function

Please help!

Thanks!

  • 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-28T06:11:11+00:00Added an answer on May 28, 2026 at 6:11 am

    The problem was the formatting of the json request, whilst it was valid json, the asp.net webserive was still returning xml. Turned out to be nothing to do with the iis settings at all. Must have been a red herring on some other forums

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

Sidebar

Related Questions

This problem is creeping up in many places in my code,but the general behavior
This problem is not readily reproducible in a simple example here but was wondering
This problem may seem like school work, but it isn't. At best it is
This problem smells like there should be an answer in graph theory, but it
This problem is old and basic but I can't figure out a better way
This problem is discussed in this question Android: Wrong item checked when filtering listview
This problem drives me crazy. I miss some basic but very important knowledge about
This problem may be a bit too vast and nebulous for this space, but
This problem seems to come up for a few people, but I haven't been
This problem has bugged me so many times and i have now decided to

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.