• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 938
  • Last Modified:

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!
0
fungi8210
Asked:
fungi8210
  • 4
  • 3
1 Solution
 
objectsCommented:
If you want to bypass the proxy just don't specify a proxy.
Though not sure how it will work without going thru proxy.

If you want Java to use the proxy for all calls then this link shows you how:

http://www.javaworld.com/javaworld/javatips/jw-javatip42.html
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Why do you want to by pass the proxy BTW?
0
 
fungi8210Author Commented:
Because the proxy-based firewall is blocking my http request coming from inside the proxy server.
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
Mayank SAssociate Director - Product EngineeringCommented:
I'm not sure if it will work without it - do you have a direct connection?
0
 
fungi8210Author Commented:
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
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> 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"?
0
 
fungi8210Author Commented:
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.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Now that entirely changes the question....
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now