cancel
Showing results for 
Search instead for 
Did you mean: 

Read a C4C Survey in SAP CRM using Web Service Query Survey => Parsing the XML problem !

Suchita92
Participant
0 Kudos

Dear experts,

My scenario is as follows:

C4C connected to SAP CRM OnPremise system.

1) I need to query a completed survey from SAP C4C system into SAP CRM system to retrieve the answers submitted.

2) These answers then to be used in a CRM process.

For this, I thought to use the QuerySurveys web service which I will be calling from SAP CRM Program.

When checking this service in SOAP UI , I am not happy with the response as it has Binary XML representation.

See the picture below ->

I know CRM ABAP classes and functions that can convert an XML into Internal table.

However, I don't know how to parse this XMLRepresentation Binary Object so that I can read the data in ABAP.

Can anyone hint me ?

Also can someone please confirm if XML Representation Binary Object data means XSTRING ?

Many thanks in advance.

Regards

Suchita

View Entire Topic
former_member226
Employee
Employee
0 Kudos

Hi,

Can you please try reuse Library 'Binary'?

Binary.ToBase64String(bin);

Though I haven't used it but you can give it a try if it can resolve your issue?

Thanks

Saurabh

former_member226
Employee
Employee
0 Kudos

in addition to this can u please also check this thread;

https://archive.sap.com/discussions/thread/3914097

Thanks

Saurabh

Suchita92
Participant
0 Kudos

Many thanks Saurabh.

The problem is, I am receiving the response in SAP CRM - so I can't use C4C SDK library functions.

I just want to know what XML Binary Object technically is ? thank you for hinting that its base64Binary. I am looking for how do I convert it into normal XML or string/xstring formats so that I can covert it readable data in ABAP.

Regards

Suchita

former_member226
Employee
Employee
0 Kudos

Hi Suchita,

There are many ABAP class which can be used to play Base64 data but most common is

cl_http_utility.

Further details you can check with following links:

https://archive.sap.com/discussions/thread/375670

https://wiki.scn.sap.com/wiki/display/Snippets/Decoding+BASE64+in+ABAP

Thanks

Saurabh

Suchita92
Participant
0 Kudos

Thanks Saurabh.

After consuming the service using SOAMANAGER, I am automatically getting this strange response converted into XSTRING 🙂 Now XTRING to ABAP itab is very easy.

This is solved.

Many thanks for your time.