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

Exposing collection and classes from within a web service

P: n/a
Please - anyone that can help.

I am getting confusing results while trying to expose a collection from a
web service.

I have a webservice in which a web method accepts a collection as a
parameter and returns an array of datasets. The collection consists of
database connection objects.

Based on the simple hierarchy below, you can see that starting with the
ConnectionsCollection, all other collections and objects are "chained"
together. Each collection implements the 'CollectionBase' and each class
contains a property which associates it to the next collection in the
hierarchy.

Everything works fine. The problem is with intellisense. In my test
application that references the webservice the ParameterObject gets exposed
with all of the properties and methods visible using intellisense but none of
the classes "higher up in the chain" have any of their properties or methods
exposed. I need to get all of the properties and methods in all of the
classes exposed from inside of my test application.

If I take this design and create a standard project reference I get all the
intellisense I need from all the classes but from a webservice it's a
different result. Why or how can I get all of the classes in a webservice to
be serialized?

I would have thought that since the ParameterObject is the lowest class in
the chain that all of the other consuming classes would be exposed as well. I
am confused as to why that last class in the hierarchy is exposed while the
other two classes remain hidden

MyDataManagerService
WebMethod:GetMyDataset(MyConnectionCollection as ConnectionCollection) as
DataSet

--->>ConnectionsCollection (Contains connection objects)

------->>ConnectionObject (has a property of Commands as CommandsCollection)

----------->>CommandsCollection (Contains command objects)

--------------->>CommandObject (property of parameters collection)

------------------->>ParametersCollection (Contains parameters objects)

----------------------->>ParameterObject

Dec 7 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hello Dave,

What do you mean by: "ParameterObject gets exposed with all of the
properties and methods"?
Methods are not serializable!

I don't know if this realy answers to your question, but here it goes:
Web-services use a XML serialization mechanism to transfer the object's
state across the wire. In order to properties get serialized, they must be
public and implement the *get* and *set* accessors.
--

Best regards,

Abel Eduardo Pereira
"Dave" <Da**@discussions.microsoft.com> wrote in message
news:CF**********************************@microsof t.com...
Please - anyone that can help.

I am getting confusing results while trying to expose a collection from a
web service.

I have a webservice in which a web method accepts a collection as a
parameter and returns an array of datasets. The collection consists of
database connection objects.

Based on the simple hierarchy below, you can see that starting with the
ConnectionsCollection, all other collections and objects are "chained"
together. Each collection implements the 'CollectionBase' and each class
contains a property which associates it to the next collection in the
hierarchy.

Everything works fine. The problem is with intellisense. In my test
application that references the webservice the ParameterObject gets
exposed
with all of the properties and methods visible using intellisense but none
of
the classes "higher up in the chain" have any of their properties or
methods
exposed. I need to get all of the properties and methods in all of the
classes exposed from inside of my test application.

If I take this design and create a standard project reference I get all
the
intellisense I need from all the classes but from a webservice it's a
different result. Why or how can I get all of the classes in a webservice
to
be serialized?

I would have thought that since the ParameterObject is the lowest class in
the chain that all of the other consuming classes would be exposed as
well. I
am confused as to why that last class in the hierarchy is exposed while
the
other two classes remain hidden

MyDataManagerService
WebMethod:GetMyDataset(MyConnectionCollection as ConnectionCollection) as
DataSet

--->>ConnectionsCollection (Contains connection objects)

------->>ConnectionObject (has a property of Commands as
CommandsCollection)

----------->>CommandsCollection (Contains command objects)

--------------->>CommandObject (property of parameters collection)

------------------->>ParametersCollection (Contains parameters objects)

----------------------->>ParameterObject

Dec 8 '05 #2

P: n/a
Perhaps I used the term "serialized" inccorectly. How can I get all of the
methods and properties of all my classes in my webservice to show up with
intellisense in the application that is using my webservice.

The ParameterObject has all of it's properties and methods available using
intellisense. How come the other classes and collections that consume one
another in my webservice do not show up with intellisense?
"Abel Eduardo Pereira" wrote:
Hello Dave,

What do you mean by: "ParameterObject gets exposed with all of the
properties and methods"?
Methods are not serializable!

I don't know if this realy answers to your question, but here it goes:
Web-services use a XML serialization mechanism to transfer the object's
state across the wire. In order to properties get serialized, they must be
public and implement the *get* and *set* accessors.
--

Best regards,

Abel Eduardo Pereira
"Dave" <Da**@discussions.microsoft.com> wrote in message
news:CF**********************************@microsof t.com...
Please - anyone that can help.

I am getting confusing results while trying to expose a collection from a
web service.

I have a webservice in which a web method accepts a collection as a
parameter and returns an array of datasets. The collection consists of
database connection objects.

Based on the simple hierarchy below, you can see that starting with the
ConnectionsCollection, all other collections and objects are "chained"
together. Each collection implements the 'CollectionBase' and each class
contains a property which associates it to the next collection in the
hierarchy.

Everything works fine. The problem is with intellisense. In my test
application that references the webservice the ParameterObject gets
exposed
with all of the properties and methods visible using intellisense but none
of
the classes "higher up in the chain" have any of their properties or
methods
exposed. I need to get all of the properties and methods in all of the
classes exposed from inside of my test application.

If I take this design and create a standard project reference I get all
the
intellisense I need from all the classes but from a webservice it's a
different result. Why or how can I get all of the classes in a webservice
to
be serialized?

I would have thought that since the ParameterObject is the lowest class in
the chain that all of the other consuming classes would be exposed as
well. I
am confused as to why that last class in the hierarchy is exposed while
the
other two classes remain hidden

MyDataManagerService
WebMethod:GetMyDataset(MyConnectionCollection as ConnectionCollection) as
DataSet

--->>ConnectionsCollection (Contains connection objects)

------->>ConnectionObject (has a property of Commands as
CommandsCollection)

----------->>CommandsCollection (Contains command objects)

--------------->>CommandObject (property of parameters collection)

------------------->>ParametersCollection (Contains parameters objects)

----------------------->>ParameterObject


Dec 8 '05 #3

P: n/a
Have you refreshed your WebService reference? If not, Build the web service,
then right click on your web service reference in the solution explorer of
your client app and refresh it.

For them to show up in Intellisense, they need to be in the WSDL. Check the
WSDL and if you are using Visual Studio to create your proxy for you, check
the proxy class to see if they are there.

If your web service either takes the class/collection as an argument to a
WebMethod or returns the class/collection as a result from a WebMethod, they
should be exposed and included in the WSDL. Encapsulation works for this,
so a class that is a member of another class will be exposed as well.

HTH,

John


"Dave" wrote:
Perhaps I used the term "serialized" inccorectly. How can I get all of the
methods and properties of all my classes in my webservice to show up with
intellisense in the application that is using my webservice.

The ParameterObject has all of it's properties and methods available using
intellisense. How come the other classes and collections that consume one
another in my webservice do not show up with intellisense?
"Abel Eduardo Pereira" wrote:
Hello Dave,

What do you mean by: "ParameterObject gets exposed with all of the
properties and methods"?
Methods are not serializable!

I don't know if this realy answers to your question, but here it goes:
Web-services use a XML serialization mechanism to transfer the object's
state across the wire. In order to properties get serialized, they must be
public and implement the *get* and *set* accessors.
--

Best regards,

Abel Eduardo Pereira
"Dave" <Da**@discussions.microsoft.com> wrote in message
news:CF**********************************@microsof t.com...
Please - anyone that can help.

I am getting confusing results while trying to expose a collection from a
web service.

I have a webservice in which a web method accepts a collection as a
parameter and returns an array of datasets. The collection consists of
database connection objects.

Based on the simple hierarchy below, you can see that starting with the
ConnectionsCollection, all other collections and objects are "chained"
together. Each collection implements the 'CollectionBase' and each class
contains a property which associates it to the next collection in the
hierarchy.

Everything works fine. The problem is with intellisense. In my test
application that references the webservice the ParameterObject gets
exposed
with all of the properties and methods visible using intellisense but none
of
the classes "higher up in the chain" have any of their properties or
methods
exposed. I need to get all of the properties and methods in all of the
classes exposed from inside of my test application.

If I take this design and create a standard project reference I get all
the
intellisense I need from all the classes but from a webservice it's a
different result. Why or how can I get all of the classes in a webservice
to
be serialized?

I would have thought that since the ParameterObject is the lowest class in
the chain that all of the other consuming classes would be exposed as
well. I
am confused as to why that last class in the hierarchy is exposed while
the
other two classes remain hidden

MyDataManagerService
WebMethod:GetMyDataset(MyConnectionCollection as ConnectionCollection) as
DataSet

--->>ConnectionsCollection (Contains connection objects)

------->>ConnectionObject (has a property of Commands as
CommandsCollection)

----------->>CommandsCollection (Contains command objects)

--------------->>CommandObject (property of parameters collection)

------------------->>ParametersCollection (Contains parameters objects)

----------------------->>ParameterObject


Dec 8 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.