VFP9 -- Web Service para timbrar.
Publicado: Mié Dic 07, 2011 4:36 pm
Ya tengo Xml validado, solo para timbrar; voy a timbrar con TimbreFiscal
el problema es que exactamente no se como, desconozco WS.
alguien quiere ayudar con poner o decirnos algun codigo ejemplo de invocar el WS.
navengando... he encontrado esto.. lo voy analizar...
este ejemplo es parte de un codigo, es para EDICOM
LOCAL loCFDi AS "XML Web Service"
* LOCAL loCFDi AS "MSSOAP.SoapClient30"
* Do not remove or alter following line. It is used to support IntelliSense for your XML Web service.
*__VFPWSDef__: loCFDi = https://cfdiws.sedeb2b.com/EdiwinWS/services/CFDi?wsdl , CFDiService , CFDi
LOCAL loException, lcErrorMsg, loWSHandler
m.lcErrorMsg = ""
TRY
loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx")
loCFDi = loWSHandler.SetupClient("https://cfdiws.sedeb2b.com/EdiwinWS/services/CFDi?wsdl", "CFDiService", "CFDi")
* Call your XML Web service here. ex: leResult = loCFDi.SomeMethod()
CATCH TO loException
lcErrorMsg="Error: "+TRANSFORM(loException.Errorno)+" - "+loException.Message
DO CASE
CASE VARTYPE(loCFDi)#"O"
* Handle SOAP error connecting to web service
CASE !EMPTY(loCFDi.FaultCode)
* Handle SOAP error calling method
lcErrorMsg=lcErrorMsg+CHR(13)+loCFDi.Detail
OTHERWISE
* Handle other error
ENDCASE
* Use for debugging purposes
THISFORM.Displaywarning("ERROR: "+lcErrorMsg)
FINALLY
ENDTRY
IF !EMPTY(m.lcErrorMsg)
DELETE FILE (cCFDFileNameXML)
WAIT CLEAR
RETURN .F.
ENDIF
-- juntemos informacion y unamos conocimiento para timbrar,
fuentesags@hotmail.com
j. fuentes.
el problema es que exactamente no se como, desconozco WS.
alguien quiere ayudar con poner o decirnos algun codigo ejemplo de invocar el WS.
navengando... he encontrado esto.. lo voy analizar...
este ejemplo es parte de un codigo, es para EDICOM
LOCAL loCFDi AS "XML Web Service"
* LOCAL loCFDi AS "MSSOAP.SoapClient30"
* Do not remove or alter following line. It is used to support IntelliSense for your XML Web service.
*__VFPWSDef__: loCFDi = https://cfdiws.sedeb2b.com/EdiwinWS/services/CFDi?wsdl , CFDiService , CFDi
LOCAL loException, lcErrorMsg, loWSHandler
m.lcErrorMsg = ""
TRY
loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx")
loCFDi = loWSHandler.SetupClient("https://cfdiws.sedeb2b.com/EdiwinWS/services/CFDi?wsdl", "CFDiService", "CFDi")
* Call your XML Web service here. ex: leResult = loCFDi.SomeMethod()
CATCH TO loException
lcErrorMsg="Error: "+TRANSFORM(loException.Errorno)+" - "+loException.Message
DO CASE
CASE VARTYPE(loCFDi)#"O"
* Handle SOAP error connecting to web service
CASE !EMPTY(loCFDi.FaultCode)
* Handle SOAP error calling method
lcErrorMsg=lcErrorMsg+CHR(13)+loCFDi.Detail
OTHERWISE
* Handle other error
ENDCASE
* Use for debugging purposes
THISFORM.Displaywarning("ERROR: "+lcErrorMsg)
FINALLY
ENDTRY
IF !EMPTY(m.lcErrorMsg)
DELETE FILE (cCFDFileNameXML)
WAIT CLEAR
RETURN .F.
ENDIF
-- juntemos informacion y unamos conocimiento para timbrar,
fuentesags@hotmail.com
j. fuentes.