【发布时间】:2019-08-17 00:36:36
【问题描述】:
我正在尝试创建一个具有 XML 数据源的 SSRS 报告,但卡住了。
我有一个接受参数的 URL(下面,参数名为 Id,值为 param1)并返回以下 XML 数据:
https://site1/test/GetInfo/param1
或者
https://site1/test/GetInfo?Id=param1
<Contract xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Dynamics.Ax.Application">
<Id>param1</Id>
<City>Los Angeles</City>
<Country>USA</Country>
<Customer>Customer1</Customer>
<State>WA</State>
<Street>150 Main Street</Street>
<Zip>99999</Zip>
</Contract>
这本身不是一个 Web 服务,因为它只接受 URI 中的参数/查询,所以我相信这是一个 XML 文档。
在 SSRS 2016 报表生成器中,我执行了以下操作:
- 在我的报告中,我创建了一个数据源,ConnectionType =
XML,连接字符串 =https://site1/test/GetInfo - 创建了一个指向上述数据源的数据集,查询类型 =
Text,具有以下内容:
<Query>
<Method Namespace="http://schemas.datacontract.org/2004/07/Dynamics.Ax.Application" Name="GetInfo">
<Parameters>
<Parameter Name="Id">
<DefaultValue>DefaultValue1</DefaultValue>
</Parameter>
</Parameters>
</Method>
</Query>
单击确定按钮完成数据集后,出现以下错误:
Could not create a list of fields for the query. Verify that you can connect to the data source and that your query syntax is correct.
Failed to execute web request for the specified URL.
Method Not Allowed: The remote server returned an error: (405) Method Not Allowed.
The remote server returned an error: (405) Method Not Allowed.
<Error><Message>The requested resource does not support http method 'POST'.</Message></Error>
查询中的方法名称映射到类中的实际方法名称,并且操作是GET方法。
【问题讨论】: