Então,
Mais tarde posso tentar bolar algo a respeito, mas a idéia básica é a seguinte:
Imagine este webservice que contêm dados sobre a copa do mundo:
http://footballpool.dataaccess.eu/data/info.wso
Agora para executar alguma das operações listadas, basta proceder como no exemplo do CEP. Veja como é simples pegar o "TOP 10" artilheiros da Copa:
Note o último 10 no endereço, se você quiser pegar o TOP 50, altere para 50...
Usando a hbtip:
Código: Selecionar todos
PROCEDURE MAIN()
cls
oHttp:= TIpClientHttp():new( "http://footballpool.dataaccess.eu/data/info.wso/TopGoalScorers/JSON?iTopN=10" )
IF ! oHttp:open()
? "Erro:", oHttp:lastErrorMessage()
QUIT
ENDIF
cResposta := oHttp:readAll()
oHttp:close()
? cResposta
RETURN
Veja o retorno como chega: (neste ponto pode-se usar as funções para JSON - viewtopic.php?f=4&t=11317)
Código: Selecionar todos
[
{
"sName": "David Villa",
"iGoals": 5,
"sCountry": "Y",
"sFlag": "http://footballpool.dataaccess.eu/images/flags/es.gif"
},
{
"sName": "Diego Forlán",
"iGoals": 5,
"sCountry": "Y",
"sFlag": "http://footballpool.dataaccess.eu/images/flags/uy.gif"
},
{
"sName": "Thomas Müller",
"iGoals": 5,
"sCountry": "Y",
"sFlag": "http://footballpool.dataaccess.eu/images/flags/de.gif"
},
{
"sName": "Wesley Sneijder",
"iGoals": 5,
"sCountry": "Y",
"sFlag": "http://footballpool.dataaccess.eu/images/flags/nl.gif"
},
{
"sName": "Gonzalo Higuaín",
"iGoals": 4,
"sCountry": "Y",
"sFlag": "http://footballpool.dataaccess.eu/images/flags/ar.gif"
},
{
"sName": "Miroslav Klose",
"iGoals": 4,
"sCountry": "Y",
"sFlag": "http://footballpool.dataaccess.eu/images/flags/de.gif"
},
{
"sName": "Róbert Vittek",
"iGoals": 4,
"sCountry": "Y",
"sFlag": "http://footballpool.dataaccess.eu/images/flags/sk.gif"
},
{
"sName": "Asamoah Gyan",
"iGoals": 3,
"sCountry": "Y",
"sFlag": "http://footballpool.dataaccess.eu/images/flags/gh.gif"
},
{
"sName": "Chung-Yong Lee",
"iGoals": 3,
"sCountry": "Y",
"sFlag": "http://footballpool.dataaccess.eu/images/flags/kr.gif"
},
{
"sName": "Landon Donovan",
"iGoals": 3,
"sCountry": "Y",
"sFlag": "http://footballpool.dataaccess.eu/images/flags/us.gif"
}
]
Apenas lembrando que o "padrão" seria enviar algo parecido com isso, mas é justamente o que eu quis evitar:
Código: Selecionar todos
POST /data/info.wso HTTP/1.1
Host: footballpool.dataaccess.eu
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<TopGoalScorers xmlns="http://footballpool.dataaccess.eu">
<iTopN>int</iTopN>
</TopGoalScorers>
</soap:Body>
</soap:Envelope>
Bom, espero ter esclarecido em alguma coisa...