> I need some aqdvice on how to structure my web class and how to
> consume the classes from the test page (aspx) page.
Web services can take in an array of simple objects. Perhaps you can
pass in an array of of Object A's. Each object A has a property with
Object B.
Or you can pass in XML - and validate the XML server side to ensure the
proper structure.
Another caveat - Web Services don't support readonly properties.
> 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?
Web services don't support collecftions.
If you need rich objects, use Remoting/WCF.
> 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
It won't - because WSDL only supports a subset of data structures.
http://msdn2.microsoft.com/en-us/library/3003scdt.aspx
> ii) I am unable to populate the collection with multiple 'Object B's'
Pass in an array?
Gustaf - 08 Aug 2007 13:04 GMT
>> 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?
>
> Web services don't support collecftions.
Many, many thanks for this info. I've been blocked by this issue for weeks now. How are you supposed to know it, unless you happen to find this particular page you mentioned? And even that is not explicit about collections. The wsdl.exe tool and Add Web Reference wizard ought to produce a warning whenever it finds an object array!
Gustaf