Visual Basic para Aplicaciones - Ayuda con macro y Web Services

Life is soft - evento anual de software empresarial
 
Vista:

Ayuda con macro y Web Services

Publicado por kadosh (1 intervención) el 02/08/2016 02:05:07
Hola, tengo una macreo que en el servidor de produccion , un service en vs 2010 , funaciona perfectamente, y consume los datos que entrega el servicio. Ahora, cuando lo subo a un host, este necesita que le envie el Content-Length: de la peticion y no se como enviarla, ya que no puedo calcularla , se me ocurren varias cosas pero no se cuales son las necesarias , esto es lo que envia:

POST /HostIp/Service.asmx/InformarDatosServer HTTP/1.1
Accept: */*
Accept-Language: es
soapaction: http://www.servi.com.ar/HostIP/InformarDatosServer
Content-Type: text/xml; charset=utf-8
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.2)
Host: www.servi.com.ar
Content-Length: 0
Connection: Keep-Alive
Cache-Control: no-cache

Content-Length: 0 esta en cero por que calcula con los datos sin encabezado y como no envia parametros no tiene largo. Ahora, pruebo el servicio con una aplicacion de .net y si envia al mismo servicio un largo.:

POST /hostip/service1.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
VsDebuggerCausalityData: uIDPo9UiXntzXptLoaUwH+XvA1kAAAAAGOHA20S51UebMs9dUGv9l36vhLoeUF1MiKt20g6MSp8ACQAA
SOAPAction: "http://www.servi.com.ar/HostIP/InformarDatosServer"
Host: www.servi.com.ar
Content-Length: 291
Expect: 100-continue
Connection: Keep-Alive

Pregunata: que datos son los que hay que calcular? cada linea de lo que envia?

los datos los veo con un sniffer por que es transparente a mi, lo envio con el metodo que trae vs.net y ecxell con XMLHTTP

pense, en hacer un encabezado y con eso y Len() calcular el tamaño . el error que me devuelve es:

<html>
<head>
<title>Runtime Error</title>
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
</style>
</head>

<body bgcolor="white">

<span><H1>Server Error in '/HostIP' Application.<hr width=100% size=1 color=silver></H1>

<h2> <i>Runtime Error</i> </h2></span>

<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

<b> Description: </b>An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
<br><br>

<b>Details:</b> To enable the details of this specific error message to be viewable on remote machines, please create a &lt;customErrors&gt; tag within a &quot;web.config&quot; configuration file located in the root directory of the current web application. This &lt;customErrors&gt; tag should then have its &quot;mode&quot; attribute set to &quot;Off&quot;.<br><br>

<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>

&lt;!-- Web.Config Configuration File --&gt;

&lt;configuration&gt;
&lt;system.web&gt;
&lt;customErrors mode=&quot;Off&quot;/&gt;
&lt;/system.web&gt;
&lt;/configuration&gt;</pre></code>

</td>
</tr>
</table>

<br>

<b>Notes:</b> The current error page you are seeing can be replaced by a custom error page by modifying the &quot;defaultRedirect&quot; attribute of the application's &lt;customErrors&gt; configuration tag to point to a custom error page URL.<br><br>

<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>

&lt;!-- Web.Config Configuration File --&gt;

&lt;configuration&gt;
&lt;system.web&gt;
&lt;customErrors mode=&quot;RemoteOnly&quot; defaultRedirect=&quot;mycustompage.htm&quot;/&gt;
&lt;/system.web&gt;
&lt;/configuration&gt;</pre></code>

</td>
</tr>
</table>

<br>

</body>
</html>
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