django-modern-rpc icon indicating copy to clipboard operation
django-modern-rpc copied to clipboard

xml rpc entity processing issue

Open alonek1 opened this issue 10 months ago • 1 comments

Hi, i'm trying to send request in XML format and i need to read methodnames from a dtd file on my host.

the request is

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root SYSTEM "http://myhost.com/methods.dtd">
<root>
    <id>1</id>
    <methodName>&methodName;</methodName>
    <params>
        <user>admin</user>
    </params>
    <jsonrpc>2.0</jsonrpc>
</root>

resone is

<?xml version="1.0"?>
            <methodResponse>
                <fault>
<value><struct>
<member>
<name>faultCode</name>
<value><int>-32600</int></value>
</member>
<member>
<name>faultString</name>
<value><string>Invalid request: Missing methodName. Please provide the name of the procedure you want to call</string></value>
</member>
</struct></value>
</fault>

            </methodResponse>

it seems there is a problem while defining entity and calling them in the request.

PS: it works with calling methodNames directly (like system.listMethods)

alonek1 avatar Apr 09 '24 01:04 alonek1

According to https://xmlrpc.com/spec.md

The basic request format is

<?xml version="1.0"?>
<methodCall>
  <methodName>examples.getStateName</methodName>
  <params>
    <param>
      <value><i4>41</i4></value>
    </param>
  </params>
</methodCall>

So adapting to your needs, your request should looks like

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root SYSTEM "http://myhost.com/methods.dtd">
<methodCall>
    <methodName>&methodName;</methodName>
    <params>
        <param><value><string>admin</string></value></param>
    </params>
</methodCall>

Can you try that payload ?

alorence avatar Apr 15 '24 18:04 alorence

No answer for a month, I assume the issue was an invalid request format.

Please open a new ticket if you still need to report an invalid behavior.

Regards

alorence avatar May 15 '24 12:05 alorence