将数据集传递给Web服务 [英] Passing a Dataset to a webservice

查看:68
本文介绍了将数据集传递给Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将数据集传递给Web服务?我需要从掌上电脑向网络服务提交一个购物车



什么是正确的数据类型?

II已尝试将数据集作为数据类型,但我无法编译。

< WebMethod()> _

公共函数VerifySku(ByVal skus As XmlDataDocument)作为DataSet

测试程序:

Dim cartSet As DataSet

cartSet = ws.VerifySku(cartSet)


错误:

C:\Projects\ShoppingCartWeb \ ShoppingCartTest \Test。 vb(37):类型的值

''System.Data.DataSet''无法转换为''
System.Object''的1维数组。

How do I pass a dataset to a webservices? I need to submit a shoppingcart
from a pocket PC to a webservice.
What is the right datatype?
II have tried dataset as a datatype, but I can''t get it to compile.
<WebMethod()> _
Public Function VerifySku(ByVal skus As XmlDataDocument) As DataSet

Test program :
Dim cartSet As DataSet
cartSet = ws.VerifySku(cartSet)

Error:
C:\Projects\ShoppingCartWeb\ShoppingCartTest\Test. vb(37): Value of type
''System.Data.DataSet'' cannot be converted to ''1-dimensional array of
System.Object''.

推荐答案

最好使用DataSet的GetXML和ReadXML方法。

换句话说, Web服务将数据集中的xml作为字符串返回。

这个xml可以很容易地放回到新的数据集中。

Arne <氩** @ discussions.microsoft.com>在消息中写道

新闻:E1 ********************************** @ microsof t.com ...
You are probably better off using the DataSet''s GetXML and ReadXML methods.
In other words, the web service returns the xml from a DataSet as a string.
This xml can then be very easily put back into a new DataSet.
"Arne" <Ar**@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
如何将数据集传递给Web服务?我需要从掌上电脑向网络服务提交一个购物车。
什么是正确的数据类型?
我已经尝试过将数据集作为数据类型,但是我无法编译它。
< WebMethod()> _
公共函数VerifySku(ByVal skus As XmlDataDocument)作为DataSet

测试程序:
Dim cartSet As DataSet
cartSet = ws.VerifySku(cartSet)

错误:
C:\Projects \ ShoppingCartWeb \ ShoppingCartTest \Test。 vb(37):类型的值
''System.Data.DataSet''无法转换为''System.Object''的一维数组。
How do I pass a dataset to a webservices? I need to submit a shoppingcart
from a pocket PC to a webservice.
What is the right datatype?
II have tried dataset as a datatype, but I can''t get it to compile.
<WebMethod()> _
Public Function VerifySku(ByVal skus As XmlDataDocument) As DataSet

Test program :
Dim cartSet As DataSet
cartSet = ws.VerifySku(cartSet)

Error:
C:\Projects\ShoppingCartWeb\ShoppingCartTest\Test. vb(37): Value of type
''System.Data.DataSet'' cannot be converted to ''1-dimensional array of
System.Object''.



Scott,

这是错误问题的正确答案。我你读了我的问题

你会发现我在将数据集传递给Web服务时遇到了问题。我没有问题从web服务返回数据集没有问题。

你想再试一次以获得正确的答案吗?

Arne


" Scott M."写道:
Scott,
That is the right answer to the wrong question. I you you read my question
you will find that I have a problem passing a dataset to a web services. I do
not have a problem returning a dataset from a web services.
Do you want to try again to get the right answer?
Arne

"Scott M." wrote:
你可能最好使用DataSet的GetXML和ReadXML方法。
换句话说,Web服务从数据集中返回xml作为字符串。
这个xml可以很容易地放回到新的数据集中。

Arne <氩** @ discussions.microsoft.com>在消息中写道
新闻:E1 ********************************** @ microsof t.com。 ..
You are probably better off using the DataSet''s GetXML and ReadXML methods.
In other words, the web service returns the xml from a DataSet as a string.
This xml can then be very easily put back into a new DataSet.
"Arne" <Ar**@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
如何将数据集传递给Web服务?我需要从掌上电脑向网络服务提交一个购物车。
什么是正确的数据类型?
我已经尝试过将数据集作为数据类型,但是我无法编译它。
< WebMethod()> _
公共函数VerifySku(ByVal skus As XmlDataDocument)作为DataSet

测试程序:
Dim cartSet As DataSet
cartSet = ws.VerifySku(cartSet)

错误:
C:\Projects \ ShoppingCartWeb \ ShoppingCartTest \Test。 vb(37):类型的值
''System.Data.DataSet''无法转换为''System.Object''的一维数组。
How do I pass a dataset to a webservices? I need to submit a shoppingcart
from a pocket PC to a webservice.
What is the right datatype?
II have tried dataset as a datatype, but I can''t get it to compile.
<WebMethod()> _
Public Function VerifySku(ByVal skus As XmlDataDocument) As DataSet

Test program :
Dim cartSet As DataSet
cartSet = ws.VerifySku(cartSet)

Error:
C:\Projects\ShoppingCartWeb\ShoppingCartTest\Test. vb(37): Value of type
''System.Data.DataSet'' cannot be converted to ''1-dimensional array of
System.Object''.




Arne,


哇!谢谢你的态度。你想再试一次并阅读我的第一个

帖子,看看你找到的答案是在那里吗?


提示:数据集 s GetXML和ReadXML方法" ;.


也许你可以考虑一下我写的内容并试着看看它是如何适合你的情况的./ br / b。 >

-Scott

" Arne" <氩** @ discussions.microsoft.com>在留言中写道

新闻:E7 ********************************** @ microsof t.com ...
Arne,

Wow! Thanks for the attitude. Do you want to try again and read my first
post and see that the answer you seek is in there?

Hint: "the DataSet''s GetXML and ReadXML methods".

Perhaps you could think about what I wrote and try to see how it might fit
into your situation.

-Scott
"Arne" <Ar**@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...
Scott,
这是错误问题的正确答案。我你读了我的问题
你会发现我在将数据集传递给Web服务时遇到了问题。从
返回Web服务中的数据集时没有问题。
您想再试一次以获得正确的答案吗?
Arne
Scott M.写道:
Scott,
That is the right answer to the wrong question. I you you read my question
you will find that I have a problem passing a dataset to a web services. I
do
not have a problem returning a dataset from a web services.
Do you want to try again to get the right answer?
Arne

"Scott M." wrote:
你可能最好使用DataSet的GetXML和ReadXML
方法。
换句话说,Web服务返回xml DataSet作为一个
字符串。
这个xml可以很容易地放回到一个新的数据集中。

" Arne" <氩** @ discussions.microsoft.com>在消息中写道
新闻:E1 ********************************** @ microsof t.com。 ..
You are probably better off using the DataSet''s GetXML and ReadXML
methods.
In other words, the web service returns the xml from a DataSet as a
string.
This xml can then be very easily put back into a new DataSet.
"Arne" <Ar**@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
>如何将数据集传递给Web服务?我需要提交一份
> shoppingcart
>从掌上电脑到网络服务。
>什么是正确的数据类型?
>我已经尝试过将数据集作为数据类型,但我无法进行编译。
> <的WebMethod()> _
>公共函数VerifySku(ByVal skus As XmlDataDocument)作为DataSet
>
>测试程序:
> Dim cartSet As DataSet
> cartSet = ws.VerifySku(cartSet)
>
>错误:
> C:\Projects\ShoppingCartWeb\ShoppingCartTest\Test。 vb(37):类型的值
> ''System.Data.DataSet''无法转换为''1维数组
> System.Object''。
>
>
> How do I pass a dataset to a webservices? I need to submit a
> shoppingcart
> from a pocket PC to a webservice.
> What is the right datatype?
> II have tried dataset as a datatype, but I can''t get it to compile.
> <WebMethod()> _
> Public Function VerifySku(ByVal skus As XmlDataDocument) As DataSet
>
> Test program :
> Dim cartSet As DataSet
> cartSet = ws.VerifySku(cartSet)
>
> Error:
> C:\Projects\ShoppingCartWeb\ShoppingCartTest\Test. vb(37): Value of type
> ''System.Data.DataSet'' cannot be converted to ''1-dimensional array of
> System.Object''.
>
>




这篇关于将数据集传递给Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆