从Web服务返回的数据集中提取数据

时间:2009-02-25 09:43:30

标签: .net web-services soap wsdl

是否有人使用查询语言来源提取从Web服务返回的数据。

我写了一个web服务返回一个数据集,

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class Service1 : System.Web.Services.WebService
{

    [WebMethod]
    public DataSet GetData()
    {
        AWDS ds = new AWDS();//AWDS is my dataset class name
        SalesPersonTableAdapter ta = new SalesPersonTableAdapter();
        ta.Fill(ds.SalesPerson);
        return ds;
    }
}

我使用了在资源中找到的这个查询

<Query>
<Method Namespace="http://tempuri.org/" Name="GetData">
</Method>
<SoapAction>http://tempuri.org/GetData</SoapAction>
</Query>

“这个查询语言名称是什么”

但是我得到了数据集的模式(我的表列显示为记录)。

我想了解更多如何获取某个表的架构。

由于

2 个答案:

答案 0 :(得分:0)

转到您的网络服务的网址,并在其末尾添加?wsdl。

查找 wsdl:definitions 并查看 targetNamespace 属性。此值是方法命名空间属性应在查询中设置的值。

找到 wsdl:operation 元素,其名称属性等于您要使用的方法,并查看下面的 soap:operation 它。查看 soapAction 属性的值。此值是您将在查询中的 SoapAction 元素中放置的值。

另请参阅以下参考资料:

Reporting Services: Using XML and Web Service Data Sources

XML Query Syntax for Specifying XML Report Data (SSRS)

答案 1 :(得分:-1)

请尽量清楚你要问的是什么。我不知道你发布的这个“查询”XML是什么。它根本不是一种查询语言。

此外,您应该避免从Web服务返回DataSet。它不与非.NET平台互操作,有时也不与.NET互操作。


我在MSDN上的xmlDP上找到了一些资源。请参阅xmldp query syntax

我希望有所帮助。