473,378 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Having troubles with serializing object collections

When I attempt to expose a Web service method to populate a collection, .NET
turns the collection into an array when I reference the Web service. This
will not work for me without some big code changes. Any ideas how I can get
the collection to pass normally? I get a "can not be reflected" error when I
try to change the Reference.vb code back into object collections. When I
serialize the data myself it works fine. I can pass the objects back and
forth without problem.

Web serivice code:

<WebMethod(Description:="Retrieves Collection From Server",
EnableSession:=True)_
Public Function GetColl(ByRef Coll As Mycollection) As Long
Dim Server As Server.SQL = MyClass.Server
Return Server.GetCollection(Coll)
End Function

Auto-generated code from client consuming Web service:
<System.Web.Services.Protocols.SoapDocumentMethodA ttribute("removed",
RequestNamespace:="removed", ResponseNamespace:="removed",
Use:=System.Web.Services.Description.SoapBindingUs e.Literal,
ParameterStyle:=System.Web.Services.Protocols.Soap ParameterStyle.Wrapped)_
Public Function GetColl(ByRef Colls() As MyCollection) As Long
Dim results As Object = Me.Invoke("GetColls", New Object()
{Mycollection})
Mycollection = CType(results(1), Mycollection())
Return CType(results(0),Long)
End Function
Jul 12 '06 #1
0 863

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: n8wei | last post by:
Hi, I seem to be having a bit of a problem serializing a complex object into XML. I've done this many times with simpler objects and it's always worked just fine. The error I'm getting is...
1
by: Rein Petersen | last post by:
Hi Everyone! I hope someone may have experience serializing a NameObjectCollectionBase (System.Collections.Specialized) and can advise me as to why I receive this error (below) when I try to...
0
by: Kenneth Baltrinic | last post by:
Is the following code correct for serializing a quasi-single class, that is a class that has a descreet (though more than one, so not a true singleton) number of static instances and no dynamically...
1
by: chaitanyag | last post by:
Hi, I have my data stored in a set of classes (or structs, doesn't matter), which I am trying to serialize. These classes are stored in an ArrayList, which serializes ok when all the objects in...
0
by: Jordan Bowness | last post by:
I make a similar post in another newsgroup, but this example is simplified somewhat. I have a component (cmpMyComponent) with 2 properties. The 1st property is a string value (Description) and...
0
by: Michael Maercker | last post by:
Hi! I'm about to go nuts over my serializing problem. This is my situation: I have a Data-Class that can have children of the same class which are stored in a hashtable, i.e: X has A as a...
3
by: RandomEngineer | last post by:
So here's the challenge... How can a collection (System.Collections.Generic.IList) of some custom type be serialized in a web service using .NET 2.0? Below are the class and the web methods in...
9
by: Jeffro | last post by:
Ok I have some troubles with my code. I don't need a full solution. I just want to know what i should do best for this situation. The idea is to calculate the amount of money that will be on the...
1
by: Karthik1979 | last post by:
I have a custom class inherited from List<T> collection. Along with the base class functionality, I have included my additional properties. When serializing, only the base class items are serialized...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.