cancel
Showing results for 
Search instead for 
Did you mean: 

Handling line breaks in SOAP response for address data

alancecchini
Participant
0 Kudos

Hi,

I have the following block of XML returned from a web service when tested using SOAP UI:

<roomaddress>1 Esther Court

Richardson Street

Room 2 Flat 01B

Newcastle upon Tyne

NE1 2AG</roomaddress>

The data is returned with line breaks which I would like to use to format the data in the onward processing (ABAP proxy).

I've defined the element <roomaddress> as type string but this shows the data in the following format (line breaks have been replaced with spaces) in SAP PI:

<roomaddress>FRR01A1 Esther Campbell Court Richardson Road Room 1 Flat 01A Newcastle upon Tyne NE2 4AG</roomaddress>

What must I do to retain the line breaks? - the documentation for this field states it is a multiline string but unfortunately the WSDL doesn't describe the data to the level of this field hence I'm unsure how to handle.

Thanks,

Alan

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member187339
Active Contributor
0 Kudos

Hi,

Try this

<roomaddress xml:spac = 'preserve'>

Regards

Suraj

alancecchini
Participant
0 Kudos

Hi,

Please indicate how to apply this to the WSDL file as per the following tag:

<xsd:element name="roomaddress" type="xsd:string" />

Thanks,

Alan

former_member187339
Active Contributor
0 Kudos

Hi,

Please try giving this:

<xs:attribute name="space" default="preserve">

<xs:simpleType>

<xs:restriction base="xs:NCName">

<xs:enumeration value="default"/>

<xs:enumeration value="preserve"/>

</xs:restriction>

</xs:simpleType>

</xs:attribute>

Regards

Suraj

Former Member
0 Kudos

Hi,

this is an example of hw line breaks are used and normalized by parsers. So I guess you need to adjust the WSDL or alternatively the XSD of your destination message type to use \n

Example:

<?xml version="1.0"?> \n

<Test> \n

<para xml:space="preserve">This is a \n

simple paragraph. What \n

do you think of it?</para> \n

</Test> \n

Cheers,

Kai