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());

About these ads

20 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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s