Forum Stats

  • 3,816,034 Users
  • 2,259,132 Discussions
  • 7,893,366 Comments

Discussions

Can OSB handle malformed XML to peopleSoft

3251996
3251996 Member Posts: 10
edited Oct 14, 2016 5:31AM in SOA Suite Discusssions

Hi All,

we have a specific requirement to post a payload in the below format to peopleSoft listening connector. could any of you please confirm if this is possible with OSB/ SOA BPEL or any alternate way of integration:-

<?xml version="1.0" encoding="UTF-8"?>

<IBRequest>

  <ExternalOperationName>XYZ</ExternalOperationName>

     :

     :

     :

     <data>

<?xml version="1.0" encoding="UTF-8"?>

<MsgData>

  <Transaction>

:

:

:

</Transaction>

</MsgData>

</data

:

</IBRequest>

  we tried with CDATA..  but looking at alternate and better options...

thanks

Tagged:

Answers

  • Martien van den Akker
    Martien van den Akker Member Posts: 2,776 Bronze Crown
    edited Oct 14, 2016 5:31AM

    Hi,

    Is de '<?xml version="1.0" encoding="UTF-8"?>' prolog mandatory in within the data?

    The question to sort out is if PeopleSoft connector expects a encoded xml document in the data tag or a valid xml-node within the data tag.

    If the content in <data>...</data> needs to be valid XML then that prolog should be skipped. Then the message is a complete valid xml. And the Peoplesoft connector can select the data-content using xpath since it is parsed with the enveloping document.

    If Peoplesoft expects it as a encoded xml string then you can encoded it like

    <?xml version="1.0" encoding="UTF-8"?>  <MsgData>    <Transaction>  :  :  :  </Transaction>  </MsgData>

    See Free Online XML Escape Tool - FreeFormatter.com .

    For a parser this is exactly the same as enclosing it with CDATA. There's no difference. But xml-wise it's just a simple string content. So the Peoplesoft connector would have to unencode it  and then parse it to work with it.

    Normally I see constructions where the 'content' in a payload or 'data' is plain xml, so without the prolog. But if I see this: https://docs.oracle.com/cd/E41633_01/pt853pbh1/eng/pt/tiba/task_WorkingWiththeHTTPConnectors-fe7f1f.html then apparently the Peoplesoft connector expects something like:

    <?xml version="1.0"?> <IBRequest>     <From>         <RequestingNode>QE_UNDERDOG</RequestingNode>         <OrigTimeStamp>2003-09-29T00:37:30.790-0800</OrigTimeStamp>         <ExternalMessageID>UniqueId0006</ExternalMessageID>     /From>     <ExternalOperationName>QE_SYNC_MSG.VERSION_1</ExternalOperationName>     <OperationType>sync</OperationType>     <To>         <DestinationNode>QE_LOCAL</DestinationNode>     </To>     <ContentSections>         <ContentSection>             <Headers>             <version>VERSION_1</version>             </Headers>             <Data><![CDATA[<?xml version="1.0"?><QE_SYNC_MSG/>]]></Data>         </ContentSection>     </ContentSections> </IBRequest>

    With SOASuite (BPEL) you can use the 'ora:getContentAsString()' function to get an escaped string from an xml node.

    With OSB you can use the function 'fn-bea:serialize()' to do the same. I think that the output of the OSB function is a CDATA enclosed string. And ora:getContentAsString() gives you an encoded string. But both are handled the same in a parser.

    I think by the way that the XML prolog is optional in this case. But you'll have to try, and otherwise you could concatenate it to the encoded string.

    Regards,
    Martien

This discussion has been closed.