cancel
Showing results for 
Search instead for 
Did you mean: 

Incoming XML, ampersand is converted from & a m p ; to &

frank_lauerbach
Explorer
0 Kudos

Hello Experts,

we have problems receiving data.

A third-party-software is sending a request to our bsp-application.

This request contains XML-data.

The XML contains the sign &, but it is masked as "&amp ;" (I need the blank you can see it)

I checked the request with a proxy and the ampersand is really converted in "& a m p ;"

When receiving request in our bsp, we use this to get data

request->get_form_fields(

changing

fields = it_felder ).

Then we got all fields in the table, but "&amp ;" has been converted to "&".

It seems the ICM or ICF is converting it.

Does anybody know something about that.

Perhaps a ICM-parameter helps or something else.

Regards,

Frank

Edited by: Frank Lauerbach on Jul 21, 2010 12:26 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I must assume that the 3rd. party software sends the information in the URL. I do not know why this converion occurs but perhaps request->get_form_fields is not the correct method for reading the information. Try with:

data lclField type string.
  call method request->get_header_field
    Exporting 
       name = 'host'
    receiving 
       value = lclField.

   write:/10 lclField

another way is this one:

<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
  <htmlb:page title=" " >
    <br><br>
    <%
  Data lclFields type TIHTTPNVP.
  DATA waFields type ihttpnvp.
  CALL METHOD REQUEST->GET_HEADER_FIELDS
  CHANGING FIELDS = lclFields.
    %>
    <table>
    <%
  loop at lclfields into waFields.
    %>
    <tr>
     <td><%= waFields-Name%></td> <td><%= waFields-Value%></td>
    </tr>
    <%
  endloop.
    %>
    </table>
  </htmlb:page>
</htmlb:content>

you can then check whether the URL receives wrong information or whether SAP is doing the conversion.

frank_lauerbach
Explorer
0 Kudos

Hello,

I'm sorry, i forgot to write, they send it with an POST.

But I think I found the reason.

All characters <>? are converted.

SAP application server does not know which one was & a m p ;

Now I know the reason, but I do not have an solution.

Client sends data in this format:

POST /ids/login_ids.htm HTTP/1.1

Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, /

Accept-Language: de

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

Content-Type: application/x-www-form-urlencoded

Accept-Encoding: gzip, deflate

Proxy-Connection: Keep-Alive

Host: fisesales.fis-gmbh.de:8000

Pragma: no-cache

Content-Length: 2169

action=WKS&hookurl=http%3A%2F%2Fwebservice.test-online.de%2Fkwp_OCI%2FOCI_Return_2_UTF8%2FSHA_Return.aspx%3FKWPId%3D324%26GH%3D200002&kndnr=100&name_kunde=DEBUGFIS&pw_kunde=123%21&warenkorb=%3C%3Fxmlversion%3D%221.0%22%3F%3E%0D%0A%3CWarenkorbxmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance%22xmlns%3Axsd%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%22xmlns%3D%22http%3A%2F%2Fwww.itek.de%2FShop-Anbindung%2FWarenkorb%2F%22%3E%0D%0A+%3CWarenkorbInfo%3E%0D%0A++%3CDate%3E2010-07-22%3C%2FDate%3E%0D%0A++%3CTime%3E08%3A19%3A10.5310899%2B02%3A00%3C%2FTime%3E%0D%0A++%3CRueckgabeKZ%3EWarenkorbr%C3%BCckgabe%3C%2FRueckgabeKZ%3E%0D%0A++%3CVersion%3E1.01%3C%2FVersion%3E%0D%0A%3C%2FWarenkorbInfo%3E%0D%0A%3COrder%3E%0D%0A++%3COrderInfo%3E%0D%0A++++%3CInquiryNo%2F%3E%0D%0A+++++%3CPartNo%3EB09-0005%3C%2FPartNo%3E%0D%0A++++%3CModeOfShipment%3ELieferung%3C%2FModeOfShipment%3E%0D%0A++++%3CCur%3EEUR%3C%2FCur%3E%0D%0A++++%3CZusatzText%2F%3E%0D%0A+++++%3CKommission%3E-gggInformationssystemeGmbH%2CInnovativesSystemhausf%C3%BCrdasBauhandwe%2CKeple%3C%2FKommission%3E%0D%0A++%3C%2FOrderInfo%3E%0D%0A++%3CSupplierInfo%3E%0D%0A++++%3CIDNo%2F%3E%0D%0A+++%3C%2FSupplierInfo%3E%0D%0A++%3CCustomerInfo%3E%0D%0A++++%3CIDNo%3E10662%3C%2FIDNo%3E%0D%0A++%3C%2FCustomerInfo%3E%0D%0A++%3CDeliveryPlaceInfo%3E%0D%0A++++%3CIDNo%3ELAUERBACH1%3C%2FIDNo%3E%0D%0A++++%3CAddress%3E%0D%0A++++++%3CName1%3Etst%3C%2FName1%3E%0D%0A++++++%3CName2%2F%3E%0D%0A+++++++%3CStreet%3EMusterstrasse2%3C%2FStreet%3E%0D%0A+++++++%3CPCode%3E97506%3C%2FPCode%3E%0D%0A++++++%3CCity%3ETEST%3C%2FCity%3E%0D%0A++++%3C%2FAddress%3E%0D%0A++%3C%2FDeliveryPlaceInfo%3E%0D%0A++%3COrderItem%3E%0D%0A++++%3CRefItems%3E%0D%0A++++++%3CCustomer%3E3%3C%2FCustomer%3E%0D%0A++++%3C%2FRefItems%3E%0D%0A++++%3CArtNo%3E18535%3C%2FArtNo%3E%0D%0A++++%3CQty%3E1%3C%2FQty%3E%0D%0A++++%3CQU%3EPCE%3C%2FQU%3E%0D%0A++++%3CKurztext%3EGroheKappeblau%26graublau%3C%2FKurztext%3E%0D%0A+++++%3CLangtext%2F%3E%0D%0A+++++%3CHinweis%2F%3E%0D%0A+++%3C%2FOrderItem%3E%0D%0A+%3C%2FOrder%3E%0D%0A%3C%2FWarenkorb%3E

Edited by: Frank Lauerbach on Jul 22, 2010 8:23 AM

Edited by: Frank Lauerbach on Jul 22, 2010 8:29 AM

athavanraja
Active Contributor
0 Kudos

do you receive the xml by way of a bsp page attribute?

can you elaborate a bit about the bsp page which receives the xml (may be layout <form tag code and oninitialization code)

i do this kind of process a lot and never faced an issue.

Regards

Raja