This page gives the detailed HTTP requests for each message in the sample session on the main RecipeRPC specification page. If you have an XML-RPC library handy for managing your XML-RPC messages, you should not need this level of detail unless you are debugging a problem.


1A. The HTTP request for

  reciperpc.config("squirrel", "mypassword")
looks like this:

POST /server/reciperpc.php HTTP/1.0
User-Agent: Marquee XML-RPC 1.2
Host: localhost
Content-Type: text/xml
Connection: close
Content-Length: 220

<?xml version="1.0" encoding="ISO-8859-1"?>
<methodCall>
  <methodName>reciperpc.config</methodName>
  <params>
    <param>
      <value>
        <string>squirrel</string>
      </value>
    </param>
    <param>
      <value>
        <string>mypassword</string>
      </value>
    </param>
  </params>
</methodCall>


1B. The HTTP response for

  reciperpc.config("squirrel", "mypassword")
looks like this:

http/1.1 200 ok
date: thu, 18 mar 2004 14:26:38 gmt
server: apache/2.0.48 (win32)
x-powered-by: php/4.3.4
content-length: 826
connection: close
content-type: text/xml

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>version</name>
            <value>
              <string>0.4</string>
            </value>
          </member>
          <member>
            <name>description</name>
            <value>
              <string>RecipeRPC Reference Implementation Server</string>
            </value>
          </member>
          <member>
            <name>criteria</name>
            <value>
              <struct>
                <member>
                  <name>name</name>
                  <value>
                    <array>
                      <data>
                        <value>
                          <string>any</string>
                        </value>
                      </data>
                    </array>
                  </value>
                </member>
                <member>
                  <name>category</name>
                  <value>
                    <array>
                      <data>
                        <value>
                          <string>vegetarian</string>
                        </value>
                        <value>
                          <string>diabetic</string>
                        </value>
                      </data>
                    </array>
                  </value>
                </member>
              </struct>
            </value>
          </member>
          <member>
            <name>formats</name>
            <value>
              <array>
                <data>
                  <value>
                    <string>RecipeML</string>
                    <string>CookML</string>
                  </value>
                </data>
              </array>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>


2A. The HTTP request for

  reciperpc.search("squirrel", "mypassword", criteria, 1)
looks like this:

POST /server/reciperpc.php HTTP/1.0
User-Agent: Marquee XML-RPC 1.2
Host: localhost
Content-Type: text/xml
Connection: close
Content-Length: 378


<?xml version="1.0" encoding="ISO-8859-1"?>
<methodCall>
  <methodName>reciperpc.search</methodName>
  <params>
    <param>
      <value>
        <string>squirrel</string>
      </value>
    </param>
    <param>
      <value>
        <string>mypassword</string>
      </value>
    </param>
    <param>
      <value>
        <struct>
          <member>
            <name>name</name>
            <value>
              <string>lemon</string>
            </value>
          </member>
        </struct>
      </value>
    </param>
    <param>
      <value>
        <i4>1</i4>
      </value>
    </param>
  </params>
</methodCall>


2B. The HTTP response for

  reciperpc.search("squirrel", "mypassword", criteria, 1)
looks like this:

http/1.1 200 ok
date: thu, 18 mar 2004 14:35:43 gmt
server: apache/2.0.48 (win32)
x-powered-by: php/4.3.4
content-length: 698
connection: close
content-type: text/xml

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>total</name>
            <value>
              <int>2</int>
            </value>
          </member>
          <member>
            <name>recipes</name>
            <value>
              <array>
                <data>
                  <value>
                    <struct>
                      <member>
                        <name>name</name>
                        <value>
                          <string>#1 Lemon Bars</string>
                        </value>
                      </member>
                      <member>
                        <name>id</name>
                        <value>
                          <string>12345</string>
                        </value>
                      </member>
                    </struct>
                  </value>
                  <value>
                    <struct>
                      <member>
                        <name>name</name>
                        <value>
                          <string>1-2-3 Lemon Pie</string>
                        </value>
                      </member>
                      <member>
                        <name>id</name>
                        <value>
                          <string>65432</string>
                        </value>
                      </member>
                    </struct>
                  </value>
                </data>
              </array>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>


3A. The HTTP request for

  reciperpc.fetch("squirrel", "mypassword", 65432, "RecipeML")
looks like this:

POST /server/reciperpc.php HTTP/1.0
User-Agent: Marquee XML-RPC 1.2
Host: localhost
Content-Type: text/xml
Connection: close
Content-Length: 340

<?xml version="1.0" encoding="ISO-8859-1"?>
<methodCall>
  <methodName>reciperpc.fetch</methodName>
  <params>
    <param>
      <value>
        <string>squirrel</string>
      </value>
    </param>
    <param>
      <value>
        <string>mypassword</string>
      </value>
    </param>
    <param>
      <value>
        <string>65432</string>
      </value>
    </param>
    <param>
      <value>
        <string>RecipeML</string>
      </value>
    </param>
  </params>
</methodCall>


3B. The HTTP response for

  reciperpc.fetch("squirrel", "mypassword", 65432, "RecipeML")
looks like this:

http/1.1 200 ok
date: thu, 18 mar 2004 14:56:06 gmt
server: apache/2.0.48 (win32)
x-powered-by: php/4.3.4
content-length: 1438
connection: close
content-type: text/xml

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
  <params>
    <param>
      <value>
        <base64>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCg0KPHJlY2lwZW1sIHZlcnNpb249IjAuNSI+DQogIDxyZWNpcGU+DQogICAgPGhlYWQ+DQogICAgICA8dGl0bGU+MS0yLTMgTGVtb24gUGllPC90aXRsZT4NCiAgICAgIDxjYXRlZ29yaWVzPg0KICAgICAgICA8Y2F0Pk5vbmU8L2NhdD48L2NhdGVnb3JpZXM+DQogICAgICA8eWllbGQ+MTwveWllbGQ+PC9oZWFkPg0KICAgIDxpbmdyZWRpZW50cz4NCiAgICAgIDxpbmc+DQogICAgICAgIDxhbXQ+DQogICAgICAgICAgPHF0eT4xPC9xdHk+DQogICAgICAgICAgPHVuaXQ+Y2FuPC91bml0PjwvYW10Pg0KICAgICAgICA8aXRlbT5Cb3JkZW4gRWFnbGUgQnJhbmQgU3dlZXRlbmVkIGNvbmRlbnNlZCBtaWxrPC9pdGVtPjwvaW5nPg0KICAgICAgPGluZz4NCiAgICAgICAgPGFtdD4NCiAgICAgICAgICA8cXR5PjE8L3F0eT4NCiAgICAgICAgICA8dW5pdD5jYW48L3VuaXQ+PC9hbXQ+DQogICAgICAgIDxpdGVtPihzbWFsbCkgZnJvemVuIGxlbW9uYWRlPC9pdGVtPjwvaW5nPg0KICAgICAgPGluZz4NCiAgICAgICAgPGFtdD4NCiAgICAgICAgICA8cXR5PjE8L3F0eT4NCiAgICAgICAgICA8dW5pdC8+PC9hbXQ+DQogICAgICAgIDxpdGVtPkNvbnRhaW5lciAoc21hbGwpIENvb2wgV2hpcDwvaXRlbT48L2luZz48L2luZ3JlZGllbnRzPg0KICAgIDxkaXJlY3Rpb25zPg0KICAgICAgPHN0ZXA+ICBTb3VyY2U6IENvb2tib29rcyBPbi9MaW5lCiAgCiAgUG91ciBpbnRvIHJlYWR5IG1hZGUgZ3JhaGFtIGNyYWNrZXIgcGllIGNydXN0LgogIAogIFBvc3RlZCB0byBFQVQtTCBEaWdlc3QgMDQgRGVjIDk2CiAgCiAgRnJvbTogICAgRWRpdGggTWFydGluICZsdDtkYW5kZUBDRFNORVQuTkVUJmd0OwogIAogIERhdGU6ICAgIFRodSwgNSBEZWMgMTk5NiAxOToxMDoyNSAtMDgwMAogCjwvc3RlcD48L2RpcmVjdGlvbnM+PC9yZWNpcGU+PC9yZWNpcGVtbD4NCg==</base64>
      </value>
    </param>
  </params>
</methodResponse>

The value of the base64 type is, of course, the 1-2-3 Lemon Pie recipe in RecipeML, encoded in
base64.

Last updated 18 February 2004
This web site copyright 2004 D. Squirrel
Graphics provided by Jeff Bucchino, the Wizard of Draws, for noncommercial use.

SourceForge.net Logo