Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

Problem using a web service

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
hemant_visal
Asked:
hemant_visal
1 Solution
 
Hans LangerCommented:
0
 
hemant_visalAuthor Commented:
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
 
moduloCommented:
Closed, 250 points refunded.

modulo
Community Support Moderator
Experts Exchange
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now