Solved

Problem using a web service

Posted on 2004-10-13
4
202 Views
Last Modified: 2008-02-01
Dear All,
I am calling a .net assembly from a JSP page. I am doing so as below :
<%
String url = "TestForURLParamVB.exe";
response.sendRedirect(url + "?sessionID=" + session.getId());
%>

I have a web service written for storing, retrieving and deleting some xml file based on the session ID passed to it. I extract the session id using domain.GetData("APP_LAUNCH_URL"). I have added a web reference in the project.
Till this point, there is no problem. But once I try to initialise the web service object as :
Dim ws As New hemant.SessionWSService
It gives me an error as mentioned at the bottom. I am not able to get why it is searching for a config file.

If I excute the .net code directly ( without calling it from a jsp ) after commenting out the getData call, it is working fine and the necessary XML file is getting created. But once I try to use the getData call, it again gives the same error.
Any guess what is wrong. Is there any way out for this. Please help me out as this is urgent. Thanks in advance.
Hemant

Code goes like this
------------------------------------------------------------------
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim domain As AppDomain
        Dim obj As Object
        Dim url, sessionID As String
        Dim index As Integer

        'Dim ws As New hemant.SessionWSService

        domain = domain.CurrentDomain
        obj = domain.GetData("APP_LAUNCH_URL")
        If (Not obj Is Nothing) Then
            MsgBox(obj, MsgBoxStyle.Exclamation, "Test")
        End If
        url = obj
        index = url.IndexOf("?")
        url = url.Substring(index + 1)
        index = url.IndexOf("=")
        sessionID = url.Substring(index + 1)
        MsgBox(" Session id is : " & sessionID)

        'Dim sessionInfo As SessionExchange.SessionInfo
        'MsgBox("b4 creating new sessioninfo ")
        'sessionInfo = New SessionExchange.SessionInfo
        'sessionInfo.sessionID = "dkfhjksadfkakljsdf"
        'sessionInfo.userName = "Hemant"
        'sessionInfo.accessRights = "8"
        'MsgBox("sessioninfo created. sessionInfo.sessionID = " + sessionInfo.sessionID)
        'MsgBox("b4 calling the setsession info method")
        'sessionExcgService.setSessionInfo(sessionInfo)

    End Sub
   
Error displayed is
--------------------------------------------------------------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Configuration.ConfigurationException: Error loading XML file http://localhost:8080/signapplet/TestForURLParamVB.exe?sessionID=12870915328F56B3A667EB035325372D.config There is an invalid character in the given encoding. Line 1, position 3. (http://localhost:8080/signapplet/TestForURLParamVB.exe?sessionID=12870915328F56B3A667EB035325372D.config)
   at System.Configuration.ConfigurationSettings.GetConfig(String sectionName)
   at System.Web.Services.Configuration.WebServicesConfiguration.get_Current()
   at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
   at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
   at TestForURLParamVB.hemant.SessionWSService..ctor()
   at TestForURLParamVB.Form1.Form1_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/winnt/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
System
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/winnt/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/winnt/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
RegexAssembly3_0
    Assembly Version: 0.0.0.0
    Win32 Version: n/a
    CodeBase:
----------------------------------------
IEExecRemote
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/winnt/assembly/gac/ieexecremote/1.0.5000.0__b03f5f7f11d50a3a/ieexecremote.dll
----------------------------------------
TestForURLParamVB
    Assembly Version: 1.0.1747.23273
    Win32 Version: n/a
    CodeBase: http://localhost:8080/signapplet/TestForURLParamVB.EXE
----------------------------------------
System.Windows.Forms
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/winnt/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System.Xml
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/winnt/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
System.Web.Services
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/winnt/assembly/gac/system.web.services/1.0.5000.0__b03f5f7f11d50a3a/system.web.services.dll
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 7.0.5000.0
    Win32 Version: 7.10.3052.4
    CodeBase: file:///c:/winnt/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
----------------------------------------
System.Web
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/winnt/assembly/gac/system.web/1.0.5000.0__b03f5f7f11d50a3a/system.web.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
0
Comment
Question by:hemant_visal
4 Comments
 
LVL 10

Expert Comment

by:Hans Langer
ID: 12297383
0
 

Author Comment

by:hemant_visal
ID: 12307116
Sorry if I haven't made it clear. I am not appending .config. The error is generated by .NET. Also I am not getting why it is trying to search for a .config file just after trying to instantiate an object of web service. I tried keeping  a .config file on the same location also. But still getting the same error. Also if I don't pass the session ID parameter, the application works fine. But as I need to send the session information to the .net exe, I have to either append it to the file name. Any work around will also help.

Experts, please help me out.
Hemant
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12664971
Closed, 250 points refunded.

modulo
Community Support Moderator
Experts Exchange
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

792 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