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

  • Home
  • SEARCH
  • 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 8298325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:43:50+00:00 2026-06-08T15:43:50+00:00

I’m trying to access some data through JSON RPC using the trac XMLRPCPlugin using

  • 0

I’m trying to access some data through JSON RPC using the trac XMLRPCPlugin using my own method ‘plugged’ into one of it’s extension points on the server side and a JQuery AJAX request on the client side. I can access the data fine using the Firefox poster extension however using the JQuery ajax request gives an error message. The error message I get is:

Trac[web_ui] DEBUG: RPC incoming request of content type 'application/json' dispatched 
to <tracrpc.json_rpc.JsonRpcProtocol object at 0x03CA51F0>
Trac[web_ui] DEBUG: RPC(JSON-RPC) call by 'PaulWilding'
Trac[json_rpc] ERROR: RPC(json) decode error 
Traceback (most recent call last):
  File "build\bdist.win32\egg\tracrpc\json_rpc.py", line 148, in parse_rpc_request
    data = json.load(req, cls=TracRpcJSONDecoder)
  File "C:\Python27\Lib\json\__init__.py", line 278, in load
    **kw)
  File "C:\Python27\Lib\json\__init__.py", line 339, in loads
    return cls(encoding=encoding, **kw).decode(s)
  File "build\bdist.win32\egg\tracrpc\json_rpc.py", line 99, in decode
    obj = json.JSONDecoder.decode(self, obj, *args, **kwargs)
  File "C:\Python27\Lib\json\decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python27\Lib\json\decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Trac[web_ui] ERROR: RPC(JSON-RPC) Error
Traceback (most recent call last):
  File "build\bdist.win32\egg\tracrpc\web_ui.py", line 143, in _rpc_process
    rpcreq = req.rpc = protocol.parse_rpc_request(req, content_type)
  File "build\bdist.win32\egg\tracrpc\json_rpc.py", line 162, in parse_rpc_request
    raise JsonProtocolException(e, -32700)
JsonProtocolException: No JSON object could be decoded
Trac[json_rpc] DEBUG: RPC(json) encoded response: {"error": {"message": "JsonProtocolException details : No JSON object could be decoded", "code": -32700, "name": "JSONRPCError"}, "result": null, "id": null}

The JQuery request is:

 url: "http://localhost/Projects/jsonrpc",
   contentType: "application/json",
   dataType: "jsonp",
   data: {"method": "breq.getBreqs"},
   type: 'POST',
   success: function (repsonse) {
          alert("success");
   },
   error: function (jqXHR, textStatus, errorThrown) {
          alert("Error: " + textStatus);
   }      

The request I’ve got working through Poster is simply “{“method”: “breq.getBreqs”}” with content set to application/json and the URL the same as above.

I’ve read a few posts about this problem when used with a PHP proxy and tried logging the request in the parse_rpc_request in the trac rpc plugin but this only returned the same string of “” for both the working and non-working requests.

I don’t think this is a problem due to Javascript’s Same Origin Policy as the request is to my trac testbed which is on my machine. However, once the plugin is deployed onto a server still inside the main network will this become an issue and if so, how should I deal with it?

If the problem isn’t to do with the Same Origin Policy does anyone know what is causing it?

  • 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-08T15:43:53+00:00Added an answer on June 8, 2026 at 3:43 pm

    Your call will URL encode the input, which is not what you want for JSON-RPC. You want the request body to be a JSON string with no added characters or information.

    Here is a new version of your snippet that loads fine from a browser javascript console, but note that my example calls system.listMethods (and not your custom method) so that it works for any Trac RPC installation:

    $.ajax({
       url: "http://localhost/trac/rpc",
       contentType: "application/json",
       dataType: "text",
       data: JSON.stringify({method: "system.listMethods", id: 42}),
       type: 'POST',
       success: function (response) {
           incoming = JSON.parse(response)
           alert("Result ID " + incoming["id"] + ": " + incoming["result"]);
       },
       error: function (jqXHR, textStatus, errorThrown) {
           alert("Error: " + textStatus);
       }
    });
    

    Use /login/rpc URL unless anonymous have assigned XML_RPC permission.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.