FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour RECARGAS EN LINEA
Posts: 11
Joined: Tue Jan 08, 2013 01:04 AM
RECARGAS EN LINEA
Posted: Thu Jun 06, 2013 03:43 PM

Hola alguien a integrado algĂșn web services para recargas electrĂłnicas de telĂ©fono celulares ?

Posts: 401
Joined: Thu Oct 06, 2005 10:15 PM
Re: RECARGAS EN LINEA
Posted: Thu Jun 06, 2013 09:19 PM

Yo lo hago por sockets

Saludos,



Pablo Alberto Vidal

/*

------------------------------------------------------

Harbour 3.2.0, Fivewin 17.02, BCC7

------------------------------------------------------

*/
Posts: 1144
Joined: Mon Feb 05, 2007 07:15 PM
Re: RECARGAS EN LINEA
Posted: Thu Jun 06, 2013 11:23 PM

perdĂłn pero con que se come eso de los sockets.
saludos.

Cesar Cortes Cruz

SysCtrl Software

Mexico



' Sin +- FWH es mejor "
Posts: 401
Joined: Thu Oct 06, 2005 10:15 PM
Re: RECARGAS EN LINEA
Posted: Fri Jun 07, 2013 02:33 AM
Saludos,



Pablo Alberto Vidal

/*

------------------------------------------------------

Harbour 3.2.0, Fivewin 17.02, BCC7

------------------------------------------------------

*/
Posts: 1076
Joined: Fri Oct 07, 2005 10:41 PM
Re: RECARGAS EN LINEA
Posted: Fri Jun 07, 2013 05:47 AM

Excelente...

William, Morales

Saludos



méxico.sureste
Posts: 142
Joined: Sun Oct 09, 2005 01:36 AM
Re: RECARGAS EN LINEA
Posted: Sun Jun 09, 2013 06:13 PM

Que Tal Rober68

Te envio un ejemplo , que se conecta con el webservice pasando el nombre de usuario y pass,
si el usuario es correcto , pasas a la recarga ,

Fabian

Function webservice

'<wsr:intAgenteID>2</wsr:intAgenteID>'+ ;
'<wsr:strAgentePass>123</wsr:strAgentePass>'+ ;

cXMlBody = '<?xml version="1.0" encoding="UTF-8"?>' + ;
'<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsr="WSRecarga">'+ ;
'<soap:Header/>'+ ;
'<soap:Body>'+ ;
'<wsr:Login>'+ ;
'<wsr:intAgenteID>9</wsr:intAgenteID>'+ ;
'<wsr:strAgentePass>quioscos</wsr:strAgentePass>'+ ;
'</wsr:Login>'+ ;
'</soap:Body>'+ ;
'</soap:Envelope>'

// Abertura de funçiones para WebService xHarbour //
doc = CreateObject( "MSXML2.DOMDocument" )
http = CreateObject( "MSXML2.XMLHTTP" )

// Colocar la direccion del WebService //

http:Open( "POST" , "http://190.7.440.38/WSRecarga/WSRecarga.asmx" , .f. )

// Accion que debe ejecutar el webservice
http:SetRequestHeader( "SOAPAction" , "WSRecarga/Login" )
http:SetRequestHeader( "Content-Type" , "text/xml" )

// Funçiones del WebService //
doc:LoadXML( cXmlBody ) //
http:Send( doc:xml ) //
response = http:responseText // Recibe respuesta
cFilename:="texto.xml" // Nombre del archivo temporal
ferase(cfilename)

oText:= TTxtFile():New( cfilename )
if oText:Open()
oText:add(alltrim(response))
endif
oText:close()

? response

hFile := FOpen( cFileName )
IF hFile == -1
MsgStop("Erro ao abrir arquivo:"+cFileName)
Return Nil
ENDIF

xmlDoc := TXmlDocument():New( hFile )

xmlNode := xmlDoc:oRoot:oChild
DO WHILE xmlNode != NIL
cNome:=xmlNode:cName
if cNome=='WS_Busc_ProjetosResult'
cXMLRetorno:=xmlNode:cData
endif
xmlNode := xmlNode:NextInTree()
ENDDO
fclose(hFile)

Posts: 11
Joined: Tue Jan 08, 2013 01:04 AM
Re: RECARGAS EN LINEA
Posted: Tue Jun 11, 2013 07:38 PM

Hola Fabian me podrias dar algĂșn correo para estar en contacto ? y preguntarte algunas cosas que tengo duda

Posts: 11
Joined: Tue Jan 08, 2013 01:04 AM
Re: RECARGAS EN LINEA
Posted: Tue Jun 11, 2013 07:38 PM
Algun Mail Fabian ?

Databaselab2002 wrote:Que Tal Rober68

Te envio un ejemplo , que se conecta con el webservice pasando el nombre de usuario y pass,
si el usuario es correcto , pasas a la recarga ,

Fabian

Function webservice

*'<wsr:intAgenteID>2</wsr:intAgenteID>'+ ;
*'<wsr:strAgentePass>123</wsr:strAgentePass>'+ ;



cXMlBody = '<?xml version="1.0" encoding="UTF-8"?>' + ;
'<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsr="WSRecarga">'+ ;
'<soap:Header/>'+ ;
'<soap:Body>'+ ;
'<wsr:Login>'+ ;
'<wsr:intAgenteID>9</wsr:intAgenteID>'+ ;
'<wsr:strAgentePass>quioscos</wsr:strAgentePass>'+ ;
'</wsr:Login>'+ ;
'</soap:Body>'+ ;
'</soap:Envelope>'


// Abertura de funçiones para WebService xHarbour //
doc = CreateObject( "MSXML2.DOMDocument" )
http = CreateObject( "MSXML2.XMLHTTP" )

// Colocar la direccion del WebService //


http:Open( "POST" , "http://190.7.440.38/WSRecarga/WSRecarga.asmx" , .f. )


// Accion que debe ejecutar el webservice
http:SetRequestHeader( "SOAPAction" , "WSRecarga/Login" )
http:SetRequestHeader( "Content-Type" , "text/xml" )

// Funçiones del WebService //
doc:LoadXML( cXmlBody ) //
http:Send( doc:xml ) //
response = http:responseText // Recibe respuesta
cFilename:="texto.xml" // Nombre del archivo temporal
ferase(cfilename)

oText:= TTxtFile():New( cfilename )
if oText:Open()
oText:add(alltrim(response))
endif
oText:close()


? response

hFile := FOpen( cFileName )
IF hFile == -1
MsgStop("Erro ao abrir arquivo:"+cFileName)
Return Nil
ENDIF


xmlDoc := TXmlDocument():New( hFile )


xmlNode := xmlDoc:oChild
DO WHILE xmlNode != NIL
cNome:=xmlNode:cName
if cNome=='WS_Busc_ProjetosResult'
cXMLRetorno:=xmlNode:cData
endif
xmlNode := xmlNode:NextInTree()
ENDDO
fclose(hFile)
Posts: 257
Joined: Mon Jun 10, 2013 06:40 PM
Re: RECARGAS EN LINEA
Posted: Fri Jun 14, 2013 05:35 PM

Los proveedores de este servicio aquĂ­ en la tienda
me dieron un ejecutable en java

Lo ejecuto con unos parĂĄmetros y me retorna un archivo txt
donde viene los datos a poner en el ticket.

y eso es todo.

Continue the discussion