XML Replay: Difference between revisions

From DataFlex Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 5: Line 5:


  <MessageName>
  <MessageName>
   <ParameterName xmlns="http://myDomain/myURI">
   <ParameterName xmlns="<nowiki>http://myDomain/myURI</nowiki>">
     <Element1>Foo</Element1>
     <Element1>Foo</Element1>
     <Element2>Bar</Element2>
     <Element2>Bar</Element2>
Line 14: Line 14:
Instead of the correct:  
Instead of the correct:  


  <MessageName xmlns="http://myDomain/myURI">
  <MessageName xmlns="<nowiki>http://myDomain/myURI</nowiki>">
   <ParameterName>
   <ParameterName>
     <Element1>Foo</Element1>
     <Element1>Foo</Element1>

Revision as of 17:35, 5 November 2007

Replaying Logged XML

When attempting to diagnose problems which occur within web service environments, it is often useful to be able to re-run the XML which triggered the problem, so as to be able to step through it in the Visual DataFlex Studio debugger. The XML passed to a web service can be logged (see XML logging for details of how this can be done) and this historic data can then be used to "replay" the offending call and see what probably happened.

Assuming you have access to the original XML (see XML logging), this can then be saved into a text file - usually with the extension ".xml". If this has been logged using the mechanism suggested in the XML logging article, it may need to be slightly doctored before being sent for replay. This is because, for obscure reasons, the message namespace gets attached to the first child element of the message XML, instead of to the parent itself, thus:

<MessageName>
  <ParameterName xmlns="http://myDomain/myURI">
    <Element1>Foo</Element1>
    <Element2>Bar</Element2>
    <Element3>Etc.</Element3>
  </ParameterName>
</MessageName>

Instead of the correct:

<MessageName xmlns="http://myDomain/myURI">
  <ParameterName>
    <Element1>Foo</Element1>
    <Element2>Bar</Element2>
    <Element3>Etc.</Element3>
  </ParameterName>
</MessageName>