By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,288 Members | 1,695 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,288 IT Pros & Developers. It's quick & easy.

Exposing Structures from WebService

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
24 Replies


P: n/a
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"
..
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

Nov 21 '05 #2

P: n/a
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"
..
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

Nov 21 '05 #3

P: n/a
What way you would use, then?
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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"
.
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


Nov 21 '05 #4

P: n/a
What way you would use, then?
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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"
.
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


Nov 21 '05 #5

P: n/a
Cor,
I don't see the localhost.MyFields in my client app. I see the
myservice.GiveFields function, but not the structure. I've made it public,
but without improvement.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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"
.
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


Nov 21 '05 #6

P: n/a
Cor,
I don't see the localhost.MyFields in my client app. I see the
myservice.GiveFields function, but not the structure. I've made it public,
but without improvement.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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"
.
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


Nov 21 '05 #7

P: n/a
Nikolay,

Did you set a normal reference in you program to that project?

In the solution explorer
references ->right click ->add reference ->projects -> etc

And you have everytime to build and update the webservice when you make
changes in that.

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Cor,
I don't see the localhost.MyFields in my client app. I see the
myservice.GiveFields function, but not the structure. I've made it public,
but without improvement.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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"
.
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



Nov 21 '05 #8

P: n/a
Nikolay,

Did you set a normal reference in you program to that project?

In the solution explorer
references ->right click ->add reference ->projects -> etc

And you have everytime to build and update the webservice when you make
changes in that.

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Cor,
I don't see the localhost.MyFields in my client app. I see the
myservice.GiveFields function, but not the structure. I've made it public,
but without improvement.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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"
.
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



Nov 21 '05 #9

P: n/a
Yes, i've added Web reference. And I am updating it every time I make change
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nikolay,

Did you set a normal reference in you program to that project?

In the solution explorer
references ->right click ->add reference ->projects -> etc

And you have everytime to build and update the webservice when you make
changes in that.

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Cor,
I don't see the localhost.MyFields in my client app. I see the
myservice.GiveFields function, but not the structure. I've made it
public, but without improvement.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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"
.
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



Nov 21 '05 #10

P: n/a
Yes, i've added Web reference. And I am updating it every time I make change
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nikolay,

Did you set a normal reference in you program to that project?

In the solution explorer
references ->right click ->add reference ->projects -> etc

And you have everytime to build and update the webservice when you make
changes in that.

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Cor,
I don't see the localhost.MyFields in my client app. I see the
myservice.GiveFields function, but not the structure. I've made it
public, but without improvement.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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"
.
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



Nov 21 '05 #11

P: n/a
Nikolay,

Not a webreference, you have to tell where the description of your structure
is with a normal reference. Did you try it as I said?

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Yes, i've added Web reference. And I am updating it every time I make
change
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nikolay,

Did you set a normal reference in you program to that project?

In the solution explorer
references ->right click ->add reference ->projects -> etc

And you have everytime to build and update the webservice when you make
changes in that.

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Cor,
I don't see the localhost.MyFields in my client app. I see the
myservice.GiveFields function, but not the structure. I've made it
public, but without improvement.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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"
.
> 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
>



Nov 21 '05 #12

P: n/a
Nikolay,

Not a webreference, you have to tell where the description of your structure
is with a normal reference. Did you try it as I said?

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Yes, i've added Web reference. And I am updating it every time I make
change
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nikolay,

Did you set a normal reference in you program to that project?

In the solution explorer
references ->right click ->add reference ->projects -> etc

And you have everytime to build and update the webservice when you make
changes in that.

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Cor,
I don't see the localhost.MyFields in my client app. I see the
myservice.GiveFields function, but not the structure. I've made it
public, but without improvement.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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"
.
> 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
>



Nov 21 '05 #13

P: n/a
JD
Yes, use a Web Reference. Once the web reference is added, look at the files
it creates. One of them should be Reference.vb, in there will be the
structure definition. On my maching it looks like:

<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://tempuri.org/
TestWebService/Service1")> _
Public Class myStr1
'<remarks/>
Public [text] As String
'<remarks/>

<System.Xml.Serialization.XmlElementAttribute(Data Type:="base64Binary")> _
Public Key() As Byte
End Class

You should not use a regular reference.

JD

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
Yes, i've added Web reference. And I am updating it every time I make change

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nikolay,

Did you set a normal reference in you program to that project?

In the solution explorer
references ->right click ->add reference ->projects -> etc

And you have everytime to build and update the webservice when you make
changes in that.

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Cor,
I don't see the localhost.MyFields in my client app. I see the
myservice.GiveFields function, but not the structure. I've made it
public, but without improvement.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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"
.
> 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
>



Nov 21 '05 #14

P: n/a
JD
Yes, use a Web Reference. Once the web reference is added, look at the files
it creates. One of them should be Reference.vb, in there will be the
structure definition. On my maching it looks like:

<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://tempuri.org/
TestWebService/Service1")> _
Public Class myStr1
'<remarks/>
Public [text] As String
'<remarks/>

<System.Xml.Serialization.XmlElementAttribute(Data Type:="base64Binary")> _
Public Key() As Byte
End Class

You should not use a regular reference.

JD

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
Yes, i've added Web reference. And I am updating it every time I make change

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nikolay,

Did you set a normal reference in you program to that project?

In the solution explorer
references ->right click ->add reference ->projects -> etc

And you have everytime to build and update the webservice when you make
changes in that.

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Cor,
I don't see the localhost.MyFields in my client app. I see the
myservice.GiveFields function, but not the structure. I've made it
public, but without improvement.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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"
.
> 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
>



Nov 21 '05 #15

P: n/a
JD,

You are right.

It should work direct after rebuilding the application and updating the
webservice.

Cor

"JD" <no@address.org>
Yes, use a Web Reference. Once the web reference is added, look at the
files
it creates. One of them should be Reference.vb, in there will be the
structure definition. On my maching it looks like:

<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://tempuri.org/
TestWebService/Service1")> _
Public Class myStr1
'<remarks/>
Public [text] As String
'<remarks/>

<System.Xml.Serialization.XmlElementAttribute(Data Type:="base64Binary")> _
Public Key() As Byte
End Class

You should not use a regular reference.

JD

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
Yes, i've added Web reference. And I am updating it every time I make

change


"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> Nikolay,
>
> Did you set a normal reference in you program to that project?
>
> In the solution explorer
> references ->right click ->add reference ->projects -> etc
>
> And you have everytime to build and update the webservice when you make
> changes in that.
>
> Cor
>
>
> "Nikolay Petrov" <jo**************@mail.bg>
>
>> Cor,
>> I don't see the localhost.MyFields in my client app. I see the
>> myservice.GiveFields function, but not the structure. I've made it
>> public, but without improvement.
>>
>> "Cor Ligthert" <no************@planet.nl> wrote in message
>> news:%2****************@TK2MSFTNGP15.phx.gbl...
>>> 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"
>>> .
>>>> 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
>>>>
>>>
>>>
>>
>>
>
>



Nov 21 '05 #16

P: n/a
JD,

You are right.

It should work direct after rebuilding the application and updating the
webservice.

Cor

"JD" <no@address.org>
Yes, use a Web Reference. Once the web reference is added, look at the
files
it creates. One of them should be Reference.vb, in there will be the
structure definition. On my maching it looks like:

<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://tempuri.org/
TestWebService/Service1")> _
Public Class myStr1
'<remarks/>
Public [text] As String
'<remarks/>

<System.Xml.Serialization.XmlElementAttribute(Data Type:="base64Binary")> _
Public Key() As Byte
End Class

You should not use a regular reference.

JD

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
Yes, i've added Web reference. And I am updating it every time I make

change


"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> Nikolay,
>
> Did you set a normal reference in you program to that project?
>
> In the solution explorer
> references ->right click ->add reference ->projects -> etc
>
> And you have everytime to build and update the webservice when you make
> changes in that.
>
> Cor
>
>
> "Nikolay Petrov" <jo**************@mail.bg>
>
>> Cor,
>> I don't see the localhost.MyFields in my client app. I see the
>> myservice.GiveFields function, but not the structure. I've made it
>> public, but without improvement.
>>
>> "Cor Ligthert" <no************@planet.nl> wrote in message
>> news:%2****************@TK2MSFTNGP15.phx.gbl...
>>> 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"
>>> .
>>>> 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
>>>>
>>>
>>>
>>
>>
>
>



Nov 21 '05 #17

P: n/a
No, I didn't. So I have to browse to my webservice project and add it as
normal reference?
I'll do it right now.

But this raises new question.
When I publish my web service, how other peaple will add this reference?
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Nikolay,

Not a webreference, you have to tell where the description of your
structure is with a normal reference. Did you try it as I said?

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Yes, i've added Web reference. And I am updating it every time I make
change
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nikolay,

Did you set a normal reference in you program to that project?

In the solution explorer
references ->right click ->add reference ->projects -> etc

And you have everytime to build and update the webservice when you make
changes in that.

Cor
"Nikolay Petrov" <jo**************@mail.bg>

Cor,
I don't see the localhost.MyFields in my client app. I see the
myservice.GiveFields function, but not the structure. I've made it
public, but without improvement.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
> 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"
> .
>> 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
>>
>
>



Nov 21 '05 #18

P: n/a
No, I didn't. So I have to browse to my webservice project and add it as
normal reference?
I'll do it right now.

But this raises new question.
When I publish my web service, how other peaple will add this reference?
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Nikolay,

Not a webreference, you have to tell where the description of your
structure is with a normal reference. Did you try it as I said?

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Yes, i've added Web reference. And I am updating it every time I make
change
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nikolay,

Did you set a normal reference in you program to that project?

In the solution explorer
references ->right click ->add reference ->projects -> etc

And you have everytime to build and update the webservice when you make
changes in that.

Cor
"Nikolay Petrov" <jo**************@mail.bg>

Cor,
I don't see the localhost.MyFields in my client app. I see the
myservice.GiveFields function, but not the structure. I've made it
public, but without improvement.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
> 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"
> .
>> 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
>>
>
>



Nov 21 '05 #19

P: n/a
Nikolay,

That is why I told that I would not do it in your way however take a more
common datasource.

Cor

"Nikolay Petrov" <jo**************@mail.bg>
No, I didn't. So I have to browse to my webservice project and add it as
normal reference?
I'll do it right now.

But this raises new question.
When I publish my web service, how other peaple will add this reference?
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Nikolay,

Not a webreference, you have to tell where the description of your
structure is with a normal reference. Did you try it as I said?

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Yes, i've added Web reference. And I am updating it every time I make
change
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nikolay,

Did you set a normal reference in you program to that project?

In the solution explorer
references ->right click ->add reference ->projects -> etc

And you have everytime to build and update the webservice when you make
changes in that.

Cor
"Nikolay Petrov" <jo**************@mail.bg>

> Cor,
> I don't see the localhost.MyFields in my client app. I see the
> myservice.GiveFields function, but not the structure. I've made it
> public, but without improvement.
>
> "Cor Ligthert" <no************@planet.nl> wrote in message
> news:%2****************@TK2MSFTNGP15.phx.gbl...
>> 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"
>> .
>>> 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
>>>
>>
>>
>
>



Nov 21 '05 #20

P: n/a
Nikolay,

That is why I told that I would not do it in your way however take a more
common datasource.

Cor

"Nikolay Petrov" <jo**************@mail.bg>
No, I didn't. So I have to browse to my webservice project and add it as
normal reference?
I'll do it right now.

But this raises new question.
When I publish my web service, how other peaple will add this reference?
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Nikolay,

Not a webreference, you have to tell where the description of your
structure is with a normal reference. Did you try it as I said?

Cor
"Nikolay Petrov" <jo**************@mail.bg>
Yes, i've added Web reference. And I am updating it every time I make
change
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Nikolay,

Did you set a normal reference in you program to that project?

In the solution explorer
references ->right click ->add reference ->projects -> etc

And you have everytime to build and update the webservice when you make
changes in that.

Cor
"Nikolay Petrov" <jo**************@mail.bg>

> Cor,
> I don't see the localhost.MyFields in my client app. I see the
> myservice.GiveFields function, but not the structure. I've made it
> public, but without improvement.
>
> "Cor Ligthert" <no************@planet.nl> wrote in message
> news:%2****************@TK2MSFTNGP15.phx.gbl...
>> 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"
>> .
>>> 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
>>>
>>
>>
>
>



Nov 21 '05 #21

P: n/a
I am missing something, JD
What sould I do with the definition in Reference.vb?

"JD" <no@address.org> wrote in message
news:uC**************@tk2msftngp13.phx.gbl...
Yes, use a Web Reference. Once the web reference is added, look at the
files
it creates. One of them should be Reference.vb, in there will be the
structure definition. On my maching it looks like:

<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://tempuri.org/
TestWebService/Service1")> _
Public Class myStr1
'<remarks/>
Public [text] As String
'<remarks/>

<System.Xml.Serialization.XmlElementAttribute(Data Type:="base64Binary")> _
Public Key() As Byte
End Class

You should not use a regular reference.

JD

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
Yes, i've added Web reference. And I am updating it every time I make

change


"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> Nikolay,
>
> Did you set a normal reference in you program to that project?
>
> In the solution explorer
> references ->right click ->add reference ->projects -> etc
>
> And you have everytime to build and update the webservice when you make
> changes in that.
>
> Cor
>
>
> "Nikolay Petrov" <jo**************@mail.bg>
>
>> Cor,
>> I don't see the localhost.MyFields in my client app. I see the
>> myservice.GiveFields function, but not the structure. I've made it
>> public, but without improvement.
>>
>> "Cor Ligthert" <no************@planet.nl> wrote in message
>> news:%2****************@TK2MSFTNGP15.phx.gbl...
>>> 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"
>>> .
>>>> 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
>>>>
>>>
>>>
>>
>>
>
>



Nov 21 '05 #22

P: n/a
I am missing something, JD
What sould I do with the definition in Reference.vb?

"JD" <no@address.org> wrote in message
news:uC**************@tk2msftngp13.phx.gbl...
Yes, use a Web Reference. Once the web reference is added, look at the
files
it creates. One of them should be Reference.vb, in there will be the
structure definition. On my maching it looks like:

<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://tempuri.org/
TestWebService/Service1")> _
Public Class myStr1
'<remarks/>
Public [text] As String
'<remarks/>

<System.Xml.Serialization.XmlElementAttribute(Data Type:="base64Binary")> _
Public Key() As Byte
End Class

You should not use a regular reference.

JD

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
Yes, i've added Web reference. And I am updating it every time I make

change


"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> Nikolay,
>
> Did you set a normal reference in you program to that project?
>
> In the solution explorer
> references ->right click ->add reference ->projects -> etc
>
> And you have everytime to build and update the webservice when you make
> changes in that.
>
> Cor
>
>
> "Nikolay Petrov" <jo**************@mail.bg>
>
>> Cor,
>> I don't see the localhost.MyFields in my client app. I see the
>> myservice.GiveFields function, but not the structure. I've made it
>> public, but without improvement.
>>
>> "Cor Ligthert" <no************@planet.nl> wrote in message
>> news:%2****************@TK2MSFTNGP15.phx.gbl...
>>> 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"
>>> .
>>>> 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
>>>>
>>>
>>>
>>
>>
>
>



Nov 21 '05 #23

P: n/a
JD
Use it to call the webservice.

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:uF**************@TK2MSFTNGP14.phx.gbl...
I am missing something, JD
What sould I do with the definition in Reference.vb?

"JD" <no@address.org> wrote in message
news:uC**************@tk2msftngp13.phx.gbl...
Yes, use a Web Reference. Once the web reference is added, look at the
files
it creates. One of them should be Reference.vb, in there will be the
structure definition. On my maching it looks like:

<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://tempuri.org/ TestWebService/Service1")> _
Public Class myStr1
'<remarks/>
Public [text] As String
'<remarks/>

<System.Xml.Serialization.XmlElementAttribute(Data Type:="base64Binary")> _ Public Key() As Byte
End Class

You should not use a regular reference.

JD

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
Yes, i've added Web reference. And I am updating it every time I make

change


"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> Nikolay,
>
> Did you set a normal reference in you program to that project?
>
> In the solution explorer
> references ->right click ->add reference ->projects -> etc
>
> And you have everytime to build and update the webservice when you make > changes in that.
>
> Cor
>
>
> "Nikolay Petrov" <jo**************@mail.bg>
>
>> Cor,
>> I don't see the localhost.MyFields in my client app. I see the
>> myservice.GiveFields function, but not the structure. I've made it
>> public, but without improvement.
>>
>> "Cor Ligthert" <no************@planet.nl> wrote in message
>> news:%2****************@TK2MSFTNGP15.phx.gbl...
>>> 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"
>>> .
>>>> 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
>>>>
>>>
>>>
>>
>>
>
>



Nov 21 '05 #24

P: n/a
JD
Use it to call the webservice.

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:uF**************@TK2MSFTNGP14.phx.gbl...
I am missing something, JD
What sould I do with the definition in Reference.vb?

"JD" <no@address.org> wrote in message
news:uC**************@tk2msftngp13.phx.gbl...
Yes, use a Web Reference. Once the web reference is added, look at the
files
it creates. One of them should be Reference.vb, in there will be the
structure definition. On my maching it looks like:

<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://tempuri.org/ TestWebService/Service1")> _
Public Class myStr1
'<remarks/>
Public [text] As String
'<remarks/>

<System.Xml.Serialization.XmlElementAttribute(Data Type:="base64Binary")> _ Public Key() As Byte
End Class

You should not use a regular reference.

JD

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
Yes, i've added Web reference. And I am updating it every time I make

change


"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> Nikolay,
>
> Did you set a normal reference in you program to that project?
>
> In the solution explorer
> references ->right click ->add reference ->projects -> etc
>
> And you have everytime to build and update the webservice when you make > changes in that.
>
> Cor
>
>
> "Nikolay Petrov" <jo**************@mail.bg>
>
>> Cor,
>> I don't see the localhost.MyFields in my client app. I see the
>> myservice.GiveFields function, but not the structure. I've made it
>> public, but without improvement.
>>
>> "Cor Ligthert" <no************@planet.nl> wrote in message
>> news:%2****************@TK2MSFTNGP15.phx.gbl...
>>> 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"
>>> .
>>>> 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
>>>>
>>>
>>>
>>
>>
>
>



Nov 21 '05 #25

This discussion thread is closed

Replies have been disabled for this discussion.