Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8950137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:23:01+00:00 2026-06-15T13:23:01+00:00

I have implemented a WS client in Java from an existing WSDL I got.

  • 0

I have implemented a WS client in Java from an existing WSDL I got.
I can connect, invoke WS methods and everything works great.
But….
I am supposed to use a Proxy for communication!!!

Already tried many ways to do that, but nothing works:

Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("host",Integer.parseInt("8008")));
URL url = new URL(theUrl);  

HttpURLConnection uc = (HttpURLConnection)url.openConnection(proxy);
uc.connect();

Or i tried

System.setPropertry(String, String)

So can set host and proxy and proxySet= true.

But according to colleagues this is not what I should do as it sets global properties and it will not work with many individual runs within out System.

Any ideas how I am supposed to do this?
Any help appreciated,
thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:23:02+00:00Added an answer on June 15, 2026 at 1:23 pm

    Eventually I used a class to extend java.net.ProxySelector let’s call it MyProxySelector.java
    And in the implemented select() method, I check the URI, if it is a URI I which to connect through a proxy, that is the Web service’s URI then I create a proxy:

    SocketAddress addr = new InetSocketAddress(theHost, thePort);
    proxy = new Proxy(Proxy.Type.HTTP, addr);
    

    add it to my proxy list:

    List<Proxy> proxyList = new ArrayList<Proxy>();
    proxyList.add(proxy);
    

    and return the proxy list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a chat program implemented in Java. The client can send lots of
I have successfully implemented this from android to a java httpservlet on google app
I have an existing Java client that I need to build a web service
I have to make a web service client from an wsdl file. I have
I have implemented this example into my application: https-clientserver-grizzly Here is Server.java from that
I have implemented Java Dynamic Project in Eclipse with Tomcat 7. I can run
I have Restful Web Service implemented by Jersey. I connect from Android via HTTP
I have implemented a web service with server and client authentication using keytool. The
I have developed a Flash application for a client (wedding RSVP) and implemented it
I have a buffered grid on which I've implemented a local sort function (client

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.