Error : The trace file did not contain any usable data. Please make sure that LogMessagesAtServiceLevel and LogEntireMessage are set

Mar 23, 2009 at 4:21 PM
Hi,
I installed the latest drop of march and while generating the unit test i am getting the following error "The trace file did not contain any usable data. Please make sure that LogMessagesAtServiceLevel and LogEntireMessage are set"

I have followed the Usage guide and MY WCF is hosted as console App.

Regards,
Nishant
Coordinator
Mar 23, 2009 at 10:12 PM
The only thing that I can think of is that if you collected the trace on the service side you need to make sure you tell the wizard (or the command line app) that it is a service-side trace. If you are still having problems contact me via the People page, but in that case please be prepared to send me the trace file and all the files you need to reproduce the problem using the command line tool.

Regards

Rob
Jul 16, 2009 at 7:05 PM

I had the same issue for services with only one way operations.

Coordinator
Jul 17, 2009 at 8:07 AM

The tool does not currently work with OneWay operations (on the list to fix). Please try the following workaround. Generate the message log file but before processing it with the tool make the following global substitution: replace "ServiceLevelSendDatagram" with "ServiceLevelSendRequest". This should allow the tool to work as normal.

Feb 21, 2010 at 12:10 PM

Hi Rob,

Does the workaround you mentioned allow for the temporary testing of OneWay contracts?

I.e. - If we make the global string replacement of "ServiceLevelSendDatagram" with "ServiceLevelSendRequest" in the message log file, does this change the OneWay back to "false"? Or does it keep the operation as OneWay and allow us to test it?

Thanks,

Dave

Coordinator
Feb 22, 2010 at 9:42 AM

I would expect this to work, although I have not actually tried this.

Regards

Rob

Feb 22, 2010 at 9:59 AM

Ok.

I'm doing extensive WCF load testing using this tool. This is pretty awesome btw.

Seems like if I make the string replacement in the message log file, then the tool works as normal with OneWay operations set as "true". I'll continue to test this and let you know the results here.

Thanks.

Dave

Mar 11, 2010 at 3:49 PM

Hello All,

I have been experimenting some time with the WCF Test Tool and keep noticing weird things which I do not understand.

1) First of all, I have the WCF configuration tool from inside VS2008 to define some WCF log/trace settings in my projects App.config file. I specify a path for log and the trace files in ie C:\temp\ (Everyone has write permission). However, everytime when I run the WCF client to generate a log, the client WCF applications config file is changed and contains routes which are completely different then the onse in the App.config of my test project, the real routes used are something like C:\Documents and Settings\{username}\Local Settings\Temp\tmp9F78.tmp. It seems the settings in the App.config of my current test project are not being used when generating a trace using the WCF client application.

2) In the final step of creating a new WCF test, after selecting the assemblies, I alwys receive the error "The trace file did not contain any usable data. Please make sure that LogMessagesAtServiceLevel and LogEntireMessage are set". These settings are correct in my App.config (but looking under my first point, maybe these settings are not correctly applied).

No idea what to check further, anyone has an idea?

Thanks,
Jaco

 

Coordinator
Mar 11, 2010 at 5:17 PM

I am assuming your client is some sort of simple exe. May I suggest that you try running the app by executing it from a command prompt, first making sure that the actual .exe.config file in the directory containing the exe contains what you want? As you suggest, I think it is quite likely that point 2 is caused by the problem in point 1.

Regards

Rob

Mar 12, 2010 at 9:33 AM
Edited Mar 12, 2010 at 10:47 AM

Rob, thanks for the suggestion. I finally got my message lox generated, what I did was copy the sections of the generated App.config file into my WCF client app configuration and after that, when executing the client .exe, I got a messages log whic contains many XML elements like:

<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="2010-03-12T09:22:10.0211096Z" /><Source Name="System.ServiceModel.MessageLogging" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="Indonet" ProcessID="1324" ThreadID="4" /><Channel/><Computer>WXPBDARIERAPO</Computer></System><ApplicationData><TraceData><DataItem><MessageLogTraceRecord Time="2010-03-12T10:22:10.0054848+01:00" Source="ServiceLevelSendRequest" Type="System.ServiceModel.Channels.BodyWriterMessage" xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace"><s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header><a:Action s:mustUnderstand="1">http://tempuri.org/IwcfAutenticacion/Execute</a:Action><a:MessageID>urn:uuid:b2a33a2e-2479-444c-8c1e-5c5c4a6928e0</a:MessageID><ActivityId CorrelationId="6398d002-adab-4f17-a5d1-f12f4bd2ccba" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">00000000-0000-0000-0000-000000000000</ActivityId><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo></s:Header><s:Body><Execute xmlns="http://tempuri.org/"><sClienteSAP>10000</sClienteSAP><sPasswordSAP>xxx</sPasswordSAP><CodigoRetorno>0</CodigoRetorno><MensajeErrorSAP></MensajeErrorSAP></Execute></s:Body></s:Envelope></MessageLogTraceRecord></DataItem></TraceData><System.Diagnostics xmlns="http://schemas.microsoft.com/2004/08/System.Diagnostics"><LogicalOperationStack></LogicalOperationStack><Timestamp>728286391089131</Timestamp></System.Diagnostics></ApplicationData></E2ETraceEvent>

However, still the test generation wizard gives me the same error "The trace file did not contain any usable data. Please make sure that LogMessagesAtServiceLevel and LogEntireMessage are set". How does the test generator read the messages file to find usable data, is something wrong with the messages XML file I have generated? Is there a (visual) way to inspect this?

Thanks,
Jaco

Coordinator
Mar 12, 2010 at 9:47 AM

That looks like a client-side trace, did you tell the wizard it was a service-side trace by any chance?

Mar 12, 2010 at 9:56 AM
Edited Mar 12, 2010 at 9:56 AM

Hi Rob, I indicated the radio next to client-side trace in the tool, so that could not be the issue.. Would there be another way to determine if the trace contains "usable data", how could I verify this, what check does the tool use to determine this?

 

Coordinator
Mar 12, 2010 at 10:24 AM

Take a look in the source at the Parser class. To see a bit more information you could run the command line version of the tool, that will list each logged message and tell you if it has been included or excluded.

Mar 12, 2010 at 11:28 AM
Edited Mar 12, 2010 at 11:29 AM

Hi Rob,

I used the command line tool, and this is working to some extent, the messages.xml file is read and processed.
However, it seems we are missing attributes on our classes or properties, because the tool exits logs an error of type:

WCF Load Test Generator Version 3.0.0.0
Parsed message with action http://tempuri.org/IwcfAutenticacion/Execute [OK]
Parsed message with action http://tempuri.org/IwcfRecuperarAreaVenta/Execute [OK]
Data or message contract attribute expected on type Indo.Indonet9.ClassLibraryIndonet.EntidadesIndonet.clsClienteAreaVenta

Do we need to define extra attributes in our classes? What attrs do we need to define, [DataMember], or other stuff?

Thanks,
Jaco

 

Coordinator
Mar 12, 2010 at 11:39 AM

Looks like there might be a bug in the Wizard that ignores the error logged by the command line tool. Yes you do need to define the contract attributes like DataMember and DataContract on your contract types.

Regards

Rob

Mar 12, 2010 at 1:27 PM

All my classes that must be serialized are now tagged with <DataContract()> and all public get/set properties have a <DataMember()> attribute, like:


<DataMember()> _
        Public Property DIAS_PTE_VL() As Integer
            Get
                Return _DIAS_PTE_VL
            End Get
            Set(ByVal value As Integer)
                _DIAS_PTE_VL = value
                OnPropertyChanged("DIAS_PTE_VL")
            End Set
        End Property

However, now the wcfunit exe returns another error when executing. It seems this has to do with the fact that many properties fire an OnPropertyChanged event when a property changes. The following error appears in the log:

Unhandled Exception: System.Runtime.Serialization.SerializationException: 'Eleme
nt' 'DIAS_PTE_VL' from namespace 'http://schemas.datacontract.org/2004/07/Indo.I
ndonet9.ClassLibraryIndonet.Estructuras' is not expected. Expecting element 'Pro
pertyChangedEvent'.
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ThrowRequiredM
emberMissingException(XmlReaderDelegator xmlReader, Int32 memberIndex, Int32 req
uiredIndex, XmlDictionaryString[] memberNames)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.GetMemberIndex
WithRequiredMembers(XmlReaderDelegator xmlReader, XmlDictionaryString[] memberNa
mes, XmlDictionaryString[] memberNamespaces, Int32 memberIndex, Int32 requiredIn
dex, ExtensionDataObject extensionData)
   at ReadclsZZDETITCLI_NET9FromXml(XmlReaderDelegator , XmlObjectSerializerRead
Context , XmlDictionaryString[] , XmlDictionaryString[] )
   at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDeleg
ator xmlReader, XmlObjectSerializerReadContext context)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContra
ctValue(DataContract dataContract, XmlReaderDelegator reader)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeseri
alize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContr
act)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeseri
alize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHand
le, String name, String ns)
   at ReadclsClienteDatosFromXml(XmlReaderDelegator , XmlObjectSerializerReadCon
text , XmlDictionaryString[] , XmlDictionaryString[] )
   at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDeleg
ator xmlReader, XmlObjectSerializerReadContext context)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContra
ctValue(DataContract dataContract, XmlReaderDelegator reader)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeseri
alize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContr
act)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeseri
alize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract
, String name, String ns)
   at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(Xml
ReaderDelegator xmlReader, Boolean verifyObjectName)
   at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleException
s(XmlReaderDelegator reader, Boolean verifyObjectName)
   at System.Runtime.Serialization.DataContractSerializer.ReadObject(XmlDictiona
ryReader reader, Boolean verifyObjectName)
   at Microsoft.WcfUnit.Library.Deserializer.DeserializeDataContractInputParamet
ers(MessageBuffer messageBuffer, String proxyNamespace, ParameterInfo[] paramete
rs, IList`1 serviceKnownTypes)
   at Microsoft.WcfUnit.Library.Deserializer.DeserializeInputParameters(MessageB
uffer messageBuffer, MethodBase contractMethod)
   at Microsoft.WcfUnit.Library.TraceFileProcessor.ProcessTraceFile(String scena
rioName, String traceFileName, Stream timedCommentsFile, WcfUnitConfiguration co
nfiguration, String mainFileName, String stubFileName)
   at Microsoft.WcfUnit.Library.TraceFileProcessor.ProcessTraceFile(String scena
rioName, String traceFile, Stream timedCommentsFile, WcfUnitConfiguration config
uration)
   at Microsoft.WcfUnit.Program.Main(String[] args)

Can I not have class properties that fire an onpropertychanged event? This is quite common in WCF classes I thought?

Any ideas?

Coordinator
Mar 12, 2010 at 1:51 PM

I would have thought it unusual to have much if any actual code in data contracts. That said I am not sure why you are getting this exception. How is the event itself declared? If it is not a big class perhaps you could post the code for it?

Mar 12, 2010 at 2:06 PM

Hi Rob,

I am not sure either if the DTO classes should contain any code and should be firing PropertyChanged events, I have little experience in WPF/WCF.
However, from what I have seen the PropertyChanged events are fired all over the place in many properties, I guess it has to do with letting the WPF view know about a change in the data so it is reflected in the View?

Anyway, I found some information about serializing event handlers and about how to use WCF's NetDataContractSerializer. I feel I am getting into trouble more and more.....

Gr,
Jaco

Coordinator
Mar 12, 2010 at 2:39 PM

The tool does not support the NetDataContractSerializer unfortunately. I am not sure what will happen if you try.

Mar 12, 2010 at 2:59 PM

Hi,

Sorry for late reply to this thread but i was able to solve this issue in my case .

Issue that i found while debugging was there was no proper exception raised while log file is parsed,  in my case there were some dependency binaries which were required and were not installed in gac/machine.So while debugging i found those binaries and i installed these binaries.

Once these dependent binaries are supplied every thing worked like a charm :) . I was abe to fix this the hard :( way the debugging way.

Jul 20, 2011 at 3:16 PM

Hi,

Can you tell me if these binaries are belong to the Visual Studio or your tested application?

Thanks,

Ronen