Web Service - Error

Web Service - Error

Postby Mauricio » Thu Sep 30, 2010 7:21 pm

Hola,

Estoy intentando hacer la conexion a un web service pero se niega fwh

Code: Select all  Expand view

                 oServidor:= TOleAuto():New("MSSOAP.SoapClient30")   // aqui se sale del programa sin decir ni adios.
                 msginfo('No paso')

                 oServidor:MsSoapInit("http://www2.soriana.com/integracion/recibecfd/wseDocRecibo.asmx?wsdl")
                 
 


fwh 10.7, xhb, bcc582

algun paso que me este saltando, un ejemplo me seria de gran utilidad.


Gracias,
Mauricio
User avatar
Mauricio
 
Posts: 199
Joined: Thu Oct 06, 2005 9:07 pm
Location: San Diego, CA

Re: Web Service - Error

Postby Antonio Linares » Fri Oct 01, 2010 5:47 am

Mauricio,

Si tienes instalado Office, prueba a crear ese mismo objeto desde el VBA de Office (desde un macro de Word, por ejemplo).
regards, saludos

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

Re: Web Service - Error

Postby Mauricio » Fri Oct 01, 2010 10:47 pm

Antonio:

en VBA si hace la conexión sin marcar error.

en fwh en esta linea se sale sin marcar ningun error.

oServidor:= TOleAuto():New("MSSOAP.SoapClient30")


fw10.7, xhb, bcc582, Win732b


Saludos,
Mauricio
User avatar
Mauricio
 
Posts: 199
Joined: Thu Oct 06, 2005 9:07 pm
Location: San Diego, CA

Re: Web Service - Error

Postby Mauricio » Fri Oct 01, 2010 11:11 pm

Antonio:

Re Instale MS Soap 3.0 y ya pude hacer la conexion.

Seguire peleando con las propiedas de la conexion :mrgreen:


Saludos,
Mauricio
User avatar
Mauricio
 
Posts: 199
Joined: Thu Oct 06, 2005 9:07 pm
Location: San Diego, CA

Re: Web Service - Error

Postby leonardoinacio » Wed Oct 13, 2010 7:51 pm

Mauricio,

No Windows 7 tive problemas com o MSSOAPClient 3.0.

Mesmo instalando o pacote como Administrador não estava funcionando.
O que não acontecia antes com o WinXP.

Após vários testes opter por usar o código abaixo, que funciona tanto no XP quanto no WIn7, e não depende da instalação do MSSoapClient3, pois utiliza OLE com IExplorer.
É um pouco mais chato porque você tem que montar o XML que será enviado, conhecer mêtodo que deseja resposta e tratar a resposta.
Por outro lado, você tem mais controle do processo.

Fica como dica.

Code: Select all  Expand view


cXmlBody := '' + ;
'<?xml version="1.0" encoding="utf-8"?>' + ;
'<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">' + ;
'  <SOAP-ENV:Body>' + ;
'    <req:ws_graf xmlns:req="http://www.actions.com.br/integracao/webservice/">'                    + ;
'      <login xsi:type="xsd:string">'           + cUsuario                  + '</login>'            + ;
'      <assinatura xsi:type="xsd:string">'  + cSenha                    + '</assinatura>'       + ;
'      <modelo xsi:type="xsd:string">'      + cModelo                       + '</modelo>'           + ;
'      <titulo xsi:type="xsd:string">'      + cTitulo                       + '</titulo>'           + ;
'      <xmlin xsi:type="xsd:string">'           + acXmlEncode( xml_in )     + '</xmlin>'            + ;
'    </req:ws_graf>' + ;
'  </SOAP-ENV:Body>' + ;
'</SOAP-ENV:Envelope>'

// ---

doc     = CreateObject( "MSXML2.DOMDocument" )
http    = CreateObject( "MSXML2.XMLHTTP" )

http:Open( "POST" , "http://www.actions.com.br/integracao/webservice/ws.grafico.php" , .F. )

http:SetRequestHeader( "SOAPAction" , "ws_graf" )
http:SetRequestHeader( "Content-Type" , "text/xml" )

doc:LoadXML( cXmlBody )

http:Send( doc:xml )

response = http:responseText

If .Not. Empty( Alltrim( response ) )

    res = CreateObject( "MSXML2.DOMDocument" )

    res:LoadXML( http:responseText )

    txt = res:selectSingleNode( "//ns1:ws_grafResponse" )
   
    cRetorno := txt:Text
   
Else
   
    cRetorno = "### Nao foi possivel gerar a imagem ###"
   
Endif

Release doc
Release http
Release res
Release response

 


Qualquer dúvida estou a disposição.

Saludos
Leonardo Inácio
leonardoinacio
 
Posts: 4
Joined: Tue Sep 21, 2010 4:49 pm
Location: Brasil

Re: Web Service - Error

Postby elmoiquique » Wed Aug 01, 2012 2:01 pm

Alguien tiene idea de como consumir un archivo adjunto, la respuesta del web service es un xml que contiene pero no se como recuperar el archivo que trae adjunto...

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header xmlns:work="http://bea.com/2004/06/soap/workarea/">
<cl:token xmlns:cl="cl.zofri.sve">0e2099080517762c4--3bc04e97-f4-c-1303-0a88 a2d1-7f43-7:6434ab958b9:a6545-e40b9280507561c6-23-c-4090-147cc1-04-3ab80acd -3f13274673:af948495a95:5</cl:token>
<cl:respuesta xmlns:cl="cl.zofri.sve">
<java:resCodigo xmlns:java="java:cl.zofri.sve.utl.bo">0</java:resCodigo>
<java:resMensaje xmlns:java="java:cl.zofri.sve.utl.bo">Se ejecutó correctamente el servicio.</java:resMensaje>
<java:resSeveridad xmlns:java="java:cl.zofri.sve.utl.bo">O</java:resSeveridad>
</cl:respuesta>
<work:WorkContext xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">
<java class="java.beans.XMLDecoder">
<string>weblogic.app.sveProcDocEAR</string>
<int>214</int>
<string>weblogic.workarea.StringWorkContext</string>
<string>r43.3</string>
<string>weblogic.app.KNAEar</string>
<int>214</int>
<string>weblogic.workarea.StringWorkContext</string>
<string>r43.2</string>
<string/>
</java>
</work:WorkContext>
</env:Header>
<env:Body>
<m:exportarBorradoresResponse xmlns:m="http://cl/zofri/sve/prd/wsn">
<m:return>
<Include href="cid:return=216af389-dcc9-4770-80fb-610304b481e0@http://cl/zofri/sve/prd/wsn" xmlns="http://www.w3.org/2004/08/xop/include"/>
</m:return>
</m:exportarBorradoresResponse>
</env:Body>
</env:Envelope>
Fivewin 11.07
elmoiquique
 
Posts: 297
Joined: Wed May 16, 2007 9:40 pm
Location: Iquique Chile

Re: Web Service - Error

Postby elmoiquique » Tue May 13, 2014 9:35 pm

Mauricio wrote:Antonio:

Re Instale MS Soap 3.0 y ya pude hacer la conexion.

Seguire peleando con las propiedas de la conexion :mrgreen:


Saludos,
Mauricio


hola mauricio,,

me podrias indicar donde bajar el programa para intalar el ms soap 3.0

gracias
Fivewin 11.07
elmoiquique
 
Posts: 297
Joined: Wed May 16, 2007 9:40 pm
Location: Iquique Chile


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 19 guests