johnnywong71
asked on
SOAP request error in IE
Hi Expert,
I have tried to use the following SOAP request in java applet viewer. It works fine.
String url = "http://170.65.186.162/WsNew/recordingservice.asmx";
URL HttpURL = new URL(url);
conn = (HttpURLConnection)HttpURL .openConne ction();
conn.setDefaultUseCaches (false);
conn.setUseCaches(false);
conn.setDoInput(true);
conn.setRequestProperty("P OST", "/WsNew/recordingservice.a smx HTTP/1.1");
conn.setRequestProperty("H ost", "170.65.186.162");
conn.setRequestProperty("C ontent-Typ e", "text/xml; charset=\"utf-8\"");
conn.setRequestProperty("S OAPAction" , "http://tempuri.org/GetRecordingID");
conn.setRequestMethod("POS T");
.......................... ..........
But when I try to run it in IE, it show the following error message:
java.lang.ClassCastExcepti on: com/ms/net/wininet/http/Ht tpURLConne ction
at com/pls/util/HttpConnectio nTestTT.ma in
at com/pls/util/WsNew.GetReco rdID
at com/pls/base/CallCenterApp $1.run
at java/lang/Thread.run
Thanks!
I have tried to use the following SOAP request in java applet viewer. It works fine.
String url = "http://170.65.186.162/WsNew/recordingservice.asmx";
URL HttpURL = new URL(url);
conn = (HttpURLConnection)HttpURL
conn.setDefaultUseCaches (false);
conn.setUseCaches(false);
conn.setDoInput(true);
conn.setRequestProperty("P
conn.setRequestProperty("H
conn.setRequestProperty("C
conn.setRequestProperty("S
conn.setRequestMethod("POS
..........................
But when I try to run it in IE, it show the following error message:
java.lang.ClassCastExcepti
at com/pls/util/HttpConnectio
at com/pls/util/WsNew.GetReco
at com/pls/base/CallCenterApp
at java/lang/Thread.run
Thanks!
ASKER
Hi Expert,
But I use Java VM, it will show the exception as below:
java.security.AccessContro lException : access denied (java.io.FilePermission c:\javalog read)
at java.security.AccessContro lContext.c heckPermis sion(Unkno wn Source)
at java.security.AccessContro ller.check Permission (Unknown Source)
at java.lang.SecurityManager. checkPermi ssion(Unkn own Source)
at java.lang.SecurityManager. checkRead( Unknown Source)
at java.io.File.exists(Unknow n Source)
at sun.applet.AppletPanel.run (Unknown Source)
at java.lang.Thread.run(Unkno wn Source)
Is this class is not work in latest java VM?
import java.io.*;
Thanks!
Frankie
But I use Java VM, it will show the exception as below:
java.security.AccessContro
at java.security.AccessContro
at java.security.AccessContro
at java.lang.SecurityManager.
at java.lang.SecurityManager.
at java.io.File.exists(Unknow
at sun.applet.AppletPanel.run
at java.lang.Thread.run(Unkno
Is this class is not work in latest java VM?
import java.io.*;
Thanks!
Frankie
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
While you had expected java.net.HttpURLConnection
In the IE, goto Tools->Internet Options->Advanced and check the option to use Java VM.
This might help