XML-RPC

XML-RPC

Postby Enrico Maria Giordano » Mon Nov 16, 2009 8:55 am

I need to use XML-RPC protocol from FWH/xHarbour.

Any ideas?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XML-RPC

Postby Antonio Linares » Mon Nov 16, 2009 10:52 am

Enrico,

This may help:
http://www.tutorialspoint.com/xml-rpc/index.htm

This is a small example of the XML to send to the server to invoque the remote procedure call:
Code: Select all  Expand view
<?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>
 

Copied from the above url :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: XML-RPC

Postby Antonio Linares » Mon Nov 16, 2009 10:54 am

The server response:
Code: Select all  Expand view
<?xml version="1.0" encoding="ISO-8859-1"?>
<methodResponse>
    <params>
    <param>
        <value><int>30</int></value>
    </param>
    </params>
</methodResponse>
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Re: XML-RPC

Postby Silvio » Fri Nov 20, 2009 8:46 am

Someone created a class to read/write xml
I not remember but If you search you found
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: XML-RPC

Postby Rochinha » Fri Nov 27, 2009 7:10 am

Friends,

This simple sample show the PocketSOAP Activex use:
Code: Select all  Expand view

// 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
 


Download and install for http://www.pocketsoap.com
Rochinha
 
Posts: 310
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests