none
< > in message

    Question

  • Hi,

       I am constructing one typed error message inside the orchestration and sending the message to a file folder.

    msgErrorMessage = dataAccess.GetConstructedErrorMessage(appName,errorDate,load,exceptionMessage,exceptionID);

    I am trying to get the error message by calling the above helperclass.

    I pass appName, errorDate,empty load, exceptionmessage,exceptionID to the method.  It returns me XMLDOc

    i have set the load element(error schema) ( type string) as the distinguish field.

    after getting the xmldoc from the above statement, i assign the message.load= inputstring ( i converted the input system.xml.xmldocument, to string )

     

    then i pass this message to a file folder

    I get the output with < and > as below

     

    <ns0:ProcessError xmlns:ns0="http://ErrorSchemas.ErrorMessage"><AppName>Inbound</AppName><ErrorDate>5/8/2010 8:47:05 PM</ErrorDate><Load>&lt;?xml version="1.0"?&gt;&lt;?ADF version="1.0.1"?&gt;&lt;adf&gt;
         &lt;prospect status="new"&gt;
                  &lt;manufacturercode&gt;F0823343 &lt;/manufacturercode&gt;
             &lt;stock&gt;33323 &lt;/stock&gt;
             &lt;weighting&gt;+99 &lt;/weighting&gt;
             &lt;price type="msrp" currency="USD"&gt;460.99 &lt;/price&gt;
           &lt;/option&gt;
           &lt;option&gt;
                  &lt;comments&gt;This is a request for a service appointment. &lt;/comments&gt;
         &lt;/customer&gt;
         &lt;vendor&gt;
          </Load><ExceptionMessage>The 'prospect' start tag on line 2 does not match the end tag of 'option'. Line 7, position 10.</ExceptionMessage><ExceptionID>1111</ExceptionID></ns0:ProcessError>

     

    how can i avoid getting &lt; and &gt; in the message.

     

    Thanks,

    -Prasad

     

    Sunday, May 09, 2010 1:57 AM

Answers

  • When you assign a string to an Xml element the Xml parser will automatically escape it. There is nothing you can do to change this.

    Your options are:
    1. create the entire message in your C# helper function.
    2. create an aggregate map to combine message and msgErrorMessage
    3. create a C# helper function to combine message and msgErrorMessage

     

     

    Sunday, May 09, 2010 3:14 AM

All replies

  • When you assign a string to an Xml element the Xml parser will automatically escape it. There is nothing you can do to change this.

    Your options are:
    1. create the entire message in your C# helper function.
    2. create an aggregate map to combine message and msgErrorMessage
    3. create a C# helper function to combine message and msgErrorMessage

     

     

    Sunday, May 09, 2010 3:14 AM
  • i want to created the entire message in the helper class. I was actually doing that.. 

    I was getting wellformed input xml and then i was sending that xml as xmldocument to the helper class and then constructing the error message from the app name, time, input xml, error description and event id.

    i was using xmldocument.loadxml() to return the resultant error message.

    But the problem was that i was getting untyped xml as input and sometimes the xml is not a wellformed xml.

    So if i use that non wellformed xml in the loadxml () function. I am getting error. So i decided to just pass the empty load element to the orchestration and then assign the non wellformed xml as string to it.

    how to construct the xml message in the helper class if the input xml is not a wellformed xml?

    Can u please let me know

    Thanks,

    -Prasad

    Sunday, May 09, 2010 6:42 AM