"John Cosmas" <jo********@charter.netwrote in message
news:gP**************@newsfe04.lga...
Yes, I read somewhere in the forums it is possible. But I'm trying to
find a good example to use myself. I'm considering a collection, because
it's a known type and structured, but I still can't find a working example
anywhere. I wish that people who post solutions would actually give us
good examples instead of one liners that go nowhere. It's interesting
that I don't have such problems in the VBA forums. If I run into
anything, I will let you know.
John et. al.,
I'm sorry I haven't been able to provide better or more detailed answers.
I've got a release due Monday and have little time left over for helping
out.
Briefly, though, I want to caution everyone about using platform-specific
types in web services, either as parameters or return values. The Web
Services infrastructure was meant to be platform-neutral. In this regard,
consider that many platforms have no concept of generics.
Further, consider that a generic method does not represent a single method.
Rather, it represents a family of methods. This would make it even more
complicated to implement in a cross-platform manner.
That said, I believe you can get a web service to return a generic
instantiation:
[WebMethod]
public MyGeneric<int, stringMyGenericMethod(int x, string y);
I believe I've seen a generated WSDL for such a method containing a
manufactured name containing "int" and "string". Something like
"MyGenericOfIntAndString".
Much the same comment applies to things like List<T>. In this case, you
might be able to use XML Serialization attributes to turn this into an array
of T.
I would recommend that any developers new to Web Services should start off
by programming against the "least-common denominator" model that will work
on any platform. For instance, if you want to use List<Tinside of your web
service, go ahead - but you'll be better off (*) working with an array of T
(for a specific T). This will correspond better to what the infrastructure
is geared to send and receive.
--
John Saunders [MVP]
(*) After gaining experience with the basics of the infrastructure, go ahead
and challenge it. You will by then understand how things work "under the
covers", and you'll be in a better position to learn how to make Web
Services "do tricks".