10 Replies Latest reply: Feb 24, 2013 9:24 AM by 989310 RSS

    OSB: Body variable is coming inside CDATA in the routed proxy

    989310
      Hi All,

      I have to send some data from one proxy (a.proxy) to another proxy (b.proxy) for sending email. For that , i am using Publish action in first proxy(a.proxy) ,which is using business service(b-ref.biz) which eventually calls another proxy(b.proxy) where i need the data from first proxy. For that ,i am replacing $body variable with desired data in a.proxy like $body is being replace by :

      <body>
      <emailRequest>
      <subject>emailXubject</subject>
      <content>emailContent</content>
      </emailRequest>
      </body>

      If i am checking this replacement in a.proxy, it is replacing $body variable perfectly fine.

      But when i am accessing $body variable in b.proxy, $body variable coming like this :

      <body>
      [[cdata]
      <soapenv-envlope>
      <body>

      <emailRequest>
      <subject>emailXubject</subject>
      <content>emailContent</content>
      </emailRequest>
      </body>
      <soapenv-envlope>
      ]</body>

      I am not sure why body is coming inside another body with CDATA tag.
      Please help me on this.
      Thanks in advance.

      Edited by: 986307 on Feb 5, 2013 10:45 AM
        • 1. Re: OSB: Body variable is coming inside CDATA in the routed proxy
          Anuj Dwivedi-Oracle
          What is the type of a.proxy, b.proxy and b-ref.biz?

          Seems like your business service or second proxy is expecting text content and hence the XML body is getting wrapped into CDATA. If this is the case then while replacing $body in first proxy, use function fn-bea:serialize(). For example, assign the desired content to a variable, say mailBody and replace the content of $body with fn-bea:serialize($mailBody). Then publish the data and second proxy should receive the message without CDATA.

          Regards,
          Anuj
          • 2. Re: OSB: Body variable is coming inside CDATA in the routed proxy
            989310
            Thanks Anuj ,
            Yes my second proxy b.proxy's request message type is text. But as per your suggestions,if i am replacing $body variable after fn-bea:serialize($mailbody), it is adding CDATA in $body even when it is still in a.proxy and CDATA is still coming in body in b.proxy. I searched about fn-bea:serialize .It changes from XML to string that means it should add CDATA ,not remove CDATA.

            Edited by: 986307 on Feb 5, 2013 9:23 PM
            • 3. Re: OSB: Body variable is coming inside CDATA in the routed proxy
              989310
              I changed b.proxy's request message type from text to xml.Now the data is coming as xml not contained inside CDATA. but still i am getting the format like below:

              <body>
              <envelope>
              <header>
              </header>
              <body>
              $emailContent
              </body>
              </envelope>
              </body>
              • 4. Re: OSB: Body variable is coming inside CDATA in the routed proxy
                Anuj Dwivedi-Oracle
                I searched about fn-bea:serialize .It changes from XML to string that means it should add CDATA ,not remove CDATA.
                No, it is not the case. You might be hitting a known bug where fn-bea:serialize adds CDATA if xml deeper than 3 level. You may get a fix for this issue from Oracle support by raising a SR.
                I changed b.proxy's request message type from text to xml.Now the data is coming as xml not contained inside CDATA. but still i am getting the format like below:
                It seems to be the assignment issue in the first proxy. Can you post the $body assignment expression here?

                Regards,
                Anuj
                • 5. Re: OSB: Body variable is coming inside CDATA in the routed proxy
                  989310
                  Replacement in a.proxy as below :

                  Replace [ node contents ] of [ . ]
                  .
                  in [ body ] with [ <emailContent>... ]
                  <emailContent>
                  <subject>Dynamic subject</subject>
                  <content>{$BenefectorEmailContent}</content>
                  <contentType>html</contentType>
                  <sourceSystem>niit</sourceSystem>
                  <recipientEmailID>{$getMemberContributorResponse/hit:return/hitxsd:email}</recipientEmailID>
                  <senderEmailID>ashish.kumar@niit-tech.com</senderEmailID>
                  </emailContent>

                  And the body in next proxy is as below:

                  <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                  <soapenv:Envelope><soapenv:Header xmlns:urn="urn:www.virginaustralia.com:service:partner:loyalty:MemberRelationshipMediatorMsg:v10">
                  <urn1:TransactionRequestHeader xmlns:urn1="urn:www.virginaustralia.com:schema:cdm:utility:Transaction:v10"><rc:RequestContext xmlns:rc="urn:www.virginaustralia.com:schema:cdm:utility:RequestContext:v10"><rc:OriginatingRequest><rc:InternalId>268232b6-cec6-42a5-87cf-f6a27bb37395</rc:InternalId><rc:ReceivedTimestamp>2013-02-06T15:30:10.442+05:30</rc:ReceivedTimestamp></rc:OriginatingRequest></rc:RequestContext></urn1:TransactionRequestHeader>
                  </soapenv:Header>
                  <soapenv:Body wsu:Id="Body-Ip5BHFcGt0yQmRNNmRztAA22" xmlns:urn="urn:www.virginaustralia.com:service:partner:loyalty:MemberRelationshipMediatorMsg:v10" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><emailContent><subject>Dynamic subject</subject><content><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

                  <html>
                  <body style="font-family:arial; font-size:12px">
                  Dear MR JACK,

                  <p>
                  We are pleased to confirm that your Family Pooling request has been approved.
                  </p>

                  <p>Kind Regards,
                  </p>

                  <p>Velocity Frequent Flyer Team</p>
                  </body>
                  </html>]]></content><contentType>html</contentType><sourceSystem>niit</sourceSystem><recipientEmailID><ax28:email xmlns:ns="http://hititcs.com" xmlns:ax28="http://hititcs.com/xsd" xmlns:ax23="http://io.java/xsd" xmlns:ax21="http://Common.UtilityPack/xsd" xmlns:ax22="http://rmi.java/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">ashish.kumar@niit-tech.com</ax28:email></recipientEmailID><senderEmailID>ashish.kumar@niit-tech.com</senderEmailID></emailContent>
                  </soapenv:Body>
                  </soapenv:Envelope>
                  </soapenv:Body>
                  • 6. Re: OSB: Body variable is coming inside CDATA in the routed proxy
                    868097
                    Hi,

                    Try to give replace entire node instead node contents.


                    Regards,
                    Deepak
                    • 7. Re: OSB: Body variable is coming inside CDATA in the routed proxy
                      989310
                      Tried but still the same issue. Body is coming inside another body with soap-enelope.
                      • 8. Re: OSB: Body variable is coming inside CDATA in the routed proxy
                        868097
                        what are you giving in the xpath? . or something else?
                        • 9. Re: OSB: Body variable is coming inside CDATA in the routed proxy
                          vladodias
                          986307 wrote:
                          Tried but still the same issue. Body is coming inside another body with soap-enelope.
                          That's probably because the contents of $BenefectorEmailContent have the whole envelope... Log the contents of $BenefectorEmailContent to check...
                          • 10. Re: OSB: Body variable is coming inside CDATA in the routed proxy
                            989310
                            This issue was due to type of second proxy.my second proxy was of messaging type. i changed it to wsdl based proxy and now $body is coming correctly. But why messaging type proxy itself enveloping body inside another body.