Skip to content

Validation doesn´t work on fault response messages #17

@ola70

Description

@ola70

Hi,

I have tested the latest version and when Biztalk responds with a fault message the test runs as expected. My problem is when I try to make some validations of values in the fault message. It seems that the response is not interpreted as a valid xml document. In the attached test output below you can see that the response has some extra lines of characters and text in the beginning and end. I would appreciate if you could try this and see if you get the same problem. In BizTalk the message looks correctly.


                               S T A R T

Test: Test_SystemException started @ 13:23:45.555 19-12-2018 by Tester

Info: Adding context property: BizUnitTestCaseStartTime, value: 2018-12-19 13:23:45

Setup Stage: started @ 13:23:45.561 19-12-2018

Setup Stage: ended @ 13:23:45.563 19-12-2018

Execute Stage: started @ 13:23:45.563 19-12-2018
Info: Queuing concurrent step: TransMock.Integration.BizUnit.MockSolicitResponseStep for execution

Step: TransMock.Integration.BizUnit.MockSolicitResponseStep started c o n c u r r e n t l y @ 13:23:45.565 19-12-2018, failOnError = True

Data: Reading request content from path TestData\
Info: Waiting to read the response from the endpoint
Info: Reading the response from the endpoint

Data: The response received from the mocked endpoint is:

V���s���a�V�D
�\0??Xhttp://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher/fault�V�V?�V?�V?�?�s?�:?�ReceiverV?�V?�	

�aRhttp://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher?�a?�:?�InternalServiceFault��V?�V?���xml�lang?�sv-SE?
�<ns0:FaultEnvelope 

xmlns:ns0="http://schemas.microsoft.biztalk.practices.esb.com/exceptionhandling">
  <Application>Testapp</Application>
  <Description>There is no value associated with the property 'Test' in the message.</Description>
  <ErrorType>MissingPropertyException</ErrorType>
  <FailureCategory>BizTalk.Orchestration</FailureCategory>
  <FaultCode>GeneralException</FaultCode>
  <FaultDescription>Error description not available</FaultDescription>
  <FaultSeverity>2</FaultSeverity>
  <Scope>Construct Fault Message</Scope>
  <ServiceInstanceID>e4c29c2a-1f0a-4bde-91ca-32df28fb7eaa</ServiceInstanceID>
  <ServiceName>Testapp.Orchestrations.Test</ServiceName>
</ns0:FaultEnvelope>��V?�@�ExceptionDetail�;http://schemas.datacontract.org/2004/07/System.ServiceModel	�i)http://www.w3.org/2001/XMLSchema-

instance@�HelpLink.�nil?�@�InnerException.�nil?�@�Message?
�<ns0:FaultEnvelope xmlns:ns0="http://schemas.microsoft.biztalk.practices.esb.com/exceptionhandling">
  <Application>Testapp</Application>
  <Description>There is no value associated with the property 'Test' in the message.</Description>
  <ErrorType>MissingPropertyException</ErrorType>
  <FailureCategory>BizTalk.Orchestration</FailureCategory>
  <FaultCode>GeneralException</FaultCode>
  <FaultDescription>Error description not available</FaultDescription>
  <FaultSeverity>2</FaultSeverity>
  <Scope>Construct Fault Message</Scope>
  <ServiceInstanceID>e4c29c2a-1f0a-4bde-91ca-32df28fb7eaa</ServiceInstanceID>
  <ServiceName>Testapp.Orchestrations.GranskaDebitering</ServiceName>
</ns0:FaultEnvelope>�@
StackTrace?��   at Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkAsyncResult.End()
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkServiceInstance.EndOperation(IAsyncResult result)
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkServiceInstance.Microsoft.BizTalk.Adapter.Wcf.Runtime.ITwoWayAsync.EndTwoWayMethod(IAsyncResult result)
   at AsyncInvokeEndEndTwoWayMethod(Object , Object[] , IAsyncResult )
   at System.ServiceModel.Dispatcher.AsyncMethodInvoker.InvokeEnd(Object instance, Object[]& outputs, IAsyncResult result)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeEnd(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage7(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)�@�Type?:Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkNackException�����

Error: Exception caught!
System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XsdValidatingReader.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at BizUnit.TestSteps.ValidationSteps.Xml.XmlValidationStep.ValidateXmlInstance(Stream data, Context context)



Error: Exception caught!
BizUnit.Core.TestBuilder.ValidationStepExecutionException: Failed to validate document instance ---> System.Xml.XmlException: Data at the root level is invalid. Line

1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XsdValidatingReader.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at BizUnit.TestSteps.ValidationSteps.Xml.XmlValidationStep.ValidateXmlInstance(Stream data, Context context)
--- End of inner exception stack trace ---
at BizUnit.TestSteps.ValidationSteps.Xml.XmlValidationStep.ValidateXmlInstance(Stream data, Context context)
at BizUnit.TestSteps.ValidationSteps.Xml.XmlValidationStep.Execute(Stream data, Context context)
at TransMock.Integration.BizUnit.MockSolicitResponseStep.Execute(Context context)
at BizUnit.Core.Utilites.ConcurrentTestStepWrapper.Execute()


Step: TransMock.Integration.BizUnit.MockSolicitResponseStep ended @ 13:23:46.569 19-12-2018 with ERRORS, exception:

BizUnit.Core.TestBuilder.ValidationStepExecutionException


Error: Exception caught!
BizUnit.Core.TestBuilder.ValidationStepExecutionException: Failed to validate document instance ---> System.Xml.XmlException: Data at the root level is invalid. Line

1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XsdValidatingReader.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at BizUnit.TestSteps.ValidationSteps.Xml.XmlValidationStep.ValidateXmlInstance(Stream data, Context context)
--- End of inner exception stack trace ---
at BizUnit.Core.TestRunner.FlushConcurrentQueue(Boolean waitingToFinish, TestStage stage)
at BizUnit.Core.TestRunner.ExecuteSteps(IEnumerable`1 testSteps, TestStage stage)


Execution Stage: ended @ 13:23:46.570 19-12-2018 with ERROR's

Cleanup Stage: started @ 13:23:46.570 19-12-2018


Error: Exception caught!
BizUnit.Core.TestBuilder.ValidationStepExecutionException: Failed to validate document instance ---> System.Xml.XmlException: Data at the root level is invalid. Line

1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XsdValidatingReader.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at BizUnit.TestSteps.ValidationSteps.Xml.XmlValidationStep.ValidateXmlInstance(Stream data, Context context)
--- End of inner exception stack trace ---
at BizUnit.Core.TestRunner.FlushConcurrentQueue(Boolean waitingToFinish, TestStage stage)
at BizUnit.Core.TestRunner.ExecuteSteps(IEnumerable`1 testSteps, TestStage stage)


Cleanup Stage: ended @ 13:23:46.570 19-12-2018 with ERROR's

Debug Trace:
TransMock.Communication.NamedPipes.StreamingNamedPipeClient: Connect() called
TransMock.Communication.NamedPipe.StreamingNamedPipeServer: Connecting to named pipe server at: localhost//Test_ReceiveAddress
TransMock.Communication.NamedPipes.StreamingNamedPipeClient: WriteStream() called
TransMock.Communication.NamedPipes: WriteStream() succeeded. Message read by the server
TransMock.Communication.NamedPipes: WriteMessage() succeeded. Message read by the server
TransMock.Integration.BizUnit.MockSolicitResponseStep: Reading the response from the endpoint
TransMock.Communication.NamedPipes.StreamingNamedPipeClient: ReadMessage() called
TransMock.Communication.NamedPipes.StreamingNamedPipeClient: ReadStream() called
TransMock.Communication.NamedPipes.StreamingNamedPipeClient: ReadStream() succeeded
TransMock.Communication.NamedPipes.StreamingNamedPipeClient: Deserializing message from the pipe.
TransMock.Communication.NamedPipes.StreamingNamedPipeClient: ReadMessage() succeeded and returning data
TransMock.Communication.NamedPipes.StreamingNamedPipeClient: Disconnect() called
TransMock.Communication.NamedPipes.StreamingNamedPipeClient: Disconnect() succeeded
TransMock.Integration.BizUnit.MockSendStep: PipeClient closed

Originally posted by @ola70 in #16 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions