获取从 SOAP 作为 XML 返回的 DataSet?

发布于 2024-07-29 20:30:19 字数 409 浏览 2 评论 0原文

我们有一个 .NET 2 SOAP Web 服务,供我们组织内部的另一个应用程序使用。 Web 服务返回一个 .NET 数据集,如下所示:

public System.Data.DataSet GetStatementFor(string contractList,
  System.DateTime startDate, System.DateTime endDate)

现在,在其中一个用例中,需要获取 DataSet 对象的 XML。 现在显然 DataSet 在任何情况下都是通过 XML 返回的,所以我想知道是否可以只使用在 SOAP 中表示它的 XML。 通常,XML 被包装到 DataSet 对象中,然后我需要再次序列化该对象。 我可以跳过最后两个步骤,并在有意义的情况下仍然返回 DataSet 吗?

We have a .NET 2 SOAP web service meant for consumption by another app that is internal to our organisation. The web service returns a .NET dataset like so:

public System.Data.DataSet GetStatementFor(string contractList,
  System.DateTime startDate, System.DateTime endDate)

Now in one of the use cases it is necessary to get to the DataSet object's XML. Now obviously the DataSet is being returned via XML in any case, so I was wondering if it is possible to just use the XML that represents it in SOAP. Normally the XML is wrapped into a DataSet object which I will then need to serialize once again. Can I skip these last two steps and still return a DataSet for the cases where it makes sense?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

树深时见影 2024-08-05 20:30:20

不,WebService 以 SOAP 格式传输 DataSet,这与 DataSet.WriteXml() 使用的格式不同。

No, the WebService transfers a DataSet in SOAP formatting, which is different form the format DataSet.WriteXml() uses.

你丑哭了我 2024-08-05 20:30:20

我很困惑你想要什么。 DataSet 将被序列化为 XML,并在另一端反序列化回 DataSet,为什么您需要关心底层 XML?

I'm confused what you want. DataSet will be serialized to XML and deserialized on the other end back into a DataSet why do you need to care about the underlaying XML?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文