Solved

To fetch XML from different URLs when proxy server is on....

Posted on 2003-11-20
11
461 Views
Last Modified: 2008-02-01
I am working on a VB application which retrieves the XML from different URLs. I used VB Inet control for the same. But the application fails if the proxy server is on. The proxy has basic authentication. How do I send the username and password of the proxy server to this control? I also tried using ServerXMLHTTP object to achieve the same. But in this the session cookies are not maintained and my application fails.(XMLHTTP object maintains session cookies but not serverxmlhttp,  but xmlhttp cant be used to set proxycredentials). Any ideas in this regard??
0
Comment
Question by:RashmiRao1
  • 4
  • 4
11 Comments
 
LVL 9

Expert Comment

by:Dang123
ID: 9797318
Check what you have AccessType property of the inet control set to. icUseDefault (0) should use the same method as IE to connect (Proxy or direct).
0
 

Author Comment

by:RashmiRao1
ID: 9808192
Even though I set accessrype to icUseDefault(0), how do I pass the username and password of the proxy server into this control?
0
 
LVL 9

Expert Comment

by:Dang123
ID: 9810395
I am using the inet control to download HTML pages through a our proxy server, it does basic authentication also. I only needed to set the AccessType to icUseDefault for the control to deal with it. I beleave it pulls its information from the Internet Explorer setup information.

Perhaps this may help you.

HOWTO: Use the Proxy Property in the Internet Transfer Control
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/KB/ARTICLES/Q171/3/79.asp&NoWebContent=1


0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:RashmiRao1
ID: 9815662
I am supposed to develop an application which is not dependent on IE settings. Something like Yahoo messenger,where in  option is provided for giving the username and password of the proxy server. I still didn't get how to send the username and password of the proxy server to the control.
I hope I have explained myself clearly.

0
 
LVL 9

Expert Comment

by:Dang123
ID: 9817632
According to the book Visual Basic 6 Unleashed, Professional Reference Edition

"Using the Internet Transfer Control with a Proxy Server  
 
 
 If you're accessing the Internet via a proxy server, there are some special considerations you need to be aware of before using the Internet Transfer Control. You must set the control's Proxy and AccessType properties when using a proxy server.  
 
 
 First, set the Proxy property to the name of the proxy server. If you're unsure of the name of the proxy server for your system (or if your system uses a proxy server), open the Windows 9x/NT Control Panel and double-click the Internet icon. Then select the Connection tab on the Internet Properties dialog box. If the Connect Through a Proxy Server box is checked, you are accessing the Internet through a proxy server. To determine the name of the proxy server, click the Settings button. You will then see a list of the proxy servers used for different protocols such as HTTP and FTP.  
 
 
 After you have established the proxy server name and have set the Proxy property, change the AccessType property to icNamedProxy. That's all there is to it. You can now access the Internet via the Internet Transfer Control and the proxy server.  "


0
 
LVL 9

Expert Comment

by:Dang123
ID: 9817673
Based on that, I played with some code, and found I also needed to specify the proxy servers port in the address like this -


Private Sub Form_Load()
    Dim strProxyAddress
    Dim ProxyPortNumber
    Dim strPageText As String
   
    strProxyAddress = "XXXX.XXX.XX.XXX"
    ProxyPortNumber = "123"
   
    Inet1.Proxy = strProxyAddress & ":" & ProxyPortNumber
    Inet1.AccessType = icNamedProxy
   
    strPageText = Inet1.OpenURL("http://www.google.com")
    Do While Inet1.StillExecuting
        DoEvents
    Loop
    MsgBox strPageText
    End
End Sub



Please let me know if this works for you.

Dang123


0
 

Author Comment

by:RashmiRao1
ID: 9822658
No, the above code didn't work:-(
I am using CCProxy and my application fails to work on proxy server. I have given the IP address and port no correctly but still it fails. Probably I need to pass username and password. But how? Using ServerXmlHTTP I am able to pass username and password thru setproxycredentials(property) but session is not maintained. And my application needs session...
Any clues?????
0
 

Author Comment

by:RashmiRao1
ID: 10163310
Hi,
Since nobody has answered by question properly I request you to close this question. Also please refund my points as nobody has answered to my question properly.


Regards,
Rashmi
0
 

Accepted Solution

by:
amp072397 earned 0 total points
ID: 10618610
PAQed, with points refunded (90)

Thanks very much!
amp, ee admin, amp*at*experts-exchange.com
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question