FoxPro/Visual FoxPro - http.Send(

 
Vista:

http.Send(

Publicado por kevin (1 intervención) el 13/12/2006 02:23:26
esta funcion en que dll se encuentra por que lo he puesto en
mi proyecto el dll msxml3.dll pero me dice q no ecuentre este recurso por que

http.Send(


SET DEFA TO C:\SOAP
SET LIBRARY TO FoxCrypto.FLL
PUBLIC lcInFile,lcInFile64

DO psEnviArchivo

PROCEDURE psEnviArchivo
***********************
*envia archivo
PARAMETER pArc
tcInFile = IIF(EMPTY(pArc),"C:\cpsaduan\aduana\poliza.zip", pArc)
lcInFile = FILETOSTR(tcInFile)
lcInFile64 = codifica(lcInFile)

***

doc = CreateObject("MSXML2.DOMDocument")
http = CreateObject("MSXML2.XMLHTTP")
http.Open("POST", "http://desweb1:8001/portafolio/portafolio", .F.)
http.SetRequestHeader("SOAPAction", "enviaArchivoWebService")
http.SetRequestHeader("Content-Type", "text/xml")
**carga el archivo

xml = fnArmaCadXml("A", "0091", "XXXX", "142", lcInFile64, "CDDEmbargoM5.htm")
doc.LoadXML(xml)
http.Send(doc.xml)
res = CreateObject("MSXML2.DOMDocument")
response = http.responseText
*?response
res.LoadXML(http.responseText)
txt = res.selectSingleNode("//NroEnvioGenerado") &&Return
IF nvl(txt.text,' ') = " " THEN
TXT="ERROR EN WS "
ENDIF
wait window txt.text NOWAIT
*? txt.text
release doc
release http
release res
release response

RETURN


FUNCTION decodifica
PARAMETER pCadena
LOCAL lcBinary, lnHandle, lnSize
lnHandle = Base64DecoderCreate()
IF lnHandle > 0
Base64DecoderPut(lnHandle, pCadena)
Base64DecoderClose(lnHandle)
lnSize = Base64DecoderMaxRetrievable(lnHandle)
lcBinary = Base64DecoderGet(lnHandle, lnSize)
Base64DecoderDestroy(lnHandle)
ELSE
WAIT WIND "ERROR al instanciar"
RETURN .F.
ENDIF
RETURN lcBinary

FUNCTION codifica
PARAMETER pCadena
LOCAL lcBase64, lcInFile, lnHandle, lnSize
lnHandle = Base64EncoderCreate( .T. )
IF lnHandle > 0
Base64EncoderPut(lnHandle, pCadena)
Base64EncoderClose(lnHandle)
lnSize = Base64EncoderMaxRetrievable(lnHandle)
lcBase64 = Base64EncoderGet(lnHandle, lnSize)
Base64EncoderDestroy(lnHandle)
ELSE
WAIT WIND "ERROR al instanciar"
RETURN .F.
ENDIF
RETURN lcBase64

FUNCTION fnArmaCadXml
*********************
PARAMETER pTOpe, pOpe, pClave, pAdu, pArch, pNomArch
strxml = [<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"] + CHR(13)
strxml = strxml + [ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"] + CHR(13)
strxml = strxml + [ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"] + CHR(13)
strxml = strxml + [ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">] + CHR(13)
strxml = strxml + [ <env:Header>] + CHR(13)
strxml = strxml + [ </env:Header>] + CHR(13)
strxml = strxml + [ <env:Body>] + CHR(13)
strxml = strxml + [ <m:enviaArchivoWebService xmlns:m="http://www.bea.com/education/webservices/examples/basic/javaclass"] + CHR(13)
strxml = strxml + [ env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">] + CHR(13)
strxml = strxml + [ <toperador xsi:type="xsd:string">] + pTOpe + [</toperador>] + CHR(13)
strxml = strxml + [ <operador xsi:type="xsd:string">] + pOpe + [</operador>] + CHR(13)
strxml = strxml + [ <clave xsi:type="xsd:string">] + pClave + [</clave>] + CHR(13)
strxml = strxml + [ <aduana xsi:type="xsd:string">] + pAdu + [</aduana>] + CHR(13)
strxml = strxml + [ <archivoEnvioByte xsi:type="xsd:base64Binary">] + pArch + [</archivoEnvioByte>] + CHR(13)
strxml = strxml + [ <nombreArchivo xsi:type="xsd:string">] + pNomArch+ [</nombreArchivo>] + CHR(13)
strxml = strxml + [ </m:enviaArchivoWebService>] + CHR(13)
strxml = strxml + [ </env:Body>] + CHR(13)
strxml = strxml + [</env:Envelope>]
RETURN strxml
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder