微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

SAP服务层:$ Batch请求错误,带有事务通知

如何解决SAP服务层:$ Batch请求错误,带有事务通知

我正在使用树汁服务层,我想通过$ batch请求创建新的交货单。我的请求正文是:

--Batch_Header
Content-Type: multipart/mixed;boundary=Batch_Body


--Batch_Body
Content-Type: application/http 
Content-transfer-encoding:binary
Content-ID: 1


POST /b1s/v1/DeliveryNotes
Content-Type: application/json


<Json format Content>


--Batch_Body--
--Batch_Header--

在我为DeliveryNotes创建通知(编辑存储过程SBO_SP_TransactionNotification)时,它是完美的,就像这样:

AlTER PROCEDURE SBO_SP_TransactionNotification
(
in object_type nvarchar(30),-- SBO Object Type
in transaction_type nchar(1),-- [A]dd,[U]pdate,[D]elete,[C]ancel,C[L]ose
in num_of_cols_in_key int,in list_of_key_cols_tab_del nvarchar(255),in list_of_cols_val_tab_del nvarchar(255)
)
LANGUAGE sqlSCRIPT
AS
-- Return values
error  int;-- Result (0 for no error)
error_message nvarchar (200); -- Error string to be displayed
begin
error := 0;
error_message := N'OK';
if :object_type = '15' then -- 15 is object type of Delivery Note
    error := 1;
    error_message := N'Error to test';
end if;
-- Select the return values
select :error,:error_message FROM dummy;
end;

现在,当我发送请求时,响应不会返回类似{“ error”:1,“ error_message”:“要测试的错误”}的内容,但是:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
 <title>502 Proxy Error</title>
</head>
<body>
 <h1>Proxy Error</h1>
 <p>The proxy server received an invalid
 response from an upstream server.<br />
The proxy server Could not handle the request <em><a href="/b1s/v1/$batch">POST /b1s/v1/$batch</a></em>.<p>
 Reason: <strong>Error reading from Remote Server</strong></p>
 </p>
</body>
</html>

请告诉我怎么了。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。