 |
|
 |
Thanks, it helped me a lots
|
|
|
|
 |
|
 |
I am use vb.net 2005 to create an application to download file from external website.Now i need download through proxy.when running application then appear error.
This is error message
(
System.Net.WebException: The server committed a protocol violation. Section=ResponseStatusLine
at System.Net.WebClient.DownloadFile(Uri address, String fileName)
at System.Net.WebClient.DownloadFile(String address, String fileName)
)
And this is my code
{
Dim proxy As New WebProxy("172.25.6.41", 25)
proxy.Credentials = New NetworkCredential("User", "Password", "Domain")
Dim WeCSl As New WebClient
WeCSl.Proxy = proxy
WeCSl.DownloadFile("http://www.codeproject.com/KB/vb/autoupdate/autoupdate.zip", "D:/file.zip")
}
You please help me fix this error.
Thank !
|
|
|
|
 |
|
 |
Hello,
I am pretty new to webservices and proxy server authentication. I want to know how we can create/ add a proxy server for any sample webservice. I know you have already explained this in ur article. But i am confused...
Please help
|
|
|
|
 |
|
 |
Hi , excuse me for my bad English
Consuming a Java Web Service from my company in a windows form with or with the proxy's statements
(
Dim lws As New Ser_Aduanas.SiscaWebService
Dim lprx As WebProxy = New WebProxy("192.168.21.9", 80)
Dim lcrd As NetworkCredential = New NetworkCredential("soportezfd", "Telem@tica")
lprx.Credentials = lcrd
lws.Proxy = lprx
lstr2 = lws.registraManifiestoEnapu("", "", "", "", "", "", "", "", "", "", "", "", "")
)
It always expires the time connection (this is the error)
"Se ha terminado la conexión: La conexión ha terminado de forma inesperada."
I run the project backwward from a proxy
Please Help Me!!!!!
|
|
|
|
 |
|
 |
Bruno,
The Proxy Server IP Adress is 127,0,1,2 and the port is the 80.
The data of the user for the authentication with the proxy are:
User Id: user
Password: pwd
Domain: MyDomain
the proxy server you meant was created by oneself using C#? if that, how can I implement it? Look farword to your feedback.
Arron
|
|
|
|
 |
|
 |
i am working in donet 1.1 windows application. I am accessing the webservices using proxy settings. If i use winproxy means its working fine.. But if i use CCProxy.. the following code will not work for sometimes.
System.Net.WebProxy WProxy = new System.Net.WebProxy((
ProxyHost,ProxyPort);
if((ProxyLogin.Trim().Length > 0) &&(ProxyPassword.Trim().Length > 0))
{
System.Net.NetworkCredential cred = new System.Net.NetworkCredential(ProxyLogin,ProxyPassword,ProxyDomain);
WProxy.Credentials = cred;
}
Its giving the error:
The request failed with HTTP status 407 : Unauthorized.
Please give me the solution for this..
Best regards
Christy
|
|
|
|
 |
|
 |
I'm trying to access a web address using proxy (Microsoft ISA Server).
The authentication is NTLM (using domain in Windows 2000).
My code is :
try
{
const string proxyHostAndPort = "http://myproxy:8080";
WebProxy webProxy = new WebProxy(proxyHostAndPort, true);
webProxy.Credentials = CredentialCache.DefaultCredentials;
WebRequest webRequest = WebRequest.Create("http://www.microsoft.com");
webRequest.Credentials = CredentialCache.DefaultCredentials;
webRequest.Proxy = webProxy;
WebResponse webResponse = webRequest.GetResponse();
Stream stream = webResponse.GetResponseStream();
byte[] receivedDataInBytes = new byte[webResponse.ContentLength];
stream.Read(receivedDataInBytes, 0, receivedDataInBytes.Length);
string receivedDataInString = Encoding.ASCII.GetString(receivedDataInBytes);
Trace.WriteLine(receivedDataInString);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
But I get an error (407 - Proxy authentication needed). Are there something wrong in my code ?
Thanks.
|
|
|
|
 |
|
 |
Hi,
the follow code will be run normally in WindowsApplication:
string userName = "a";
string userPass = "a";
string address = "192.168.18.145";
int port = 8080;
WebProxy myproxy = new WebProxy(address , port);
NetworkCredential credentials = new NetworkCredential(userName, userPass, null);
myproxy.Credentials = credentials;
WebRequest rqt = WebRequest.Create(this.textBox2.Text.Trim());
rqt.Proxy = myproxy;
rqt.PreAuthenticate = true;
WebResponse rsp = rqt.GetResponse();
System.IO.Stream stream = rsp.GetResponseStream();
System.IO.StreamReader reader = new System.IO.StreamReader(stream);
this.textBox1.Text = reader.ReadToEnd();
stream.Close();
reader.Close();
but in the SmartDeviceApplication,,it will cause the problem :
The response did not contain an end of entity mark.
Can you tell me why and how to solve the problem??
Thank you !!
Icerain Lin
|
|
|
|
 |
|
 |
Hi,
I am trying to do the following, it seems like it should work, but i am really new to vb.net
Dim IE As InternetExplorer
IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
Dim proxyObject As New System.Net.WebProxy("http://148.244.150.57:80/", True)
IE.Proxy = proxyObject
IE.Navigate("http://www.whatismyip.com")
basically when it goes to whatismyip.com it should show me the same address as the proxy, currently what is happening is that ie is starting up but then it sort of freezes and no page loads, any ideas how to fix this? (Also is there a way to set the proxy in the ie through vb?)
Thanks,
Michael
(mike509123 AT hotmail dot com)
|
|
|
|
 |
|
 |
Mike ... I tryed your code in a Sample aplication and the problem seems to be in the line
IE.Proxy = proxyObject
That is beocuse the proxy property of the IExplorer object is no accesible from VbNet. I could not fount the reference to declare a variable as InternetExplorer, so i put the declaration as Object
Dim IE As Object ' InternetExplorer
but in the line of the proxy it throws an Exception.
Bye from Spain
El Bruno
MCP Bruno Capuano
Jefe de Desarrollo
PECTRA Technology Inc.
All the Solutions in One Product
+54(351)4245756 - int. 301
www.pectra.com
|
|
|
|
 |
|
 |
Bueno Bruno, sabes cómo puedo enviar información de una aplicación en VB.NET hacia una
página web? No tengo ni la menor idea de cómo hacer esto. Estaba intentando enviar la información por email, pero obtengo una excepción que dice que no se puede acceder
al objeto CDO.Message.
Agradezco cualquier ayuda sobre cualquiera de los 2 temas.
F chile
|
|
|
|
 |
|
 |
Carlos , buen dia.
Si tu quieres trabajar con una pagina web, deberias crear una aplicacion web, en el caso de microsoft una aplicacion Asp.Net, de esta manera puedes generar tus paginas web. (fijate en http://msdn.microsoft.com/asp.net/[^], que es el sitio oficial de Microsoft para el desarrollo en Asp.Net)
Por otro lado, si quieres enviar datos desde una aplicacion windows a una aplicacion web, puedes utilizar webservices que en el caso de .Net es una tecnologia muy simple. (http://msdn.microsoft.com/webservices/[^])
Por ultimo el envio de mails, utilizando el objeto CDO, solo se puede hacer en el cliente cuando tienes configurada una cuenta de mail y se puede acceder a la misma, en tu caso puede ser que tal vez, que no tengas los permisos suficientes.
Saludos
El Bruno
MCP Bruno Capuano
Jefe de Desarrollo
PECTRA Technology Inc.
All the Solutions in One Product
+54(351)4245756 - int. 301
www.pectra.com
|
|
|
|
 |
|
 |
Estoy consumiendo un webservice que hice pasando por un proxy..
El metodo New de reference.vb me quedo similar a:
Public Sub New()
MyBase.New()
Dim cr As New System.Net.NetworkCredential("MiUsuario", "MiPass")
Dim pr As New System.Net.WebProxy("proxy.com", 8080)
pr.Credentials = cr
Me.Proxy = pr
Me.Url = "http://mywebservice/ws.asmx"
End Sub
Pero cuando invoco los metodos del webservice me aparece el error:
The request failed with HTTP status 417: Expectation Failed.
¿Como puedo solucionar esto?
Damian Brizuela
UPS
|
|
|
|
 |
|
 |
Damian, buen dia.
Una de las opciones, ya que el error es el 417 es que el proxy no sea valido.
Yo probaria con los siguientes cambios,
- utilizaria la IP del proxy en lugar del nombre del mismo.
- si estas dentro de un dominio, pondria el nombre completo del usuario
por ejemplo :
Dim cr As New System.Net.NetworkCredential("Dominio\MiUsuario", "MiPass")
Dim pr As New System.Net.WebProxy("127.0.0.1", 8080)
Esto puede ser una opcion, ya que el error 417 es un error de cliente, como una peticion no autorizada por ejemplo.
Saludos
El Bruno
MCP Bruno Capuano
Jefe de Desarrollo
PECTRA Technology Inc.
All the Solutions in One Product
+54(351)4245756 - int. 301
www.pectra.com
|
|
|
|
 |
|
 |
Gracias por la respuesta Bruno.
Al principio yo pensaba que era asi de simple, pero despues de probar eso y de revisar que toda la teoria este bien... segui probando cosas que no funcionaron hasta que en otro foro me pasaron esta info:
System.Net.ServicePointManager.Expect100Continue = False
Agregando esa linea en el archivo reference.vb justo antes de invocar los metodos del web service te deja de tirar el error 417.
Quedaria algo asi:
Public Function EjecutarSentencia(ByVal Sentencia As String) As String
System.Net.ServicePointManager.Expect100Continue = False
Dim results() As Object = Me.Invoke("EjecutarSentencia", New Object() {Sentencia})
Return CType(results(0), String)
End Function
Saludos
Damian :->
|
|
|
|
 |
|
 |
[ System.Net.ServicePointManager.Expect100Continue = False ]
Q buen dato !!!
Gracias
El Bruno
MCP Bruno Capuano
Jefe de Desarrollo
PECTRA Technology Inc.
All the Solutions in One Product
+54(351)4245756 - int. 301
www.pectra.com
|
|
|
|
 |
|
 |
Bruno, i'm becoming *crazy* with a probleme.
* I have a simple WebService, called "HelloWorld"
* i access the web server using a proxy (SQUID on linux).
* if my proxy does not require authentication, all works fine!
* if my proxy REQUIRE authentication, i cannot reach my service and I have a "Time out" error.
-- CODE -----
[..]
' Set proxy credentials (NOTE: Domain is empty..)
Dim cr As New System.Net.NetworkCredential("proxyUser", "proxyPWD", "")
Dim pr As System.Net.WebProxy
' NOTE: using GetDefaultProxy or setting manually is the same result..
pr = New WebProxy("10.23.0.66", 3128)
'pr = WebProxy.GetDefaultProxy
pr.Credentials = cr
service.Proxy = pr
service.timeout = 10000 '10 seconds timeout
result = service.helloWord() ' <------ TIMEOUT ERROR!!
-- END CODE ----
Is this a known problem with Squid ??
Thanks for ANY help!!
ALberto G.
|
|
|
|
 |
|
 |
Hi !!!
sorry for the late response ...
I'm installing a Linux and a SQUID to perform a test ... and i'll tell you !!!
Byes from Argentina !!
MCP Bruno Capuano
Jefe de Desarrollo
PECTRA Technology Inc.
All the Solutions in One Product
+54(351)4245756 - int. 301
www.pectra.com
|
|
|
|
 |
|
 |
I'm using SQUID and I've exactly the same problem!
Without username and password it say Error 407 authentication required
With username and password -> Timeout!
|
|
|
|
 |
|
 |
I was trying to access google API Web Services through SQUID(2.5.Stable3) and it returned 407 authentication required.
I was able to fix it by using useDefaultCredentials=true and expect100Continue="false"
See my post:Call Web Services through SQuid proxy server with authentication requested [^]
-- modified at 23:29 Tuesday 12th September, 2006
Michael Freidgeim.
Blog: http://geekswithblogs.net/mnf/
|
|
|
|
 |
|
 |
Bruno, i'm becoming *crazy* with a probleme.
* I have a simple WebService, called "HelloWorld"
* i access the web server using a proxy (SQUID on linux).
* if my proxy does not require authentication, all works fine!
* if my proxy REQUIRE authentication, i cannot reach my service and I have a "Time out" error.
-- CODE -----
[..]
' Set proxy credentials (NOTE: Domain is empty..)
Dim cr As New System.Net.NetworkCredential("proxyUser", "proxyPWD", "")
Dim pr As System.Net.WebProxy
' NOTE: using GetDefaultProxy or setting manually is the same result..
pr = New WebProxy("10.23.0.66", 3128)
'pr = WebProxy.GetDefaultProxy
pr.Credentials = cr
service.Proxy = pr
service.timeout = 10000 '10 seconds timeout
result = service.helloWord() ' <------ TIMEOUT ERROR!!
-- END CODE ----
Is this a known problem with Squid ??
Thanks for ANY help!!
ALberto G.
|
|
|
|
 |
|
 |
If the application is going from client to an outside-the-lan server through a proxy, why wouldn't System.Net.WebProxy.GetDefaultProxy() work? The doc's say that that function grabs the proxy info from IE, which would seem to be good enough in most cases. Any thoughts on this? Am I not understanding something?
Thanks.
Tom
|
|
|
|
 |
|
|
 |
|
 |
Maybe I have the same problem...but didn't found any solution yet.
I'm using this method:
private static IWebProxy webProxy = null; //Singleton
public static IWebProxy getProxy(){
if(webProxy == null){
webProxy = WevRequest.DefaultWebProxy;
//tried to add the default credentials to
//webProxy.Credentials = CredentialCache.DefaultCredentials;
}
return webProxy
}
then:
webserviceClient.Proxy = getProxy();
can't reach the endpoint. I got an ISA Server on the network.
When I use Fidler it works (it serves as proxy of proxy);
I'm calling this webservice from an Outlook Add-In.
Help please.
best regards
|
|
|
|
 |
|
 |
I want to create kerberos security for web-forum. Does anybody know what I
need and What I have to do?
|
|
|
|
 |