Ask a Question related to ASP.NET Web Services, Design and Development.
-
Jeff Stewart #1
Derived class not exposed in XML
Say I have a class inherited from ArrayList called MyCollection. I have a
WebMethod that returns a MyCollection. But when I reference the service,
the WSDL indicates that the WebMethod returns an Object array (Object()).
When I try to assign the result to a MyCollection in my consumer, I'm told
that the 1-dimensional Object array cannot be converted to that type. Why
doesn't my service expose the class I've created if it's inherited from
ArrayList?
--
Jeff S.
Jeff Stewart Guest
-
Passing a derived class to a WebMethod
I am writing a client that consumes a web service and extends the functionality of one of the web service's classes. The definition is something... -
#26325 [Opn]: At least a notice when accessing private members in a derived class?
ID: 26325 User updated by: drm at melp dot nl Reported By: drm at melp dot nl Status: Open Bug Type: ... -
#26325 [NEW]: At least a notice when accessing private members in a derived class?
From: drm at melp dot nl Operating system: Windows XP PHP version: 5.0.0b2 (beta2) PHP Bug Type: Feature/Change Request Bug... -
WS Serialization of ArrayList derived Class
Hi Steve, You may refer to this article to see if it will help: Controlling XML Serialization Using Attributes... -
Access DataGrid declared in derived class from base class??
Hi! I have a base class called ListBase.vb, from which I derive EmplList.ascx.vb. In EmplList.ascx.vb I declared a... -
Brock Allen #2
Re: Derived class not exposed in XML
I'd suggest using arrays, not ArrayList or any such derived class. ArrayList
is a class that has semantics in the CLR, not in web services. This is almost
analgous to returning a SqlDataReader as a return value from a web method.
How can a java client make any sense of a SqlDataReader? Anyway, the point
is that you shouldn't bleed out .NET native types from your web method APIs
and instead create and use types that map well onto XML, XSD, SOAP and WSDL.
-Brock
DevelopMentor
[url]http://staff.develop.com/ballen[/url]
> Say I have a class inherited from ArrayList called MyCollection. I
> have a WebMethod that returns a MyCollection. But when I reference
> the service, the WSDL indicates that the WebMethod returns an Object
> array (Object()). When I try to assign the result to a MyCollection in
> my consumer, I'm told that the 1-dimensional Object array cannot be
> converted to that type. Why doesn't my service expose the class I've
> created if it's inherited from ArrayList?
>
> --
> Jeff S.
Brock Allen Guest
-
erymuzuan #3
Re: Derived class not exposed in XML
Always start with XSD in mind when writing a web services, stay
relatively simple. don't get too fancy with .Net objects. If you need to
use a kingd of array, use list or Collection this will normally create
and Xml element with maxOccurs="unbounded", inheritance , avoid it if
you can, other wise take a loot at XmlIncludeAttribute
regards
erymuzuan mustapa
Jeff Stewart wrote:> Say I have a class inherited from ArrayList called MyCollection. I have a
> WebMethod that returns a MyCollection. But when I reference the service,
> the WSDL indicates that the WebMethod returns an Object array (Object()).
> When I try to assign the result to a MyCollection in my consumer, I'm told
> that the 1-dimensional Object array cannot be converted to that type. Why
> doesn't my service expose the class I've created if it's inherited from
> ArrayList?
>
> --
> Jeff S.
>
>erymuzuan Guest
-
Jeff Stewart #4
Re: Derived class not exposed in XML
Philosophical differences and my opinion on Java aside, I'm very new to web
services. < 1 week and I'm supposed to be writing a service and a consumer.
Where does someone like me go to learn these kinds of gotchas?
--
Jeff S.
"Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
news:342226632480565288726400@msnews.microsoft.com ...> I'd suggest using arrays, not ArrayList or any such derived class.
> ArrayList is a class that has semantics in the CLR, not in web services.
> This is almost analgous to returning a SqlDataReader as a return value
> from a web method. How can a java client make any sense of a
> SqlDataReader? Anyway, the point is that you shouldn't bleed out .NET
> native types from your web method APIs and instead create and use types
> that map well onto XML, XSD, SOAP and WSDL.
>
> -Brock
> DevelopMentor
> [url]http://staff.develop.com/ballen[/url]
>
>
>>>> Say I have a class inherited from ArrayList called MyCollection. I
>> have a WebMethod that returns a MyCollection. But when I reference
>> the service, the WSDL indicates that the WebMethod returns an Object
>> array (Object()). When I try to assign the result to a MyCollection in
>> my consumer, I'm told that the 1-dimensional Object array cannot be
>> converted to that type. Why doesn't my service expose the class I've
>> created if it's inherited from ArrayList?
>>
>> --
>> Jeff S.
>
>
Jeff Stewart Guest
-
Brock Allen #5
Re: Derived class not exposed in XML
Hmm, well, that's a tough one. Personally, I sat in on a DevelopMentor course
on web services to get started and that's what opened by eyes. (Just in the
interest of full disclosure, I also work/teach for DevelopMentor -- just
to let you know :). But once I started actually doing integrations and writing
a ton of code then I saw these problems and how the framework and VS.NET
can hide the real issues from you. I don't have any good book recommendations
for web services; Sorry.
-Brock
DevelopMentor
[url]http://staff.develop.com/ballen[/url]
> Philosophical differences and my opinion on Java aside, I'm very new
> to web services. < 1 week and I'm supposed to be writing a service
> and a consumer. Where does someone like me go to learn these kinds of
> gotchas?
>
> --
> Jeff S.
> "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
> news:342226632480565288726400@msnews.microsoft.com ...
>>> I'd suggest using arrays, not ArrayList or any such derived class.
>> ArrayList is a class that has semantics in the CLR, not in web
>> services. This is almost analgous to returning a SqlDataReader as a
>> return value from a web method. How can a java client make any sense
>> of a SqlDataReader? Anyway, the point is that you shouldn't bleed out
>> .NET native types from your web method APIs and instead create and
>> use types that map well onto XML, XSD, SOAP and WSDL.
>>
>> -Brock
>> DevelopMentor
>> [url]http://staff.develop.com/ballen[/url]>>> Say I have a class inherited from ArrayList called MyCollection. I
>>> have a WebMethod that returns a MyCollection. But when I reference
>>> the service, the WSDL indicates that the WebMethod returns an Object
>>> array (Object()). When I try to assign the result to a MyCollection
>>> in my consumer, I'm told that the 1-dimensional Object array cannot
>>> be converted to that type. Why doesn't my service expose the class
>>> I've created if it's inherited from ArrayList?
>>>
>>> --
>>> Jeff S.
Brock Allen Guest



Reply With Quote

