Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2005

Tip: Looking for answers? Try searching our database.

Exposing collection and classes from within a web service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 07 Dec 2005 14:46 GMT
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
Abel Eduardo Pereira - 08 Dec 2005 00:45 GMT
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.

Signature

Best regards,

Abel Eduardo Pereira

> Please - anyone that can help.
>
[quoted text clipped - 51 lines]
>
> ----------------------->>ParameterObject
Dave - 08 Dec 2005 12:59 GMT
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?

> Hello Dave,
>
[quoted text clipped - 62 lines]
> >
> > ----------------------->>ParameterObject
John Scragg - 08 Dec 2005 16:00 GMT
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



> 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
[quoted text clipped - 70 lines]
> > >
> > > ----------------------->>ParameterObject

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.