on 04-17-2019 10:14 AM
Hello,
How can I set HTTP Status to 204 (No Content) or 400 (Bad Request)
I try it in XSL/JavaScript Transformation "PrepHttpResp"
<?bpc.pltype.out bpm.pltype=xml?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:b1e="urn:com.sap.b1i.sim:b1event" xmlns:b1ie="urn:com.sap.b1i.sim:b1ievent" xmlns:b1im="urn:com.sap.b1i.sim:b1imessage" xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms" xmlns:exslt="http://exslt.org/common" xmlns:jdbc="urn:com.sap.b1i.adapter:jdbcadapter" xmlns:js="com.sap.b1i.bpc_tools.Javascript" xmlns:rev="urn:com.sap.b1i.adapter:revaadapter" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:sim="urn:com.sap.b1i.sim:entity" xmlns:utils="com.sap.b1i.bpc_tools.Utilities" xmlns:vpf="urn:com.sap.b1i.vplatform:entity" xmlns:xca="urn:com.sap.b1i.xcellerator:appconfig" xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc" version="1.0" exclude-result-prefixes="b1e b1ie b1im bfa jdbc js rfc utils xci xca vpf exslt sim rev" b1e:force="" b1ie:force="" b1im:force="" bfa:force="" jdbc:force="" js:force="" rfc:force="" utils:force="" xci:force="" xca:force="" vpf:force="" exslt:force="" sim:force="" rev:force="">
<?prodver 1.0.0?>
<xsl:include href="../../com.sap.b1i.dev.repository/IDE/init.xsl"/>
<xsl:template match="/">
<bfa:io pltype="json" http-status="204" />
</xsl:template>
</xsl:stylesheet>
But I always get 200 OK in Postman.
Hello tomas.homola!!
I'm facing same situation...Did you get something?!
Best Regards,
Leo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Leo
I'm able only set the HTTP status but not the error response content 😞
I've created improvement request for this: B1IF 2.0 Send custom error content for HTTP Status 400
So you can vote for this.
Tomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Huan Yang
Thanks for answer.
So I can read the http status from output payload
<bfa:io http-status="400">
<bfa:object>
<bfa:string name="Result">Some error</bfa:string>
</bfa:object>
</bfa:io>
So if I set HTTP Status 400 then this response content cannot be modified?
<html><head><meta http-equiv="Content-Type"
content="text/html; charset=UTF-8"/><title>SAP B1iP
Error</title></head><body><p><h2>SAP B1iP
detected an error:</h2></p><p><font
size="3"><b>Emitted HTTP-Code:</b><br/>400 - Bad
Request</font></p><p><font
size="3"><b>Internal
Reason:</b><pre>�����������V
J-.�)Q�R
����/�S�������</pre></font></p><p><font
size="3"><b>Recommendation:</b><br/>Check for the
correctness of your activity or environment or ask your
system-administrator for further
help.</font></p><hr/><font
size="2"><b>tid</b></font><font
size="3"><pre>TID:
19042212470011082931C0A8157D0FD0</pre></font></p><hr/><font
size="2"><b>Full Internal Error
Message:</b></font><font
size="3"><pre>�����������V
J-.�)Q�R
����/�S�������</pre></font><p><hr/><font
size="2"><b>Log-ID:</b></font><font
size="3"><pre>LID19042212470011083129C0A8157D5824</pre></font></p></body></html>
I would like send my error description in JSON format.
Hello Tomas,
It's not supported.
Thanks & best regards
Huan Yang
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.