Topic
4 replies Latest Post - ‏2013-11-23T07:21:13Z by vishBrokerDP
vishBrokerDP
vishBrokerDP
103 Posts
ACCEPTED ANSWER

Pinned topic Non-xml to XML convertion issue

‏2013-11-07T16:03:29Z |

Hi,

I am having issue in converting non-xml to XML.

Scenario - DataPower  reads blob messange from MQ and converts it into SOAP.

DataPower - firmware 4.0.2

 

setup -

1. I read the non-xml response from queue.

2. I use binary transformation to convert non-xml to xml

3. FFD used is hexBinary.ffd

4. XSLT used is recursive convert function - to handle NULL values (from 0x00 to 0x1F are converted to space)

Both are suggested by Hermann in the forum. (attached here for ready reference).

http://www-01.ibm.com/support/docview.wss?uid=swg27019119&aid=1 - page#7

 

ISSUE - Suddenly started getting illegal character ' ' error.

1. I first convert the non-xml to xml (o/p context as OP) and then

2. in next transformation action read the OP context to create SOAP message. Here I copy the contents of wrapper in SOAP body.

I am getting this parsing error in 2nd transformation.

+++

2013-11-06T16:19:08-05:00 xxxxx.com [svcbus-prod][xmlparse][error] mpgw(XXXS): trans(541253970)[response][a.b.c.d]: illegal character ' ' at offset 247 of http://1.x.x.x:7xxx/ABCService/GetData

 

2013-11-06T16:19:08-05:00 xxxx.com [svcbus-prod][multistep][error] mpgw(XXXX): trans(541253970)[response][a.b.c.d]: response ABCPolicy_response_3 #4 xform: 'Transforming OP with local:///PrepareResponse.xsl results stored in OP1' failed: illegal character ' ' at offset 247 of http://1x.x.x:7xxx/ABCService/GetData

+++

Kindly help.

After converting non-xml into xml (under wrapper) - it is giving the error.

It is NULL value character  which is getting converted to space, I guess and then failing. Need help.

 

Thanks.

 

 

Updated on 2013-11-07T17:41:43Z at 2013-11-07T17:41:43Z by vishBrokerDP
  • HermannSW
    HermannSW
    3145 Posts
    ACCEPTED ANSWER

    Re: Non-xml to XML convertion issue

    ‏2013-11-08T08:30:35Z  in response to vishBrokerDP

    Hi,

    I tested the stylesheet+ffd you attached, and they do replace 0x00-0x1F control characters by spaces 0x20.

    In addition input (string) gets wrapped with <wrapper> element and prepended with XML declaration with ISO-8859-1 encoding.

    I cannot think what is wrong at offset 247 in your case.

    You need to inspect the context without modifications.

    • on response rule, just (temporarily) delete all actions after Transform Binary action
    • on request rule, just (temporarily) delete all actions after Transform Binary action, go against passthru loopback backend and have response type passthru

    Store the response and inspect with any tool allowing to do display binary data ("od -tcx1", "hexedit", ...).

    Please attach (not copy) an input that produces a bad output for investigation.


    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

    • vishBrokerDP
      vishBrokerDP
      103 Posts
      ACCEPTED ANSWER

      Re: Non-xml to XML convertion issue

      ‏2013-11-16T04:30:21Z  in response to HermannSW

      Hi Hermann,

      Thanks for reply.

      I captured the input and the issue is caused due to '&' symbol - (hex 26).

      Now, I looked at escapify.xsl that you have mentioned in this forum and tried to combine it with wrappBinaryWithNull.xslt

      But, I am missing something and not getting the desired result.

      Kindly suggest.

       

      Issue - Handling '&' symbol - The wrapBinarywithNull copies 0x26 as is; but as 0x26 is special character, next XSLT gives error saying invalid character.

      Need - Need to make sure the non-xml gets converted into XML. Null characters as well as specail characters should be handled.

      I tried to put when condition like below in wrapBinaryWithNull as below - but did not help.

      +++

      <xsl:when test="$char='26'">26616D703B</xsl:when> <!-- for apersand -->      <xsl:when test="$char='3C'">266C743B</xsl:when> <!-- for 'less than' char -->
      

      +++

      Kindly suggest.

      Thanks a lot in advance.

      (Attached both xslts for ready reference.)

      Updated on 2013-11-16T04:32:17Z at 2013-11-16T04:32:17Z by vishBrokerDP
  • vishBrokerDP
    vishBrokerDP
    103 Posts
    ACCEPTED ANSWER

    Re: Non-xml to XML convertion issue

    ‏2013-11-23T07:21:13Z  in response to vishBrokerDP

    Thanks Hermann ! Your are THE person. :)

    Thanks a lot. 

    I added all the 5 special chars and created xslt.(attached).

     

    Attachments