DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Sat, 4 Aug 2007 00:02:00 +0200,    posted on: microsoft.public.dotnet.framework.aspnet.webservices        back       

Thread Index
  1    Vaughn Haybittle


Collection and multiple classes interacting via web service!?   
Hi,

I have a few questions relating to web services.  First some Background:

I have developed two classes in ASP.Net (VB):
1)  The first is a class that contains some fields that represent header
information.  This class also contains a strongly typed collection.  This is
'Object A'
2)  The second class represents the line items for each record.  For each
line item I would expect the consumer of the web service to create an object
from this class.    Ideally each of these objects will be added to the
collection of the object created ion 1 above.  The entire object in 1 above
will then be passed to a web service which will save the header information
and process each item in the collection to a database.  This is 'Object B'

My questions are:

A)  How do I structre the WebService.  I know a I need a webmethod that
takes the 'Object A' above and saves its data to a database.  However Unless
I create a webmethod that has the two classes as arguements (i.e. 'Object A'
and 'Object B') My WSDL file does not reflect the two classes which means
that they can not be instabtiated by the consumer of the web service.

B)  I have written a test page.  In this page I instantiate a new instance
of the item in Object A (via the web reference) above and a new instance of
the 'Object B' above.  I then attempt to add 'Object B' to the collection in
the 'Object A'.

I need some aqdvice on how to structure my web class and how to consume the
classes from the test page (aspx) page.

C) Another question I have is that when I try to reference the Collection
via the web service it appears as though it is an array rather than a
collection.  why is this?

Fundamentally I am wanting to allow consumers to create an instance of
Object B for every line item in a database table and to add that to a
collection in Object A.  Object A also has a few additional header fields
which will then be populated.  I then want to pass the populated 'Object A'
to a web service that will write the header informatiuo and each item in the
collection to a database.

At present I can not seem to achieve this as either:
i) My WSDL file does not reflect my classes
ii) I am unable to populate the collection with multiple 'Object B's'
iii) I am not consuming the web service correctly from my test page.
(should I instantiate Object A and Object B in my web page and then add
Object B to Oject A;'s collection in the consuming page or can I do this
behind the scenes via private communication between Object A and Object B?

Any suggestions or help wwould be appreciated.

Warm Regards,

Vaughn
Date:Sat, 4 Aug 2007 00:02:00 +0200   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us