?
Solved

SOAP request error in IE

Posted on 2007-07-22
3
Medium Priority
?
402 Views
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 = "http://170.65.186.162/WsNew/recordingservice.asmx";
      URL HttpURL = new URL(url);
      conn = (HttpURLConnection)HttpURL.openConnection();

      conn.setDefaultUseCaches (false);
      conn.setUseCaches(false);
      conn.setDoInput(true);

conn.setRequestProperty("POST", "/WsNew/recordingservice.asmx HTTP/1.1");
conn.setRequestProperty("Host", "170.65.186.162");
conn.setRequestProperty("Content-Type", "text/xml; charset=\"utf-8\"");
conn.setRequestProperty("SOAPAction", "http://tempuri.org/GetRecordingID");
conn.setRequestMethod("POST");
....................................

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$1.run
      at java/lang/Thread.run

Thanks!

0
Comment
Question by:johnnywong71
  • 2
3 Comments
 
LVL 10

Expert Comment

by:Jaax
ID: 19545040
This is because MS uses its own Java VM and its own classes.
While you had expected java.net.HttpURLConnection, 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
0
 
LVL 1

Author Comment

by:johnnywong71
ID: 19545359
Hi Expert,

But I use Java VM, it will show the exception as below:

java.security.AccessControlException: access denied (java.io.FilePermission c:\javalog read)
      at java.security.AccessControlContext.checkPermission(Unknown Source)
      at java.security.AccessController.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkRead(Unknown Source)
      at java.io.File.exists(Unknown Source)
      at sun.applet.AppletPanel.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

Is this class is not work in latest java VM?

import java.io.*;

Thanks!
Frankie
0
 
LVL 10

Accepted Solution

by:
Jaax earned 1500 total points
ID: 19545530
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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month9 days, 20 hours left to enroll

571 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