Solved

Problem using a web service

Posted on 2004-10-13
4
200 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

14 Experts available now in Live!

Get 1:1 Help Now