Link to home
Start Free TrialLog in
Avatar of fungi8210
fungi8210

asked on

Parse xml through proxy using javax.xml.parsers.DocumentBuilder

Hi Experts,
    I am developing my application behind a proxy server, so for every http request i sent, i have to do something with it.
For example, i am using httpunit to send a http request.
In order to do that, i need to call
public void setProxyServer(java.lang.String proxyHost,
                           int proxyPort,
                           java.lang.String userName,
                           java.lang.String password)
before sending out http requests, with my account details of course.

My problem now is, i am trying to parse a xml file by using
javax.xml.parsers.DocumentBuilder.parse(String uri)

since the http request is hid inside this parse(String uri) method, how do i bypass the proxy server?

thanks!
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Why do you want to by pass the proxy BTW?
Avatar of fungi8210
fungi8210

ASKER

Because the proxy-based firewall is blocking my http request coming from inside the proxy server.
I'm not sure if it will work without it - do you have a direct connection?
mayankeagle, i am behind the proxy server, which means when i send a http request, i then need to provide my user name and password.
the url provided by "objects" worked fine, thanks
>> i then need to provide my user name and password.

That is understood, but objects link is about using the proxy for all sockets, which is also understood. So where exactly is "bypassing the proxy"?
sorry mayankeagle, it was my fault for using the wrong word.
I guess bypass is not the word to use, what I wanted to do is send a http request
through the proxy, and not bypassing it.
Now that entirely changes the question....