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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:46:02+00:00 2026-05-14T03:46:02+00:00

I have a very simple OpenRasta app with a Home resource with a single

  • 0

I have a very simple OpenRasta app with a Home resource with a single string property of Title (straight from the OpenRasta community doc example).

I’ve set up both XML and JSON data contracts for the resource like this:

ResourceSpace.Has.ResourcesOfType<Home>()
    .AtUri("/home")
    .HandledBy<HomeHandler>()
    .AsXmlDataContract()
    .And.AsJsonDataContract();

From jQuery, I’m able to get the JSON data just fine. However, when I make a jQuery XML Ajax request, I get JSON data back.

My jQuery code looks like this:

$.ajax(
{
    url: "/home",
    dataType: "xml",
    success: function(result) {
        $('#xmlSpan').append($(result).find('Title').text());
    },
    error: function(request, status, ex) {
        $('#xmlSpan').append('error: ');
        $('#xmlSpan').append(status + ', ');
        $('#xmlSpan').append(ex.toString());
    }
});

The error information being appended ends up looking like this:

error: parsererror, TypeError: a is null

But here is the interesting part. From Fiddler, my request looks like this:

GET http://127.0.0.1:51041/home HTTP/1.1
Host: 127.0.0.1:51041
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8
Accept: application/xml, text/xml, */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ipv4.fiddler:51041/WebForm1.aspx
Cache-Control: max-age=0

…and my response looks like this:

HTTP/1.1 200 OK
Server: ASP.NET Development Server/9.0.0.0
Date: Thu, 04 Mar 2010 18:30:04 GMT
X-AspNet-Version: 2.0.50727
Content-Length: 18
Cache-Control: private
Content-Type: application/json; q=0.5
Connection: Close

{"Title":"Foooo!"}

My request is coming in as “Accept: application/xml” but the response is “application/json” (and the returned data is obviously json).

What am I doing wrong?

  • 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-14T03:46:02+00:00Added an answer on May 14, 2026 at 3:46 am

    Mike,

    (sorry I didn’t see that quesiton before)

    You’re not doing anything wrong, and this should work jsut fine.

    Your Accept: header specifies that your client is happy to receive application/xml or anything else (/). Chances are that OpenRasta assumes that “anything else” works and goes with the json codec.

    If you change your header to

    Accept: application/xml, text/xml;q=0.9, /;q=0.8

    Then you shoudl be fine. Alternatively, just remove the / alltogether/

    That said, normaly / is always put as a last resort in the content negotiation algorythms of openrasta, so this result is very surprising. What version of OR are you using?

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

Sidebar

Related Questions

I have very simple select like this: SELECT * FROM table WHERE column1 IN
I have a very simple linq query that gets data from two datatables (orderHeader
I have a very simple query: SELECT cp.`id_connections` FROM `connections_page` cp WHERE cp.`time_end` IS
i have very simple problem. I need to create model, that represent element of
I have a very simple problem which requires a very quick and simple solution
I have a very simple WPF application in which I am using data binding
I have a very simple bit of script that changes the status of an
I have a very simple TCP server written in C. It runs indefinitely, waiting
I have a very simple Java RMI Server that looks like the following: import
I have a very simple ASP.Net page that acts as a front end for

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.