从WebService公开结构 [英] Exposing Structures from WebService

查看:77
本文介绍了从WebService公开结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的WebService中我有结构


结构myStr1

将文本作为字符串调暗

将键作为字节() br />
结束结构


和一个Web方法,包含函数,它将数据作为这个结构重新生成


我的qustion是,如何将这个结构暴露给我的应用程序,以便他们可以使用它?


TIA

In my WebService I have structure

Structure myStr1
Dim text as String
Dim Key as Byte()
End Structure

and a Web Method, containing Function which retruns data as this Structure

My qustion is, How to expose this structure to my apps, so they can use it?

TIA

推荐答案

Nikolay ,


我绝对不会这样做,但是我可以用

来做最短的样品给你一个想法。

\\\

< WebMethod()> _

公共函数GiveFields()作为MyFields

将myrecord变暗为新的MyFields

myrecord.fielda =" Hello"

myrecord.fieldb =" World"

返回myrecord

结束功能

结构MyFields

公开fielda As String

Public fieldb As String

结束结构

///

\\\将其添加到webproject并设置对项目本身的引用

\\\在此表单上的列表框

Private Sub Form1_Load(ByVal sender As Object,ByVal e _

As System.EventArgs)处理MyBase.Load

Dim myservice As new localhost.NewService

Dim a As localhost.MyFields = myservice .GiveFields

ListBox1.Items.Add(a.fielda)

ListBox1.Items.Add(a.fieldb)

End Sub

///


我希望这会对你有所帮助吗?


Cor

Nikolay Petrov

..
Nikolay,

I would never do it this way, however the shortest sample I could make from
it to give you an idea.
\\\
<WebMethod()> _
Public Function GiveFields() As MyFields
Dim myrecord As New MyFields
myrecord.fielda = "Hello"
myrecord.fieldb = "World"
Return myrecord
End Function
Structure MyFields
Public fielda As String
Public fieldb As String
End Structure
///
\\\add this to the webproject and set a reference to the project itself
\\\a listbox on this form
Private Sub Form1_Load(ByVal sender As Object, ByVal e _
As System.EventArgs) Handles MyBase.Load
Dim myservice As New localhost.NewService
Dim a As localhost.MyFields = myservice.GiveFields
ListBox1.Items.Add(a.fielda)
ListBox1.Items.Add(a.fieldb)
End Sub
///

I hope this helps you a little bit?

Cor
"Nikolay Petrov"
..
在我的WebService中我有结构

结构myStr1
Dim text as String
Dim Key as Byte()
结束结构

和一个Web方法,包含将数据作为此结构重新生成的函数

我的qustion是,如何将此结构公开给我的应用程序,以便他们可以使用
它?

TIA
In my WebService I have structure

Structure myStr1
Dim text as String
Dim Key as Byte()
End Structure

and a Web Method, containing Function which retruns data as this Structure

My qustion is, How to expose this structure to my apps, so they can use
it?

TIA



Nikolay,


我永远不会做就这样,不过我可以用最简单的样品来给你一个想法。

\\\

< ;的WebMethod()> _

公共函数GiveFields()作为MyFields

将myrecord变暗为新的MyFields

myrecord.fielda =" Hello"

myrecord.fieldb =" World"

返回myrecord

结束功能

结构MyFields

公开fielda As String

Public fieldb As String

结束结构

///

\\\将其添加到webproject并设置对项目本身的引用

\\\在此表单上的列表框

Private Sub Form1_Load(ByVal sender As Object,ByVal e _

As System.EventArgs)处理MyBase.Load

Dim myservice As new localhost.NewService

Dim a As localhost.MyFields = myservice .GiveFields

ListBox1.Items.Add(a.fielda)

ListBox1.Items.Add(a.fieldb)

End Sub

///


我希望这会对你有所帮助吗?


Cor

Nikolay Petrov

..
Nikolay,

I would never do it this way, however the shortest sample I could make from
it to give you an idea.
\\\
<WebMethod()> _
Public Function GiveFields() As MyFields
Dim myrecord As New MyFields
myrecord.fielda = "Hello"
myrecord.fieldb = "World"
Return myrecord
End Function
Structure MyFields
Public fielda As String
Public fieldb As String
End Structure
///
\\\add this to the webproject and set a reference to the project itself
\\\a listbox on this form
Private Sub Form1_Load(ByVal sender As Object, ByVal e _
As System.EventArgs) Handles MyBase.Load
Dim myservice As New localhost.NewService
Dim a As localhost.MyFields = myservice.GiveFields
ListBox1.Items.Add(a.fielda)
ListBox1.Items.Add(a.fieldb)
End Sub
///

I hope this helps you a little bit?

Cor
"Nikolay Petrov"
..
在我的WebService中我有结构

结构myStr1
Dim text as String
Dim Key as Byte()
结束结构

和一个Web方法,包含将数据作为此结构重新生成的函数

我的qustion是,如何将此结构公开给我的应用程序,以便他们可以使用
它?

TIA
In my WebService I have structure

Structure myStr1
Dim text as String
Dim Key as Byte()
End Structure

and a Web Method, containing Function which retruns data as this Structure

My qustion is, How to expose this structure to my apps, so they can use
it?

TIA



你会用什么方式呢?

" Cor Ligthert <无************ @ planet.nl>在消息中写道

news:%2 **************** @ TK2MSFTNGP15.phx.gbl ...
What way you would use, then?
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Nikolay,

我绝对不会这样做,不过我用它做的最短的样本可以给你一个想法。
\\\
< ;的WebMethod()> _
公共函数GiveFields()作为MyFields
昏暗的myrecord作为新的MyFields
myrecord.fielda =" Hello"
myrecord.fieldb =" World"
返回myrecord
结束功能
结构MyFields
Public fielda As String
Public fieldb As String
结束结构
///
\\ \添加到webproject并设置对项目本身的引用
\\\在此表单上的列表框
Private Sub Form1_Load(ByVal sender As Object,ByVal e _
作为System.EventArgs)处理MyBase.Load
Dim myservice As new localhost.NewService
Dim a As localhost.MyFields = myservice.GiveFields
ListBox1.Items.Add(a.fielda)
ListBox1.Items.Add(a.fieldb)
End Sub
///

我希望这会对你有所帮助吗?

Cor

" Nikolay Petrov"
Nikolay,

I would never do it this way, however the shortest sample I could make
from it to give you an idea.
\\\
<WebMethod()> _
Public Function GiveFields() As MyFields
Dim myrecord As New MyFields
myrecord.fielda = "Hello"
myrecord.fieldb = "World"
Return myrecord
End Function
Structure MyFields
Public fielda As String
Public fieldb As String
End Structure
///
\\\add this to the webproject and set a reference to the project itself
\\\a listbox on this form
Private Sub Form1_Load(ByVal sender As Object, ByVal e _
As System.EventArgs) Handles MyBase.Load
Dim myservice As New localhost.NewService
Dim a As localhost.MyFields = myservice.GiveFields
ListBox1.Items.Add(a.fielda)
ListBox1.Items.Add(a.fieldb)
End Sub
///

I hope this helps you a little bit?

Cor
"Nikolay Petrov"
.
在我的WebService中我有结构

结构myStr1
Dim文本为String
Dim Key as Byte()
结束结构

和Web方法,包含功能,可以重新生成数据这个结构

我的问题是,如何将这个结构暴露给我的应用程序,这样他们就可以使用它了吗?

TIA
In my WebService I have structure

Structure myStr1
Dim text as String
Dim Key as Byte()
End Structure

and a Web Method, containing Function which retruns data as this
Structure

My qustion is, How to expose this structure to my apps, so they can use
it?

TIA




这篇关于从WebService公开结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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