RE: WSE 3.0 errors in event log (may be MTOM related): The value may not be accessed in message stage 0.




Hi,

We've noticed some strange errors on our production servers running WSE
3.0. From the stack trace it seems it may be MTOM related. The following
two errors occur at the same time:

1. System.InvalidOperationException: The value may not be accessed in
message stage 0.
2. Server cannot clear headers after HTTP headers have been sent.

I'm guessing the first error is causing the second message. Does anyone
have any suggestions for trying to solve this?

I'll include the full event log details below.

Thanks,
Don

--
Don Rixtown
don[dot]rixtown[at]gmail[dot]com


-------- Error 1 --------

Event Type: Error
Event Source: Microsoft WSE 3.0
Event Category: None
Event ID: 0
Date: 2/22/2007
Time: 7:22:59 AM
User: N/A
Computer: MyServer
Description:
HTTP/ASMX Message Receive Failure: System.InvalidOperationException: The
value may not be accessed in message stage 0.
at System.Web.Services.Protocols.SoapMessage.EnsureStage
(SoapMessageStage stage)
at System.Web.Services.Protocols.SoapMessage.get_ContentType()
at Microsoft.Web.Services3.WseProtocol.CheckMtomContentType
(SoapServerMessage message)
at Microsoft.Web.Services3.WseProtocol.CreateRequestSoapEnvelope
(SoapServerMessage message)
at Microsoft.Web.Services3.WseProtocol.GetRequestEnvelopeFromMessage
(SoapServerMessage message)


-------- Error 2 -------- (technically this one is a warning)

Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1309
Date: 2/22/2007
Time: 7:22:59 AM
User: N/A
Computer: MyServer
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 2/22/2007 7:22:59 AM
Event time (UTC): 2/22/2007 1:22:59 PM
Event ID: 448bdf3298404c2a89a7583fb9861259
Event sequence: 19
Event occurrence: 4
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1/Root/MyService-1-128166233616977968
Trust level: Full
Application Virtual Path: /MyService
Application Path: d:\inetpub\wwwroot\MyService\
Machine name: MyServer

Process information:
Process ID: 3024
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
Exception type: HttpException
Exception message: Server cannot clear headers after HTTP headers
have been sent.

Request information:
Request URL: https://myurl
Request path: /myservice/myservice.asmx
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:
Thread ID: 1
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Web.HttpResponse.ClearHeaders()
at System.Web.Services.Protocols.SoapServerProtocol.WriteException
(Exception e, Stream outputStream)
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type
type, HttpContext context, HttpRequest request, HttpResponse response,
Boolean& abortProcessing)
at
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler
(Type type, HttpContext context, HttpRequest request, HttpResponse
response)



Check your maximum message size in the server's web.config file for your web service application.

You might need to add something like this in the <system.web> section:


<httpRuntime maxRequestLength="40960" executionTimeout="360" />

Note that the maxRequestLength value is in kilobytes.

Cheers,
Randall Krebs


BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
.



Relevant Pages

  • RE: WSE 3.0 errors in event log (may be MTOM related): The value may not be accessed in message stag
    ... Server cannot clear headers after HTTP headers have been sent. ... An unhandled exception has occurred. ... Thread account name: NT AUTHORITY\NETWORK SERVICE ... type, HttpContext context, HttpRequest request, HttpResponse response, ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • WSE 3.0 errors in event log (may be MTOM related): The value may not be accessed in message stage 0.
    ... Server cannot clear headers after HTTP headers have been sent. ... An unhandled exception has occurred. ... Thread account name: NT AUTHORITY\NETWORK SERVICE ... type, HttpContext context, HttpRequest request, HttpResponse response, ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: outlook mobile access broken
    ... then make sure that ASP is enabled on the server. ... the current web request. ... An unhandled exception has occurred. ... Thread account name: NT AUTHORITY\NETWORK SERVICE ...
    (microsoft.public.exchange.admin)
  • Re: outlook mobile access broken
    ... then make sure that ASP is enabled on the server. ... the current web request. ... An unhandled exception has occurred. ... Thread account name: NT AUTHORITY\NETWORK SERVICE ...
    (microsoft.public.exchange.admin)
  • RE: Backup & Monitoring not working!
    ... Error message in Windows Small Business Server 2003: ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ... An unhandled exception occurred during the execution of the ...
    (microsoft.public.windows.server.sbs)