Using javax.net.ssl.HttpsUrlConnection in weblogic server


All,

When you deploy a Java Code using java.net.URL object in weblogic server, on opening a connection using URL object, instead of getting the standard javax.net.ssl.HttpsUrlConnection it will return weblogic.net.http.SOAPHttpsURLConnection

Even if you try to type cast it, you will get class cast exception as these 2 classes are not compatible. You may not like to use the weblogic.net.http.SOAPHttpsURLConnection class also as the method signature is different

To overcome the issue, a simple replacement of the code below would work

Instead of creating a URL object using standard constructor like

URL wsURL = new URL(wsLoc + “?command=login”);

Use

java.net.URL wsURL = new URL(null, wsLoc + “?command=login”,new sun.net.www.protocol.https.Handler());

21 thoughts on “Using javax.net.ssl.HttpsUrlConnection in weblogic server

  1. The above code does solve the ClassCastException problem in WebLogic. It helped me in a situation where I needed to make a thin web service client to connect to a Client cert authenticated SSL web service interface on WebLogic 9.2. The bad side is that if the System-wide SSL provider changes, the code will most likely break, since it is dependent on the SUN’s implementation.

  2. Pingback: web proxy|glype proxy|anonymous proxy|firewall proxy
  3. Pingback: host plus
  4. Howdy would you mind stating which blog platform you’re working with? I’m looking to start my own blog soon but I’m having a tough time selecting between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design seems different then most blogs and I’m looking for something completely unique.

    P.S Sorry for being off-topic but I had to ask!

  5. I was recomended this website by mу cousin. ӏ’m not
    sure wҺether tɦis post is written Ƅy him as no ߋne elsе
    кnow ѕuch detaqiled about mу trouble. Υou’гe amazing!
    Ƭhanks!

  6. I’m impressed, I muist ѕay. Rarely Ԁo Ӏ come ɑcross а blog that’s both equally educative andd іnteresting, and lеt me tеll you, yοu
    hаve hit the nail oon tɦe head. Ҭhe problem iѕ аn issue that
    not enough people aree speaking intelligently abօut. I am ѵery happy that Ι foսnd
    this in myy hunt for something relating to this.

  7. Your style is unique in comparison to other folks I have read stuff
    from. Thanks for posting when you have the opportunity, Guess I will just bookmark this blog.

  8. Thanks Venkatesan for this post it helped me to resolve my problem. I spent a day trying to resolve this problem.

    awesome fix.

Leave a reply to http://jerome.pheulpin.free.fr Cancel reply