Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2006-05-25
8
Medium Priority
?
893 Views
Last Modified: 2008-02-26
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
Comment
Question by:fungi8210
  • 4
  • 3
8 Comments
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 16766998
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
 
LVL 30

Expert Comment

by:Mayank S
ID: 16767453
Why do you want to by pass the proxy BTW?
0
 

Author Comment

by:fungi8210
ID: 16768218
Because the proxy-based firewall is blocking my http request coming from inside the proxy server.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 30

Expert Comment

by:Mayank S
ID: 16768814
I'm not sure if it will work without it - do you have a direct connection?
0
 

Author Comment

by:fungi8210
ID: 16768925
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
 
LVL 30

Expert Comment

by:Mayank S
ID: 16768972
>> 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
 

Author Comment

by:fungi8210
ID: 16769012
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
 
LVL 30

Expert Comment

by:Mayank S
ID: 16769173
Now that entirely changes the question....
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month11 days, 6 hours left to enroll

572 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