[Bug]: Avalara connector uses an unsupported Accept media type for document downloads

未关闭 适合新手
#14,336 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
backend

调研方向

从 src/Apps/W1/EDocumentConnectors/Avalara/App/src/Connection/Requests.Codeunit.al 开始,查看 codeunit 6376 Requests 中的 procedure CreateDownloadRequest。检查 UBL Accept 标头的选择方式,以及提议的媒体类型是否适用于所有受支持的 Avalara mandate 和环境。完成标准是受影响的文档能够使用受支持的媒体类型成功下载,同时现有 XML 处理仍保持兼容。

由索引模型根据 Issue 内容生成。

描述

Team: Integrations
Describe the issue

The Avalara E-Document connector hardcodes the following HTTP header
in codeunit 6376 Requests, procedure CreateDownloadRequest(Id: Text):

line 195: Accept: application/vnd.oasis.ubl+xml

This media type is no longer accepted for the documents tested in our
Avalara environment, preventing downloads using this request.

When testing the same request in Postman, the following Accept values
are accepted:
**- application/vnd.oasis.ubl.flow2+xml

  • application/vnd.oasis.sbdh.flow2+xml**

The XML structure seems to appear unchange for the UBL representation with application/vnd.oasis.ubl.flow2+xml;
the issue appears to concern the accepted media type rather than
a change to the document structure.

We have observed this behavior since approximately July 2026.

Actual response with application/vnd.oasis.ubl+xml:
{
"error": 404,
"message": "The requested media type has not been generated yet or is unavailable."
}
While with application/vnd.oasis.ubl.flow2+xml we obtain a code 200 with the UBL.

Expected behavior

The connector should use an Accept media type supported by Avalara
so that documents can be downloaded successfully.

For the affected scenario, updating the UBL Accept header to
application/vnd.oasis.ubl.flow2+xml appears sufficient, without
changing the existing XML processing.

Steps to reproduce
  1. Identify a document available for download in the affected
    Avalara environment.

  2. Send the following request in Postman with valid authentication:

    GET {baseUrl}/einvoicing/documents/{documentId}/$download
    avalara-version: 1.6
    Accept: application/vnd.oasis.ubl+xml

  3. Observe that the request fails:
    {
    "error": 404,
    "message": "The requested media type has not been generated yet or is unavailable."
    }

  4. Repeat the same request for the same document, changing only
    the Accept header to:

    application/vnd.oasis.ubl.flow2+xml

  5. Observe that the document is successfully downloaded.

Additional context

Environment:

  • Business Central version/build: FR Business Central 29.0 (Platform 29.0.57751.0 + Application 29.0.54011.57536)
  • E-Document Connector - Avalara app version: 29.0.54011.55407
  • Avalara environment: sandbox
  • Tested on the latest bcinsider build: not tested

Relevant source:
https://github.com/microsoft/BCApps/blob/040b335389729ace7ce8dc0fd81d88ee007ed479/src/Apps/W1/EDocumentConnectors/Avalara/App/src/Connection/Requests.Codeunit.al

Proposed fix:
Update the hardcoded UBL Accept media type to application/vnd.oasis.ubl.flow2+xml for the affected scenario, subject to confirmation of its applicability across supported Avalara mandates and environments.

I am willing to contribute a fix once the proposed approach has been reviewed and approved.

I will provide a fix for a bug
  • I will provide a fix for a bug
主要语言
AL
星标
730
派生
514
平均合并
2 天 23 小时
30 天内合并 PR
601

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/BCApps 的其他 Issue

查看 microsoft/BCApps 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。