XML-RPC
Posted: Mon Nov 16, 2009 8:55 am
I need to use XML-RPC protocol from FWH/xHarbour.
Any ideas?
EMG
Any ideas?
EMG
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>
<methodCall>
<methodName>sample.sum</methodName>
<params>
<param>
<value><int>17</int></value>
</param>
<param>
<value><int>13</int></value>
</param>
</params>
</methodCall>
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>
<methodResponse>
<params>
<param>
<value><int>30</int></value>
</param>
</params>
</methodResponse>
Code: Select all
// FiveWin ActiveX support demo - Using PocketSOAP Activex
// José Carlos da Rocha
#include "FiveWin.ch"
function Main(nSkin)
local oWnd, oActiveX
local cXML := "" + ;
"<S:Envelope" + ;
" S:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'" + ;
" xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'" + ;
" xmlns:E='http://schemas.xmlsoap.org/soap/encoding/'" + ;
" xmlns:a='http://soap.address.org/'" + ;
" xmlns:b='http://www.w3.org/2001/XMLSchema-instance'" + ;
" xmlns:c='http://www.w3.org/2001/XMLSchema'>" + ;
"<clientes>" + ;
" <numero>123</numero>" + ;
" <rua>R Dr M.M.Mattoso,50</rua>" + ;
" <cidade>Sao Paulo</cidade>" + ;
" <estado>SP</estado>" + ;
" <cep>05171-340</cep>" + ;
" <telefone>" + ;
" <ddd>011</ddd>" + ;
" <numero>3534-3099</numero>" + ;
" </telefone>" + ;
"</clientes>" + ;
"</S:Envelope>"
DEFINE WINDOW oWnd //TITLE "FiveWin ActiveX Support"
oNFe := TOLEAuto():New( "PocketSOAP.Envelope.2" )
oNFe:SetMethod( "NFe", "http://www.portalfiscal.inf.br/nfe" )
oddress := oNFe:Parameters:Create( "clientes", "" )
oddress:Nodes:Create( "numero", "123" )
oddress:Nodes:Create( "rua", "R Dr M.M.Mattoso,50" )
oddress:Nodes:Create( "cidade", "Sao Paulo" )
oddress:Nodes:Create( "estado", "SP" )
oddress:Nodes:Create( "cep", "05171-340" )
oPhone := oddress:Nodes:Create( "telefone", "" )
oPhone:Nodes:Create( "ddd", "011" )
oPhone:Nodes:Create( "numero", "3534-3099" )
esr := oNFe:serialize() // Create a XML source
? "Result:",,esr
adr := oNFe:Parameters:Item(0):Value
? "Variable Cidade:",,adr:Nodes:ItemByName("cidade"):Value
ACTIVATE WINDOW oWnd //ON INIT CodeJockSkin_InitDlg( oDlg, nSkin )
return nil