imkiosks
asked on
Web service method call yields a Soap exception
Hello all,
We have written a .net (c#) web service with several methods. A call to one of the methods from an external application (also written in c#.net) seemed to not be preocessed by the web service. We then, added fairly tight event logging to the web service, logging almost every line. The method itself creates an instance of an object with a default constructor. We have logging inside the method, before the object creation, after the object creation and inside the constructor itself. The only log message we were seeing was the one before the object creation. The code just seems to stop/disappear.
Totally baffled, we created a side small test application which only made that single call to the method in question. The error that was thrown up in our faces (from the JIT debugger) is listed below (sorry this is so long):
//------------------------ ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -------//
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Web.Services.Protoc ols.SoapEx ception: System.Web.Services.Protoc ols.SoapEx ception: Server was unable to process request. ---> System.Security.SecurityEx ception: Requested registry access is not allowed.
at Microsoft.Win32.RegistryKe y.OpenSubK ey(String name, Boolean writable)
at System.Diagnostics.EventLo g.CreateEv entSource( String source, String logName, String machineName, Boolean useMutex)
at System.Diagnostics.EventLo g.WriteEnt ry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnostics.EventLo g.WriteEnt ry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnostics.EventLo g.WriteEnt ry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category)
at System.Diagnostics.EventLo g.WriteEnt ry(String source, String message, EventLogEntryType type, Int32 eventID)
at System.Diagnostics.EventLo g.WriteEnt ry(String source, String message, EventLogEntryType type)
at IMK.AE.WS.IMK_AE_WS.SetKio skStatus(I nt32 kioskID, MessagePriority Priority, XmlDocument xmlMessage) in c:\develop.net\web solutions\iae\imk_ae_ws\im k_ae_ws.as mx.cs:line 109
--- End of inner exception stack trace ---
at System.Web.Services.Protoc ols.SoapHt tpClientPr otocol.Rea dResponse( SoapClient Message message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protoc ols.SoapHt tpClientPr otocol.Inv oke(String methodName, Object[] parameters)
at AandPQuickTest.localhost.I MK_AE_WS.S etKioskSta tus(Int32 kioskID, MessagePriority Priority, XmlNode xmlMessage) in C:\AandPQuickTest\Web References\localhost\Refer ence.cs:li ne 37
at AandPQuickTest.Form1.butto n1_Click(O bject sender, EventArgs e) in c:\aandpquicktest\form1.cs :line 136
at System.Windows.Forms.Contr ol.OnClick (EventArgs e)
at System.Windows.Forms.Butto n.OnClick( EventArgs e)
at System.Windows.Forms.Butto n.OnMouseU p(MouseEve ntArgs mevent)
at System.Windows.Forms.Contr ol.WmMouse Up(Message & m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Butto nBase.WndP roc(Messag e& m)
at System.Windows.Forms.Butto n.WndProc( Message& m)
at System.Windows.Forms.Contr olNativeWi ndow.OnMes sage(Messa ge& m)
at System.Windows.Forms.Contr olNativeWi ndow.WndPr oc(Message & m)
at System.Windows.Forms.Nativ eWindow.Ca llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/microso ft.net/fra mework/v1. 1.4322/msc orlib.dll
-------------------------- ---------- ----
AandPQuickTest
Assembly Version: 1.0.2321.22726
Win32 Version: 1.0.2321.22726
CodeBase: file:///C:/_Intermedia%20U pdates/Aan dPQuickTes t.exe
-------------------------- ---------- ----
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl y/gac/syst em.windows .forms/1.0 .5000.0__b 77a5c56193 4e089/syst em.windows .forms.dll
-------------------------- ---------- ----
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl y/gac/syst em/1.0.500 0.0__b77a5 c561934e08 9/system.d ll
-------------------------- ---------- ----
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl y/gac/syst em.drawing /1.0.5000. 0__b03f5f7 f11d50a3a/ system.dra wing.dll
-------------------------- ---------- ----
System.Web.Services
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl y/gac/syst em.web.ser vices/1.0. 5000.0__b0 3f5f7f11d5 0a3a/syste m.web.serv ices.dll
-------------------------- ---------- ----
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl y/gac/syst em.xml/1.0 .5000.0__b 77a5c56193 4e089/syst em.xml.dll
-------------------------- ---------- ----
fbuc_8z4
Assembly Version: 0.0.0.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl y/gac/syst em/1.0.500 0.0__b77a5 c561934e08 9/system.d ll
-------------------------- ---------- ----
System.Web
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl y/gac/syst em.web/1.0 .5000.0__b 03f5f7f11d 50a3a/syst em.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.
//------------------------ ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -------//
Also, to keep in mind: This works fine on our development machine (windows xp pro), but not on the client's machine (windows server 2003 R2) . {isn't that always the case: "it works on my machine...." lol}
I jest, but this is a serious project which is already at the client's site, and we have already lost 3 days trying to figure this one out.
Any help would be appreciated.
We have written a .net (c#) web service with several methods. A call to one of the methods from an external application (also written in c#.net) seemed to not be preocessed by the web service. We then, added fairly tight event logging to the web service, logging almost every line. The method itself creates an instance of an object with a default constructor. We have logging inside the method, before the object creation, after the object creation and inside the constructor itself. The only log message we were seeing was the one before the object creation. The code just seems to stop/disappear.
Totally baffled, we created a side small test application which only made that single call to the method in question. The error that was thrown up in our faces (from the JIT debugger) is listed below (sorry this is so long):
//------------------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Web.Services.Protoc
at Microsoft.Win32.RegistryKe
at System.Diagnostics.EventLo
at System.Diagnostics.EventLo
at System.Diagnostics.EventLo
at System.Diagnostics.EventLo
at System.Diagnostics.EventLo
at System.Diagnostics.EventLo
at IMK.AE.WS.IMK_AE_WS.SetKio
--- End of inner exception stack trace ---
at System.Web.Services.Protoc
at System.Web.Services.Protoc
at AandPQuickTest.localhost.I
at AandPQuickTest.Form1.butto
at System.Windows.Forms.Contr
at System.Windows.Forms.Butto
at System.Windows.Forms.Butto
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Butto
at System.Windows.Forms.Butto
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/microso
--------------------------
AandPQuickTest
Assembly Version: 1.0.2321.22726
Win32 Version: 1.0.2321.22726
CodeBase: file:///C:/_Intermedia%20U
--------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl
--------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl
--------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl
--------------------------
System.Web.Services
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl
--------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl
--------------------------
fbuc_8z4
Assembly Version: 0.0.0.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl
--------------------------
System.Web
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2300
CodeBase: file:///c:/windows/assembl
--------------------------
************** 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.
//------------------------
Also, to keep in mind: This works fine on our development machine (windows xp pro), but not on the client's machine (windows server 2003 R2) . {isn't that always the case: "it works on my machine...." lol}
I jest, but this is a serious project which is already at the client's site, and we have already lost 3 days trying to figure this one out.
Any help would be appreciated.
ASKER
mrichmon,
Without a doubt, the issue is security and access privileges - but which?? We have tried different approaches of adding ASP.net to the admin group, setting permissions on the web service in IIS, etc., but to no avail.
Without a doubt, the issue is security and access privileges - but which?? We have tried different approaches of adding ASP.net to the admin group, setting permissions on the web service in IIS, etc., but to no avail.
What registry settings are you trying to access? WHY are you having your application access/modify registry settings? That is what needs to be examined to determine what security issue is causing this.
ASKER
We have discovered that there was another instance of a slightly older DLL (which is being used by the web service. We think that the method call to the web service was working fine, but the CLR was getting confused as to which DLL to go to after the method call. To solve this, we simply reated a new dll with a different name. We needed to clean up some other things as well - so this was a good opportunity to create the new dll. Everything worked fine at that point.
The web service was NOT trying to access the registry. I think what was happening is that an attempt to log a message to the event log forced a check against the registry to make sure the web service was allowed to write to the event log. That's the part that blew up - the registry entry apperantly was not there.
We still have not completely figured out what the solution would have been to the original problem. Oh well, can't win 'em all........
The web service was NOT trying to access the registry. I think what was happening is that an attempt to log a message to the event log forced a check against the registry to make sure the web service was allowed to write to the event log. That's the part that blew up - the registry entry apperantly was not there.
We still have not completely figured out what the solution would have been to the original problem. Oh well, can't win 'em all........
It was trying to access the registry. Notice that the registry entry not being there caused the crash. It couldn't know that without accessing the registry.
But I am glad you have it working for now.
But I am glad you have it working for now.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I am betting permissions are different on thier machine - and that the difference is better security