RE: Passing collection as input parameter to web service
From: Dan Rogers (danro_at_microsoft.com)
Date: 11/12/04
- Next message: Dan Rogers: "Re: Can SoapExtension class be used to handle headers from AXIS web se"
- Previous message: Dan Rogers: "RE: How to check whether web services are compliant with industry stan"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 12 Nov 2004 00:18:03 GMT
Hi,
The XmlSerializer needs to know the types that it will encounter in your
collection. The collection itself is fine, but you need to add an
XmlInclude attribute to your method call, one for each type that the
serializer will encounter when it goes to serialize the collection. The
data in the objects in the collection will have to be serializable types.
On the server side, the web service will need to expect an array of inputs
or a custom collection definition. Generally, one should build the calling
interface from a description of the server's interface. On the wire there
is little difference between a collection and an array, so usually you can
use a collection as a parameter anywhere you would expect to see an array,
and vice versa.
Regards
Dan Rogers
Microsoft Corporation
--------------------
>From: Guest <Guest@aew_nospam.com>
>X-Newsreader: AspNNTP 1.50 (aewnet.com)
>Subject: Passing collection as input parameter to web service
>Mime-Version: 1.0
>Content-Type: text/plain; charset="us-ascii"
>Content-Transfer-Encoding: quoted-printable
>Message-ID: <Ogfyq$ytEHA.1296@TK2MSFTNGP10.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
>Date: Wed, 20 Oct 2004 22:36:28 -0700
>NNTP-Posting-Host: 63.161.67.173
>Lines: 1
>Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
phx.gbl
>Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:26194
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
>Hi All !! I need to pass a collection(of complex objects) to web service
method for some processing at web service, but it gives me error "There was
an error generating XML" when i try to pass collection as an input paramter
to web service. Can anyone tell mehow i can pass collection object to web
service. Thanks in advance.
>User submitted from AEWNET (http://www.aewnet.com/)
>
- Next message: Dan Rogers: "Re: Can SoapExtension class be used to handle headers from AXIS web se"
- Previous message: Dan Rogers: "RE: How to check whether web services are compliant with industry stan"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|