Solved

Problem using a web service

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

18 Experts available now in Live!

Get 1:1 Help Now