cancel
Showing results for 
Search instead for 
Did you mean: 

Converting Servicelayer Error Message from JSON to XML B1if 2.0

felixhaupts
Discoverer
0 Kudos
113

I am having trouble when performing a Servicelayer Call in B1if 2.0. I want to make sure that I return errors while inserting a Document to the User via Message. The returned Data (returnDate) is in json Format. In order to continue working with it in B1if XSLT Transformations I need to translate it back to XML. I have found no method to do this.

Received Payload in the outbound from SL-Call

#############################################

<bfa:outbound>
<bfa:payload>
<httaError HTTPcode="404" HTTPmsg="Not Found">
<exceptionMsg>
com.sap.b1i.xcellerator.XcelleratorException: XCE212 Error while performing HTTP call; HTTP status is 404, Not Found
</exceptionMsg>
<returnData>
{ "error" : { "code" : -2028, "message" : { "lang" : "en-us", "value" : "Invalid BP code [ODLN.CardCode] , 'K-6161'" } } }
</returnData>
</httaError>
</bfa:payload>
<bfa:propertylist>
<bfa:property name="xcm.msgid" value="22111510482427682799C0A8B228BECD"/>
</bfa:propertylist>
</bfa:outbound>

######################################################

Expected Payload for the Node <returnData>:

####################################################
<error>
<code>-2028</code>
<message>
<lang>en-us</lang>
<value>Invalid BP code [ODLN.CardCode] , 'K-6161'</value>
</message>
</error>

########################################################

Accepted Solutions (0)

Answers (0)