我需要查询在 Reporting Services 中传递复杂参数作为输入的 web 服务。我怎样才能做到这一点?
在 Visual Studio 的查询设计器中,我正在执行如下查询:
<Query>
<SoapAction>http://mywebservice.com/Customers/GetCustomers</SoapAction>
<Method Name="GetCustomers" Namespace="http://mywebservice.com/Customers/">
<Parameters>
<Parameter Name="myParams" type="xml">
<DefaultValue>
<myParams>
<IdCustomer>0</IdCustomer>
</myParams>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="true">*</ElementPath>
</Query>
WebService 期望它作为参数:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetCustomer xmlns="http://mywebservice.com/Customers/">
<myParams>
<IdCustomer>int</IdCustomer>
<IdCustomer>int</IdCustomer>
</myParams>
</GetCustomer>
</soap:Body>
</soap:Envelope>
当我在 Visual Studio 2008 上尝试时,我收到以下错误消息:
对指定 URL 执行 Web 请求失败。Soap 故障:System.Web.Services.Protocols.SoapException:服务器无法处理请求。---> System.NullReferenceException:对象引用未设置为对象的实例。