SOAP request error in IE

Posted on 2007-07-22
Last Modified: 2013-12-08
Hi Expert,

I have tried to use the following SOAP request in java applet viewer. It works fine.

      String url = "";
      URL HttpURL = new URL(url);
      conn = (HttpURLConnection)HttpURL.openConnection();

      conn.setDefaultUseCaches (false);

conn.setRequestProperty("POST", "/WsNew/recordingservice.asmx HTTP/1.1");
conn.setRequestProperty("Host", "");
conn.setRequestProperty("Content-Type", "text/xml; charset=\"utf-8\"");
conn.setRequestProperty("SOAPAction", "");

But when I try to run it in IE, it show the following error message:
java.lang.ClassCastException: com/ms/net/wininet/http/HttpURLConnection
      at com/pls/util/HttpConnectionTestTT.main
      at com/pls/util/WsNew.GetRecordID
      at com/pls/base/CallCenterApp$
      at java/lang/


Question by:johnnywong71
    LVL 10

    Expert Comment

    This is because MS uses its own Java VM and its own classes.
    While you had expected, it returned you com/ms/net/wininet/http/HttpURLConnection

    In the IE, goto Tools->Internet Options->Advanced and check the option to use Java VM.
    This might help
    LVL 1

    Author Comment

    Hi Expert,

    But I use Java VM, it will show the exception as below: access denied ( c:\javalog read)
          at Source)
          at Source)
          at java.lang.SecurityManager.checkPermission(Unknown Source)
          at java.lang.SecurityManager.checkRead(Unknown Source)
          at Source)
          at Source)
          at Source)

    Is this class is not work in latest java VM?


    LVL 10

    Accepted Solution

    Applet programs are not allowed to access the client machine's File system, that is the cause of your error.
    Probably u can try commenting that code and similar ones - accessing the file. It seems like you are using a normal Java standalone application in your applet.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Bada platform is becoming more and more famous this days and people talking about same. Some friends included those who have bada OS mobile asked me "what is bada?"and "what its features?". That encouraged me to research and write this article. [st…
    Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now