Array of arrays

Hi I'm trying to return from a web service a array of arrays, one of the arrays is a array of objects, which I tested separately and it's working fine, and another array of integer and another of strings. When I run the web service I got this:You must implement a default accessor on System.Array because it inherits from ICollectionDefault accessor what that means? Thank you very much. 

 


As Heinlein said "specialization is for insects" explore beyond the universe.
0
rsegecin
7/7/2007 12:44:03 AM
asp.net.xml-web-services 7071 articles. 0 followers. Follow

8 Replies
750 Views

Similar Articles

[PageSpeed] 31

Could you pls post the relevant code ?
0
rukshan
7/7/2007 4:38:49 AM

hi rushan thank you for the reply the code is here:  

<%@ WebService Language="VB" Class="WebService4" %>

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

<WebService(Namespace := "http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _  
Public Class WebService4
    Inherits System.Web.Services.WebService 
    
    <WebMethod()> _
       Public Function myArray() As Array
        Dim myThreads As threads
        Dim threadsList As New ArrayList
        Dim page(0) As Integer
        Dim titles(1) As String
        Dim retorno(2) As Array

        myThreads = New threads
        myThreads.thread_id = 1
        myThreads.title = "MyFirstTitle"
        threadsList.Add(myThreads)

        myThreads = New threads
        myThreads.thread_id = 4
        myThreads.title = "MySecondTitle"
        threadsList.Add(myThreads)

        page(0) = 0

        titles(0) = "My first Title"
        titles(1) = "My second Title"
        
        retorno(0) = threadsList.ToArray(GetType(threads))
        retorno(1) = page
        retorno(2) = titles

        Return retorno
    End Function
    
    Class threads
        Public thread_id As Integer
        Public title As String
    End Class

End Class

As Heinlein said "specialization is for insects" explore beyond the universe.
0
rsegecin
7/7/2007 4:47:08 AM

Hi rsegecin,

I could figure out the reason for the error. The issues is in your return type Array. It is not a concrete type (abstract). 

Hope this info helps

Thanks

Ruk
 

0
rukshan
7/7/2007 6:05:44 AM

So it's not possible to return a array of second order from a web service? hmmmmm..... I could return a dataSet but it's not strongly typed, I would like strongly typed because it would run faster the application.... What could I do? Does anyone have Ideas? I tried to return a object but without success as well. Its frustrating saying that is impossible. The code should work.

  
As Heinlein said "specialization is for insects" explore beyond the universe.
0
rsegecin
7/7/2007 7:33:55 PM

It's possible if you want know just give me a shout.


As Heinlein said "specialization is for insects" explore beyond the universe.
0
rsegecin
7/8/2007 12:16:08 AM

 what did u do ?

0
rukshan
7/8/2007 3:43:00 AM

Take look the code that you will understand, but don't forget the parenthesis in the line 52 that indicate that the property is an array of threads:

1    <%@ WebService Language="VB" Class="WebService4" %>
2    
3    Imports System.Web
4    Imports System.Web.Services
5    Imports System.Web.Services.Protocols
6    
7    <WebService(Namespace := "http://tempuri.org/")> _
8    <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _  
9    Public Class WebService4
10       Inherits System.Web.Services.WebService 
11       
12       <WebMethod()> _
13          Public Function myArray() As tables
14           Dim threadsList As New ArrayList
15           Dim myThreads As threads
16           Dim posts As New posts
17           Dim tables As New tables
18   
19           posts.ha = False
20           posts.hey = "minha mãe"
21           
22           myThreads = New threads
23           myThreads.thread_id = "asda"
24           myThreads.title = "MyFirstTitle"
25           myThreads.na = 23
26           threadsList.Add(myThreads)
27           
28           myThreads = New threads
29           myThreads.thread_id = "efawef"
30           myThreads.title = "fawefawfa"
31           myThreads.na = 56
32           threadsList.Add(myThreads)
33           
34           tables.threads = threadsList.ToArray(GetType(threads))
35           tables.posts = posts
36           
37           Return tables
38       End Function
39       
40       Class threads
41           Public thread_id As String
42           Public title As String
43           Public na As Integer
44       End Class
45       
46       Class posts
47           Public hey As String
48           Public ha As Boolean
49       End Class
50   
51       Class tables
52           Public threads() As threads
53           Public posts As posts
54       End Class
55       
56   End Class
 
As Heinlein said "specialization is for insects" explore beyond the universe.
0
rsegecin
7/8/2007 3:51:20 AM

Got it ! thanks.. 

0
rukshan
7/8/2007 4:00:25 AM
Reply:

Similar Artilces:

Arrays, Arrays, Arrays
I mainly come from a JScript classic ASP background and I'm liking both C#.net and JScript.net. Now I have to say... "What's happened to arrays?" They used to be so flexible and easy to use. Here are my quick questions... Am I allowed to create an array with a non specified length so that I can add to it? If not then how can I modify an array's length? Can I create an array with a named index eg myArray["apple"] = "tasty"; or is the hash table the equivalent for this now? The classic array methods and properties like pop(), push(), length etc... are ...

Concatenating arrays from arrays of arrays
Hello - I am trying to accumulate items in a flat list (array) by concatenating on to it the scalars contained in arrays which in turn are contained in arrays. The data is to be read in from a file rather than existing as literals in my code. Everything I try either crashes the computer or gives me an array of arrays instead of a flat list. I have been programming in Unicon which has a concatenate operator, but Perl makes very heavy weather of nested list management. Should I switch to Lisp, or is there a way of doing what I want to do in Perl? Regards _John Sampson_ On...

How to unshift to an array in an array of arrays?
How to unshift to an array in an array of arrays? > -----Original Message----- > From: Angerstein [mailto:ang@nmc-m.dtag.de] > Sent: Wednesday, August 28, 2002 6:12 AM > To: beginners@perl.org > Subject: How to unshift to an array in an array of arrays? > > > How to unshift to an array in an array of arrays? $ perl -d -e 1 ..... DB<1> @aoa = ([qw(foo bar baz)]) << create array of arrays DB<2> x @aoa 0 ARRAY(0x80f82dc) 0 'foo' 1 'bar' 2 'baz' DB<3> unshift @{$aoa[0]}, 'qu...

referring to an array in an array of arrays
How can I get at an array in an array of arrays? I'm creating the arrays using: $fComments[$i++] = [ @comments ]; Now I want to get back what I put in: print "$fComments[0]\n"; but this prints ARRAY(0x107671f0). How do I follow that pointer? (I really think we need a pre-beginners list... =) TIA. - B You can try something like this: print "@{$fComments[0]}\n"; Which will attempt to dereference the array at $fComments[0]. -----Original Message----- From: Bryan R Harris [mailto:Bryan_R_Harris@raytheon.com] Sent: Tue...

Array of Arrays
Hi, I am looking for a way to create an array of arrays which needs to be passed to Oracle database to minimize the round trips to hte server. I was successful in sending simple arrays so far but no idea on how to create array of arrays in PB. I have used structures to simulate this but looks like I can't send the structure to Oracle. Anyone has any suggestions? Thanks, Anil Please don't cross-post. On 3 Mar 2005 14:02:47 -0800, Anil wrote: >Hi, > >I am looking for a way to create an array of arrays which >needs to be passed to Oracle database t...

Array of Array.
How is possible to declare a DYNAMIC array of array ? I need something like a dynamic hash table whose pages grow up dynamically too (each one can have different number of elements). In other words, a matrix that can be dynamic in both dimension. example: [1,2,3...] [3,4..] [5] [6,7,8,9...] [.] .. .. .. Have you considered using a DataStore? -- <hopethishelps/> Roy Kiesler [TeamSybase] SDN CodeXchange -- http://codexchange.sybase.com "Marco Meoni - News" <mmeoni@usl4.toscana.it> wrote in message news:401ba036$1@forums-2-dub... > How ...

Array of Arrays
Hi, I am looking for a way to create an array of arrays which needs to be passed to Oracle database to minimize the round trips to hte server. I was successful in sending simple arrays so far but no idea on how to create array of arrays in PB. I have used structures to simulate this but looks like I can't send the PB structure to Oracle. Anyone has any suggestions? Thanks, Anil PB 11 or 12 I believe will have this native. <Anil> wrote in message news:422789a4.721c.1681692777@sybase.com... > Hi, > > I am looking for a way to create an array of ar...

array of arrays
Hi, I have a simple question: how do I access an array in an array? @array = (@array1, array2); ### unless this is wrong... the idea behind it is, that I have a long list, and want to put all 25 entries in a seperate array in that big array. later on I want to be able to read one specific array at a certain position... -- cheers alex mailto:Keex@gmx.de you need to learn about references. read the: perldoc perllol here is the jist though. @all = (\@array1, \@array2 ... ); # ... so on to access first array and first element...

An array of arrays
Could anybody help me out here? Here's the message I just got from a guy I know: ----------- I was wondering if you know how to create and access an array of arrays in Perl. Basically I'm parsing an exported text file containing e-mails and I think I want to move some fields into arrays until I'm ready to do my report. Here basically is what I'm looking at doing: ^ | | Array 1 (messages) | | v <------ Array 2 -------> (message fields:FROM, TO, CC, etc, sensitivity, etc) I want to be able to search through the first array to count how many messag...

array of arrays
Hi. =20 Im using a multidimensional array in the following way: $array[$i][$j][$k] =3D [ @list ]; where, @list is a 2-D array ie. = $list[][]. How do I access the individual elements of the array @list once Ive put it = into the array @array? Thanks. -ty On Thu, Oct 18, 2001 at 02:28:41PM -0600, Tyler Cruickshank wrote: > $array[$i][$j][$k] = [ @list ]; where, @list is a 2-D array ie. $list[][]. > > How do I access the individual elements of the array @list once Ive put it > into the array @array? $array[$i][$j][$k][$l][$m] eq $list[$l][$m] Howev...

[@array] and \@array
Given the case, my @array = (1,2,3,4); my $var1 = [@array]; my $var2 = \@array; What's the difference between $var1 and $var2? Are they all refered to @array? Thanks guys. On 3/22/07, Jm lists <practicalperl@gmail.com> wrote: > Given the case, > > my @array = (1,2,3,4); > my $var1 = [@array]; > my $var2 = \@array; > > What's the difference between $var1 and $var2? > Are they all refered to @array? > Thanks guys. $var2 is a reference to @array. $var1 is a reference to new array. Observe #!/usr/bin/perl use strict; use war...

consuming web service: Value of 1-dimensionnal array of 1-dimensional array of MyObj
Hi I wanna consume a web service that returns this kind of data:The web method returns an array of another array of let's say: MyResponse I want to use the code bellow to get the xml results:Dim xRoot As XmlElementDim ws As New myWebServicexRoot = ws.GetCtrByCtrNumber(MyArgument) Dim nt As New NameTableDim nsmgr As New XmlNamespaceManager(nt)But the probelem is that I can't even compile:I get is this in the VS 2005: Value of 1-dimensionnal array of 1-dimensional array of MyResponse can not be converted to xmlelement.So I am not sure how I can fill the xroot variable from the returned...

Nested NVO array
We are calling a web service from PB11 using the .NET engine. This worked in PB10.5.1 (also using the .NET engine) when the wsdl was converted into structures by the proxy generator. In PB11 the wsdl is converted into NVOs. In this particular web service we get one NVO containing an array of another NVO. This is one of the input parameters to the web service. Once the contained NVO array is greater than length 1 this whole input parameter is not being sent to the web service (we can see this with TCPTrace). In order to construct the input data we are creating the outer NVO, t...

Web Service apache axis array problem in .net client
I am trying to use a Web Service generated on Apache Axis and complex types(arrays) only get empty array. http://cattest.tecdoc.net/pegasus-1-1b/services/TecdocToCatWL?wsdl I am testing: getFuelTypes My code VS2005 VB: Dim Service As TecdocToCatSkeletonService = New TecdocToCatSkeletonService Dim aa As FuelTypesRequest = New FuelTypesRequest     aa.provider = 147    aa.lang = "pt" Dim ftypes As FuelTypesResponse = New FuelTypesResponse()     ftypes = Service.getFuelTypes(aa) I made a proxy with wsdl.exe and change the proxy to...

Web resources about - Array of arrays - asp.net.xml-web-services

Array - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Search with Relcy for an array of relevant, reliable results
... on the bandwagon? or Enjoy Apple TV 4 screensavers on Mac OS X with Aerial . Relcy - The Fastest Way to Find Search with Relcy for an array ...

GM to build solar array at transmission plant
Filed under: Green , Plants/Manufacturing , GM , Technology , Solar GM is partnering to build its largest solar array in Michigan near the Warren ...

New books for animal lovers deliver array of adventures, information
Who's on the bookshelves this month? Dogs, wolves, birds and cats. And butterflies. Beautiful butterflies. Here are some of the new animal-related ...

Rarely Seen ‘Ashes And Embers’ Getting Restoration & Distribution From Ava DuVernay‘s Array Releasing ...
Ava DuVernay 's Array Releasing has acquired director Haile Gerima ’s rarely-seen classic Ashes And Embers and will give it full restoration, ...

Violin All-Flash Arrays Aimed at High-end, Starter Markets
Take your pick: 140TB of raw flash in three-rack units, with 1.1 million IOPS, or a not-quite-as-fast starter array for under $100,000.

Sheldon Silver, Longtime Titan of New York Politics, Guilty On Array of Corruption Charges
Sheldon Silver, who has been speaker of the New York State Assembly for 20 years, was found guilty today in federal court of seven corruption ...

Alien megastructures? SETI Institute’s Allen Telescope Array targets weirdly winking star
One of the premier telescope arrays in the search for extraterrestrial intelligence, or SETI, is focusing its antennas on an anomalously blinking ...

El Cheapo Phased-Array Sonar
... — the range to the closest object that the speaker is pointing at. It doesn’t have to be that way. [Graham Chow] built a simple phased-array ...

‘Geminid’ Meteor Shower: Scintillating Array Of ‘Shooting Stars’ To Illuminate December Night Sky
Stargazers across the world will witness a wondrous array of spectacular shooting stars illuminating the night sky this weekend. The mesmerizing ...

Resources last updated: 12/18/2015 12:17:58 AM