简体   繁体   English

使用ssrs xml查询设计器自定义从Web服务返回的字段

[英]customize the fields returning from web service using ssrs xml query designer

i have a web service that returns data but i cannot find a way how to choose the fields that returns from the web service. 我有一个返回数据的Web服务,但是我找不到一种方法来选择从Web服务返回的字段。 i have param-in that i send to the web service and i'm getting fields parameters as param-out. 我将参数发送到Web服务,并且将字段参数作为参数输出。 this is how i'm parsing it: 这就是我解析它的方式:

<Query>
<Method Name="methodname" Namespace="namespacename">
<Paramenters>
<Parameter Name="param-in-name-1">
<DefaultValue>0</DefaultValue>
</Parameter>
<Parameter Name="param-in-name-2">
<DefaultValue>0</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespace="true">
*
</ElementPath>
</Query>

this parsing above brings all fields but i need to take specific fields. 上面的分析带来了所有领域,但我需要采取特定领域。 i tried to add this below to the elementpath but it didnt work: /elementname1{}/elementname2{}/fieldname1 我尝试将以下内容添加到elementpath中,但没有成功:/ elementname1 {} / elementname2 {} / fieldname1

I realized that its really depend on the web service schema for example, this schema that i made more complex by adding nested parameters: 我意识到它确实取决于Web服务架构,例如,通过添加嵌套参数使该架构更加复杂:

<wsdl:types>
<s:schema targetNamespace="VS13" elementFormDefault="qualified">
<s:element name="datatable">
<s:complexType>
<s:sequence>
<s:element name="prmin" type="tns:paramin" maxOccurs="1" minOccurs="0"/>
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="paramin">
<s:sequence>
<s:element name="name" type="s:string" maxOccurs="1" minOccurs="0"/>
<s:element name="age" type="s:int" maxOccurs="1" minOccurs="1"/>
<s:element name="height" type="s:int" maxOccurs="1" minOccurs="1"/>
</s:sequence>
</s:complexType>
<s:element name="datatableResponse">
<s:complexType>
<s:sequence>
<s:element name="datatableResult" type="tns:data" maxOccurs="1" minOccurs="0"/>
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="data">
<s:sequence>
<s:element name="name" type="s:string" maxOccurs="1" minOccurs="0"/>
<s:element name="age" type="s:int" maxOccurs="1" minOccurs="1"/>
<s:element name="ltr" type="tns:ArrayOfLetters" maxOccurs="1" minOccurs="0"/>
<s:element name="height" type="s:int" maxOccurs="1" minOccurs="1"/>
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfLetters">
<s:sequence>
<s:element name="letters" type="tns:letters" maxOccurs="unbounded" minOccurs="0"/>
</s:sequence>
</s:complexType>
<s:complexType name="letters">
<s:sequence>
<s:element name="letter" type="s:string" maxOccurs="1" minOccurs="0"/>
<s:element name="count" type="s:int" maxOccurs="1" minOccurs="1"/>
</s:sequence>
</s:complexType>
</s:schema>
</wsdl:types>

i made it more complicated by sending parameters from the second layer(parameters inside a class/element): 我通过从第二层发送参数(类/元素内部的参数)使事情变得更加复杂:

<Query>
<Method Name="datatable" Namespace="VS13" >
<Parameters>
<Parameter Name="prmin" Type="xml">
<DefaultValue>
<name>stiv</name>
<age>30</age>
<height>180</height>
</DefaultValue>
</Parameter>
</Parameters>
</Method>

there are 2 ways for me to implement the data retrieved from the xmldp query 有两种方法可以实现从xmldp查询检索的数据

1.second layer without the array data field: 1.第二层没有数组数据字段:

<ElementPath IgnoreNamespaces="True">
datatableResponse/datatableResult
</ElementPath>

2.second layer only the array data field: 2.第二层仅数组数据字段:

<ElementPath IgnoreNamespaces="True">
datatableResponse/datatableResult{}/ltr/letters{letter,count}
</ElementPath>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM