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

Consuming Custom Collecction through a web service

P: n/a
kbs
Hi,

I'm looking for some good examples that illustrate how to code a web service
that exposes a custom collection so that the properties of the collection are
accessible on the client without having to do a httpwebreqeust call.
Nov 23 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
I can't give you an example for that, but bear in mind, Web Services
share schema(W3C XML Schema) not type for contract. thus anything that
could be expressed as a valid Xml Schema can be expose(but for best
practice and interoperability... there some rules
http://devresource.hp.com/drc/slide_...SDL/index.jsp).
so once the schema turn into proxy at the client side. they can modify
it accordingly to achieve the desired behaviors as long as the
serialized objects is still valid Xml instant of the schema

regards
erymuzuan

kbs wrote:
Hi,

I'm looking for some good examples that illustrate how to code a web service
that exposes a custom collection so that the properties of the collection are
accessible on the client without having to do a httpwebreqeust call.

Nov 23 '05 #2

P: n/a
Ken
Agreed, web services share schema. Perhaps what I'm having a problem with is
properly serializing a custom collection. I'm experimenting with a simple
class who's properties are simple data types; a type safe array list that
contains a simple class who's properties are simple data types. No nested
collections. So what I'm looking for is the proper way to serialize a custom
collection.
"erymuzuan" wrote:
I can't give you an example for that, but bear in mind, Web Services
share schema(W3C XML Schema) not type for contract. thus anything that
could be expressed as a valid Xml Schema can be expose(but for best
practice and interoperability... there some rules
http://devresource.hp.com/drc/slide_...SDL/index.jsp).
so once the schema turn into proxy at the client side. they can modify
it accordingly to achieve the desired behaviors as long as the
serialized objects is still valid Xml instant of the schema

regards
erymuzuan

kbs wrote:
Hi,

I'm looking for some good examples that illustrate how to code a web service
that exposes a custom collection so that the properties of the collection are
accessible on the client without having to do a httpwebreqeust call.

Nov 23 '05 #3

P: n/a
You can definitely express arrays of simple types as XML schemas.

What are your "custom collections"? Are they collections deriving from
CollectionBase? Custom implementations if IList, etc?

Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: Ken [mailto:Ke*@discussions.microsoft.com]
Posted At: Sunday, January 23, 2005 9:51 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: Consuming Custom Collecction through a web service
Subject: Re: Consuming Custom Collecction through a web service

Agreed, web services share schema. Perhaps what I'm having a problem with is
properly serializing a custom collection. I'm experimenting with a simple class who's properties are simple data types; a type safe array list that contains a simple class who's properties are simple data types. No nested collections. So what I'm looking for is the proper way to serialize a
custom
collection.
"erymuzuan" wrote:
I can't give you an example for that, but bear in mind, Web Services
share schema(W3C XML Schema) not type for contract. thus anything that
could be expressed as a valid Xml Schema can be expose(but for best
practice and interoperability... there some rules
http://devresource.hp.com/drc/slide_...SDL/index.jsp). so once the schema turn into proxy at the client side. they can modify it accordingly to achieve the desired behaviors as long as the
serialized objects is still valid Xml instant of the schema

regards
erymuzuan

kbs wrote:
Hi,

I'm looking for some good examples that illustrate how to code a web
service that exposes a custom collection so that the properties of the collection are accessible on the client without having to do a httpwebreqeust

call.


Nov 23 '05 #4

P: n/a
Ken
My collection derive from IList and ICloneable.

"Christoph Schittko [MVP]" wrote:
You can definitely express arrays of simple types as XML schemas.

What are your "custom collections"? Are they collections deriving from
CollectionBase? Custom implementations if IList, etc?

Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: Ken [mailto:Ke*@discussions.microsoft.com]
Posted At: Sunday, January 23, 2005 9:51 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: Consuming Custom Collecction through a web service
Subject: Re: Consuming Custom Collecction through a web service

Agreed, web services share schema. Perhaps what I'm having a problem

with
is
properly serializing a custom collection. I'm experimenting with a

simple
class who's properties are simple data types; a type safe array list

that
contains a simple class who's properties are simple data types. No

nested
collections. So what I'm looking for is the proper way to serialize a
custom
collection.
"erymuzuan" wrote:
I can't give you an example for that, but bear in mind, Web Services
share schema(W3C XML Schema) not type for contract. thus anything that could be expressed as a valid Xml Schema can be expose(but for best
practice and interoperability... there some rules
http://devresource.hp.com/drc/slide_...SDL/index.jsp). so once the schema turn into proxy at the client side. they can modify it accordingly to achieve the desired behaviors as long as the
serialized objects is still valid Xml instant of the schema

regards
erymuzuan

kbs wrote:
> Hi,
>
> I'm looking for some good examples that illustrate how to code a web
service
> that exposes a custom collection so that the properties of the

collection are
> accessible on the client without having to do a httpwebreqeust

call. >
>


Nov 23 '05 #5

P: n/a
Then you can implement IList and ICloneable to your generated type from
WSDL. make sure is't still valid Xml for the schema, I would suggest
using SOAP sniffer such as SOAPScope to check the Xml over the wire.
regards
erymuzuan

Ken wrote:
My collection derive from IList and ICloneable.

"Christoph Schittko [MVP]" wrote:

You can definitely express arrays of simple types as XML schemas.

What are your "custom collections"? Are they collections deriving from
CollectionBase? Custom implementations if IList, etc?

Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: Ken [mailto:Ke*@discussions.microsoft.com]
Posted At: Sunday, January 23, 2005 9:51 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: Consuming Custom Collecction through a web service
Subject: Re: Consuming Custom Collecction through a web service

Agreed, web services share schema. Perhaps what I'm having a problem


with
is
properly serializing a custom collection. I'm experimenting with a


simple
class who's properties are simple data types; a type safe array list


that
contains a simple class who's properties are simple data types. No


nested
collections. So what I'm looking for is the proper way to serialize a
custom
collection.
"erymuzuan" wrote:
I can't give you an example for that, but bear in mind, Web Services
share schema(W3C XML Schema) not type for contract. thus anything


that
could be expressed as a valid Xml Schema can be expose(but for best
practice and interoperability... there some rules


http://devresource.hp.com/drc/slide_...SDL/index.jsp).
so once the schema turn into proxy at the client side. they can


modify
it accordingly to achieve the desired behaviors as long as the
serialized objects is still valid Xml instant of the schema

regards
erymuzuan

kbs wrote:

>Hi,
>
>I'm looking for some good examples that illustrate how to code a


web
service

>that exposes a custom collection so that the properties of the

collection are

>accessible on the client without having to do a httpwebreqeust


call.
>

Nov 23 '05 #6

P: n/a

If your collection implements IList, then the ASMX infrastructure will
only serialize the list elements, but not any other properties.

You need to declare the types in the list to the web service
infrastructure via XmlElement or XmlArrayItem attributes attached to the
return value or parameters (whichever applies to your case).

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: Ken [mailto:Ke*@discussions.microsoft.com]
Posted At: Sunday, January 23, 2005 5:53 PM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: Consuming Custom Collecction through a web service
Subject: Re: Consuming Custom Collecction through a web service

My collection derive from IList and ICloneable.

"Christoph Schittko [MVP]" wrote:
You can definitely express arrays of simple types as XML schemas.

What are your "custom collections"? Are they collections deriving from
CollectionBase? Custom implementations if IList, etc?

Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: Ken [mailto:Ke*@discussions.microsoft.com]
Posted At: Sunday, January 23, 2005 9:51 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: Consuming Custom Collecction through a web service
Subject: Re: Consuming Custom Collecction through a web service

Agreed, web services share schema. Perhaps what I'm having a problem
with
is
properly serializing a custom collection. I'm experimenting with a

simple
class who's properties are simple data types; a type safe array
list that
contains a simple class who's properties are simple data types. No

nested
collections. So what I'm looking for is the proper way to
serialize a custom
collection.
"erymuzuan" wrote:

> I can't give you an example for that, but bear in mind, Web Services > share schema(W3C XML Schema) not type for contract. thus anything that
> could be expressed as a valid Xml Schema can be expose(but for
best > practice and interoperability... there some rules
>

http://devresource.hp.com/drc/slide_...SDL/index.jsp).
> so once the schema turn into proxy at the client side. they can

modify
> it accordingly to achieve the desired behaviors as long as the
> serialized objects is still valid Xml instant of the schema
>
> regards
> erymuzuan
>
> kbs wrote:
> > Hi,
> >
> > I'm looking for some good examples that illustrate how to code

a web
service
> > that exposes a custom collection so that the properties of the
collection are
> > accessible on the client without having to do a httpwebreqeust

call.
> >
> >
>



Nov 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.