Jump to content
Sign in to follow this  
DOTCOMmunications

XML-RPC

Recommended Posts

DOTCOMmunications

Hi all

I was looking at the XML-RPC functionality that someone posted a while back.

I am just wondering how i would send the following to a webpage and monitor for the result back. Not really done anything with XML before or the XML-RPC either for that matter.

<?xml version="1.0" encoding="UTF-8" ?>
<methodCall>
<methodName>activate</methodName>
<params>
  <param>
   <value>
   <struct>
    <member>
     <name>key</name>
     <value><string>AAAA-BBBB-CCCC-DDDD-EEEE</string></value>
    </member>
    <member>
     <name>identifier</name>
     <value><string>user@example.com</string></value>
    </member>
   </struct>
   </value>
  </param>
</params>
</methodCall>

The response from the page comes back like so

<methodResponse>
<params>
  <param>
   <value>
   <struct>
    <member>
     <name>RESPONSE</name>
     <value><string>OKAY</string></value>
    </member>
    <member>
     <name>USAGE_ID</name>
     <value><int>1</int></value>
    </member>
   </struct>
   </value>
  </param>
</params>
</methodResponse>

I have tried the sample one from this post: which worked fine and returned the correct message.

I have tried to modify the example to use the struct part but i keep getting an error on the $p.info ($myStruct) part saying "The requested action with this object has failed."

$f = ObjCreate("pocketXMLRPC.Factory")
;              RPC Endpoint             Method Prepend
$p = $f.Proxy("http://a16462.demo.invisionpower.com/interface/licenses.php", "")
;   execute the published method "weblogUpdates.ping" on
;   the web server and return a result
$myStruct = ObjCreate("PocketXMLRPC.Struct")
$myStruct.key = "0000-0000-0000-0000-0000"
$myStruct.identifier = "admin"
$r = $p.info ($myStruct)
;   display the result as the method "message"
MsgBox(4096, "Web Service Response", $r.message, 10)
;   displays "Thanks for the ping" if a successful roundtrip
Edited by DOTCOMmunications

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.