Bill Foust-DAI

I hate to sound like a whiney butt here. Unfortunately I've encountered an error that I just can't figure out. My previous post about losing the ambient transaction is, I think, incorrect and for some reason this particular service call loses or ignores the ambient transaction. I'm posting all the related code, but the server code is, I think, fine. I have generated this code for over 200 other services and many others are working properly. I have also generated a trace log and included the portion around the failure.

In a nutshell however, I get to a certain service call and it throws an exception saying "The service operation requires a transaction to be flowed." I'm well familiar with this error having seen it many times before I finally got things setup in the proper arrangement so that most of them started to work. I say most because this is obviously not working. As near as I can tell though, everything is setup right. the MSDTC console shows an active transaction. System.Transactions.Transaction.current has a real object whose state is "active". As I said, this code is generated code and used on over 200 other services - yet this one fails. Its enough to make me pull out the little hair I have left.

UPDATE: I just ran the code with setting to stop when an exception is thrown. This method throws an exception "The remote server returned an error: (500) Internal Server Error." Still researching, but it sounds bad.

Below is a dump of all of the relevant files I could think of. Server side code and config, client side config and the trace log.


<< TRACE FILE>>

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Information">0</SubType><Level>8</Level><TimeCreated SystemTime="2007-07-26T20:27:39.6078769Z" /><Source Name="System.ServiceModel.MessageLogging" /><Correlation ActivityID="{9f11e501-6a43-419a-b11c-18ab257c4c07}" /><Execution ProcessName="Main" ProcessID="4052" ThreadID="6" /><Channel/><Computer>ISA-DEV20</Computer></System><ApplicationData><TraceData><DataItem><MessageLogTraceRecord Time="2007-07-26T16:27:39.6078769-04:00" Source="ServiceLevelReceiveReply" Type="System.ServiceModel.Security.SecurityVerifiedMessage" xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace"><HttpResponse><StatusCode>InternalServerError</StatusCode><StatusDescription>Internal Server Error</StatusDescription><WebHeaders><MicrosoftOfficeWebServer>5.0_Pub</MicrosoftOfficeWebServer><Content-Length>5096</Content-Length><Cache-Control>private</Cache-Control><Content-Type>application/soap+xml; charset=utf-8</Content-Type><Date>Thu, 26 Jul 2007 20:27:39 GMT</Date><Server>Microsoft-IIS/6.0</Server><X-AspNet-Version>2.0.50727</X-AspNet-Version><X-Powered-By>ASP.NET</X-Powered-By></WebHeaders></HttpResponse><s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlnsTongue Tied="http://www.w3.org/2003/05/soap-envelope"><s:Header><a:Action s:mustUnderstand="1" u:Id="_2" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/transactions/fault</a:Action><oTongue Tiedecurity s:mustUnderstand="1" xmlnsSurprise="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><u:Timestamp u:Id="uuid-1353576e-b711-4288-8dac-5b6c21aa0851-43" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><u:Created>2007-07-26T20:27:39.109Z</u:Created><u:Expires>2007-07-26T20:32:39.109Z</u:Expires></u:Timestamp><cBig SmileerivedKeyToken u:Id="uuid-1353576e-b711-4288-8dac-5b6c21aa0851-41" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><oTongue TiedecurityTokenReference><o:Reference URI="urn:uuid:aea58f40-0153-4e08-a140-f0100caba467" ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/sct"></o:Reference></oTongue TiedecurityTokenReference><cSurpriseffset>0</cSurpriseffset><c:Length>24</c:Length><c:Nonce><!--Removed--></c:Nonce></cBig SmileerivedKeyToken><cBig SmileerivedKeyToken u:Id="uuid-1353576e-b711-4288-8dac-5b6c21aa0851-42" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><oTongue TiedecurityTokenReference><o:Reference URI="urn:uuid:aea58f40-0153-4e08-a140-f0100caba467" ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/sct"></o:Reference></oTongue TiedecurityTokenReference><c:Nonce><!--Removed--></c:Nonce></cBig SmileerivedKeyToken><e:ReferenceList xmlns:e="http://www.w3.org/2001/04/xmlenc#"><eBig SmileataReference URI="#_1"></eBig SmileataReference><eBig SmileataReference URI="#_3"></eBig SmileataReference></e:ReferenceList><e:EncryptedData Id="_3" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:e="http://www.w3.org/2001/04/xmlenc#"><e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"></e:EncryptionMethod><KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><oTongue TiedecurityTokenReference><o:Reference ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/dk" URI="#uuid-1353576e-b711-4288-8dac-5b6c21aa0851-42"></o:Reference></oTongue TiedecurityTokenReference></KeyInfo><e:CipherData><e:CipherValue>JUqmzWLf5/tBM3Nls4AxLd0OLBqqzYVhSg/Kj64nzR8x69yEN+Sc1D/kCReH49wLRpFRC3RKHUBDzlpAp5D3DWjJvVraqUUL3ndKIz+upSITITqvD6jwZdj20SAd9AuEHkvQMM3wjVEihu7jEbCNNzMDFONSo1xCs9KxcObRPAYo2SoG7UcghVNP1tnYZpmxKtjq56UtyOaVgQtqrhxwImKYOVXr92Lih/w9BMMr32JIyxpFLvxQAGykywk+WP7qgEEc6AyEam6Gpz2bQVBf5RtYAaWPUs1l6jpGU0JhI/QoMxQozF1Hrw9pNiTpIGEMp3Ba5qydOBrjtgLhKKEDXU6t3+3S4s63PMmAD7Ko54rC35QSO2LnWHWYyapmn68fmVmfL0h5ar8tEpZeXarFQgzsBGn3U4bez4gZ1XC6mY7TYptFxC2KPEcidLHTk0eSdZVw7LB7kv8iZEFobGZ4dqg7AnL2kLVCYtLXBmTD9O90dNLWey2adN6tR1GDmR2m9lbwK690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s9Mwd6u9Drza1MbVJIw2QyCWjq25Y7waylKFq4Jlat/fHa2PP9BgvUWd22MQRllGoh0i5CiyZpcQZ5NL3j7/v9v6ruOPUTjMrmweCWgWZflNwDUcYSdOsLesRXjSI4MoVwExZSUV1T6H2h8KZem6d3nzxqzrMhYUOwVchPjOxBVyQbAhE0+71R+vZy7pX8qWHfWZtNkiCWORkHLyRKTATaME9d4hmcCmHZX41wh</e:CipherValue></e:CipherData></e:EncryptedData></oTongue Tiedecurity></s:Header><s:Body u:Id="_0" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><Fault xmlns="http://www.w3.org/2003/05/soap-envelope"><Code><Value>Sender</Value><Subcode><Value xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/transactions">a:TransactionHeaderMissing</Value></Subcode></Code><Reason><Text xml:lang="en-US">The service operation requires a transaction to be flowed.</Text></Reason></Fault></s:Body></s:Envelope></MessageLogTraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131075</EventID><Type>3</Type><SubType Name="Warning">0</SubType><Level>4</Level><TimeCreated SystemTime="2007-07-26T20:27:39.6078769Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{9f11e501-6a43-419a-b11c-18ab257c4c07}" /><Execution ProcessName="Main" ProcessID="4052" ThreadID="6" /><Channel/><Computer>ISA-DEV20</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Warning"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier><Description>Throwing an exception.</Description><AppDomain>Main.exe</AppDomain><Exception><ExceptionType>System.ServiceModel.ProtocolException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The service operation requires a transaction to be flowed.</Message><StackTrace> at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp;amp; rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp;amp; msgData, Int32 type)
at CASE_CHARGES_Service_Ref.ICASE_CHARGES_Service.DVW_CCH_I_Update(DVW_CCH_I_UpdateRequest request)
at CASE_CHARGES_Service_Ref.CASE_CHARGES_ServiceClient.CASE_CHARGES_Service_Ref_ICASE_CHARGES_Service_DVW_CCH_I_Update(DVW_CCH_I_UpdateRequest request)
at CASE_CHARGES_Service_Ref.CASE_CHARGES_ServiceClient.DVW_CCH_I_Update(DataSet DS)
at DAI.JNet.CASE_CHARGES_Service.DVW_CCH_I_Update(DataSet DS)
at DAI.JNet.DVW_CCH_I_GroupField.Update()
at DAI.JNet.cls_JSAM004A.D7_ADD_CCH_Procedure()
at DAI.JNet.cls_JSAM004A.D0_ADD_BOOKING_Procedure()
at DAI.JNet.cls_JSAM004A.C0_PROCESS_4B_Procedure()
at DAI.JNet.cls_JSAM004A.A2_TRANSMIT_PNL_Procedure()
at DAI.JNet.cls_JSAM004A.A0_MAIN_PROC_Procedure()
at DAI.JNet.cls_JSAM004A.__Call_JSAM004A()
at DAI.JNet.cls_JSAM036A.CXX_CALL_AM004A_Procedure()
at DAI.JNet.cls_JSAM036A.C10_ADD_BOK_OUT_Procedure()
at DAI.JNet.cls_JSAM036A.B0_OPTION_Procedure()
at DAI.JNet.cls_JSAM036A._At000_MAIN_Procedure()
at DAI.JNet.cls_JSAM036A.__Call_JSAM036A()
at DAI.JNet.cls_JSRM910A.CALL_SUB_SYS_A_Procedure()
at DAI.JNet.cls_JSRM910A.CALL_SUB_SYS_Procedure()
at DAI.JNet.cls_JSRM910A.MAIN_Procedure()
at DAI.JNet.cls_JSRM910A.__Call_JSRM910A()
at DAI.JNet.MainScreen.DoProgramProcessing(Object stateInfo)
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)
</StackTrace><ExceptionString>System.ServiceModel.ProtocolException: The service operation requires a transaction to be flowed.</ExceptionString></Exception></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Transfer">0</SubType><Level>255</Level><TimeCreated SystemTime="2007-07-26T20:27:39.6235024Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{9f11e501-6a43-419a-b11c-18ab257c4c07}" RelatedActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="Main" ProcessID="4052" ThreadID="6" /><Channel/><Computer>ISA-DEV20</Computer></System><ApplicationData></ApplicationData></E2ETraceEvent>


<<CLIENT APP.CONFIG>>

<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_Service" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="08:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="true" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="12800000"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="12800000" />
<reliableSession ordered="true" inactivityTimeout="08:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>

<endpoint address="http://webpv02/JustisDotNetSvc1/CASE_CHARGES_Service.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_Service"
contract="CASE_CHARGES_Service_Ref.ICASE_CHARGES_Service"
name="WSHttpBinding_ICASE_CHARGES_Service">
<identity>
<servicePrincipalName value="host/webpv02" />
</identity>
</endpoint>

<<SERVER INTERFACE>>

<ServiceContract()> _
Public Interface ICASE_CHARGES_Service

<OperationContract()> _
<TransactionFlow(TransactionFlowOption.Mandatory)> _
Sub DVW_CCH_I_Update(ByVal DS As Dataset)
End Interface

<<SERVER IMPLEMENTATION>>

Public Class CASE_CHARGES_Service
Implements ICASE_CHARGES_Service

<OperationBehavior(TransactionScopeRequired:=True)> _
Public Sub DVW_CCH_I_Update(ByVal DS As Dataset) Implements ICASE_CHARGES_Service.DVW_CCH_I_Update
Dim specific_ds As New DVW_CCH_I()
specific_ds.Merge(DS)
Dim TblAdpt As New DVW_CCH_ITableAdapters.DVW_CCH_ITableAdapter()
TblAdpt.Update(specific_ds)
End Sub
End Class

<<SERVER WEB.CONFIG>>

<service name="CASE_CHARGES_Service" behaviorConfiguration="returnFaults">
<endpoint contract="ICASE_CHARGES_Service" binding="wsHttpBinding" bindingConfiguration="TransactionalHTTP" address=""/>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex"/>
</service>
<bindings>
<wsHttpBinding>
<binding name="TransactionalHTTP" transactionFlow="true"/>
</wsHttpBinding>
</bindings>



Re: Transactions Programming Transaction mysteriously disappearing (or not recognized)

Jesse - MSFT

Can you double check that the client making a call to this service is:

1) Loading up "WSHttpBinding_Service" from config

2) Is inside of a TransactionScope OR Transaction.Current is set before making the call over the client

Perhaps you can try regenerating your client if you haven't done that in a while in case. A message trace before the fault happens would be beneficial -- we should see a transaction header in the client's message -- if we do not then the issue is client side.





Re: Transactions Programming Transaction mysteriously disappearing (or not recognized)

Bill Foust-DAI

What kind of thing should I look for to see if there is a transaction header Is there a tool for viewing these log files It is very hard to view them and XML notepad doesn't seem to like it.

Bill





Re: Transactions Programming Transaction mysteriously disappearing (or not recognized)

Jesse - MSFT

Yes, please see: http://msdn2.microsoft.com/en-us/library/ms731055.aspx and search for "Service Trace Viewer Tool" (SvcTraceViewer.exe) -- it's a tool that will give you a much more friendly view of the e2e trace files.

Once you enable Message logging (also linked from the page above) you can view the xml in a friendly form from within SvcTraceViewer as well as the rest of the traces.