cancel
Showing results for 
Search instead for 
Did you mean: 

HTML Tags in payload

anu_patyath
Explorer
0 Kudos

Hello Gurus,

   I have an ABAP proxy to SOAP Scenario over AAE.

In the Source structure I have a field where a description is being sent as data from ECC as below.

<Description>The responsibilities are listed below</I> <P> <B>RESPONSIBILITIES:</B> <UL> <LI>Operate machine with high manual work. <LI>Meet timelines of the company. <LI>Effectively plan and organize. <LI></UL> <P></Description>


When the data comes to PI over the SOAP(XI) adapter it is being displayed as below and send to target as below

<Description>The Responsibilities are listed below &lt;/I&gt; &lt;P&gt; &lt;B&gt;RESPONSIBILITIES:&lt;/B&gt; &lt;UL&gt; &lt;LI&gt;Operate machine with high manual workv &lt;LI&gt;Meet timelines of the Company. &lt;LI&gt;Effectively plan and organize  &lt;LI&gt;</Description>

Is there a way I can avoid this and send the data as received from the source by using adapter modules in communication channel?

Looking forward for an early reply.

Thanks and Regards

Anu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anu,

In the description above "<" is getting converted to &lt and ">" is getting converted to &gt.

This happens in XML.

This is because, in the above description certain tags which have ending do not have a begining, and few of those which have begining do not have ending.

For ex. : </l> does not have <l> as its start. Similarly <Ll> does not have ending </Ll>.

Please rectify these, then you will not get the undesired format.

Regards,

Souvik

anu_patyath
Explorer
0 Kudos

Hi Souik,

   Thanks for the reply.  I havent pasted the whole content .if you see <B> represents BOLD and <Ll> represents end of line or new line. So it is basically the formatting code that is going out to target. I dont have an option ton avoid these from Source or add something new. Is there any way in SAP PI communication channel logic to send data as it is received from Source?

stefan_grube
Active Contributor
0 Kudos

The code is sent as recived, it is just not displayed correctly in XI monitor, so you think you see the <B> tags, but in fact you have &lt;B&gt;

This is the only way to send HTML code within XML. This is correct and you should not try to change it. Otherwise you would have invalid XML and your message processing would fail.

anu_patyath
Explorer
0 Kudos

Hi Stefan,

    Thanks for the reply.

The issue is that when the data is displayed at the target it is appearing with &lt;&gt tags.

Thanks and Regards

Anu

stefan_grube
Active Contributor
0 Kudos

I don't know, what you mean by "when the data is displayed at the target".


Anyway, the receiving system has to deal with the incoming SOAP message and if there is anything wrong, fix it in receiving system, as inside PI everything is correct.

anu_patyath
Explorer
0 Kudos

Hi Stefan,

   I went into the Source ECC and target system to understand more on the issue. Let me explain the scenario a bit more.

ECC sends data through Standard ABAP Proxy in which the field <Description> has 9900 chars including the HTML tags like <B> <P> etc. Now when the data pass through SAP PI it becomes 10077 characters including the &lt;&gt; characters.

As the target system has a limitation of 10000 characters it is truncating last few characters because of the additional characters.

I am stuck and not sure what to do.

stefan_grube
Active Contributor
0 Kudos

The question here is, what exactly is the target system, who is reponsible for this and how could you influence the handling of the messages?

The processing of the XML should be like this: the sender creates XML and escapes the unallowed characters to ensure that the XML stays valid. The receiver extracts the content from XML and deescapes the characters to get get the original content.

When the reciever is not deescaping the content and causes trouble, then the issue has to be fixed there. There is nothing you can do in PI. Whatever you try to fix inside Pi will create an invalid XML and prevents message processing

I think you should discuss the topic with your project lead and project members. Maybe they need to understand the issue. People who are not familiar with XML standards often have a wrong understanding of XML handling in sender and receiver site.

RaghuVamseedhar
Active Contributor
0 Kudos

Anu,

<Description>Some <B>bold</B> text </Description> is not well formed XML.

<Description>Some &lt;B&gt;bold&lt;/B&gt; text </Description> is well formed XML.


If target system can handle not well formed XML. Use Java Mapping after graphical mapping to replace all &gt; with >, &lt; with < and &amp; with &.

anu_patyath
Explorer
0 Kudos

Thanks Stefan,

  Finally I have made the target team understand and show them a live demo on why this has to be handled at their end and not in PI.

PI was sending across all different html tags in the right format , but their target system(database at the backend) was treating each of these characters individually and using up the space.

This made the messages sent across from PI to be stored partially and later displayed on the front end partially.

Thanks to all others who provided their valuable comments.

Answers (0)