473,804 Members | 3,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WCF cannot deserialise nested arrays

Hi,

I have a WCF service contract which has message containing a List<MyType>
data member where MyType consists of a string Key and object Value.

As expected this gets exposed as a MyType[] array in the service reference.

In the client, I dynamically add Key/Value entries in the list.

This works fine as long as I use simple types in the client, but I need to
add a nested array into this list. That is, I need an element in the list
which is itself a MyType[] array.

When I send a message with a nested array, the server simply 'ignores' the
message. I know that the message arrives as I've got an
IDispatchMessag eInspector class which logs everything that's received.

Is there a way for me to acheive this, without going down the manually
deserializing route?

Many thanks,

Barney.

Jul 8 '08 #1
1 5331
I have found the solution: you need to assign the
[KnownType(typeo f(List<MyType>) )] attribute to the message class.

"BarneyLigh t" wrote:
Hi,

I have a WCF service contract which has message containing a List<MyType>
data member where MyType consists of a string Key and object Value.

As expected this gets exposed as a MyType[] array in the service reference.

In the client, I dynamically add Key/Value entries in the list.

This works fine as long as I use simple types in the client, but I need to
add a nested array into this list. That is, I need an element in the list
which is itself a MyType[] array.

When I send a message with a nested array, the server simply 'ignores' the
message. I know that the message arrives as I've got an
IDispatchMessag eInspector class which logs everything that's received.

Is there a way for me to acheive this, without going down the manually
deserializing route?

Many thanks,

Barney.
Jul 8 '08 #2

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

Similar topics

0
1942
by: Matthew Barnes | last post by:
I was wondering if there would be any interest in extending the struct.unpack format notation to be able to express groups of data with parenthesis. For example: >>> data = struct.pack('iiii', 1, 2, 3, 4) >>> struct.unpack('i(ii)i', data) # Note the parentheses (1, (2, 3), 4)
5
1641
by: naturalborncyborg | last post by:
Hi, I'm using nested lists as arrays and having some problems with that approach. In my puzzle class there is a swapelement method which doesn't work out. Any help and comments on the code will be appreciated. Thanks. # Puzzle.py # class for a sliding block puzzle # an starting state of a 8-puzzle could look like the following: # where X is an empty space and the move up in the example would move
5
1955
by: TheKeith | last post by:
I can't figure out why this doesn't work: --------------------------------------------- greeting = new Array(); greeting = "hey"; greeting = "bye"; trace(greeting + greeting);
1
2369
by: elixxir | last post by:
Hiho, I'm trying to deserialize the following XML feed from the weather channel but I'm having an issue with the nested arrays. I got as far as getting the 'day' into arrays but I can't get the 'part' nested array working. This is my first hack at XML feeds and such, so any pointers as to how to best do this or references/tutorials would be good. (I'm doing all this in .NET 2.0 btw)
1
2830
by: Philip K | last post by:
I was trying to use an XML file to save some program settings. But cannot serialise the settings object if it contains a Font object (even though Font is maked in the MS documentation. Dies in new XmlSerializer(typeof(JigViewSettings)); What am I doing wrong ? Code:
9
2397
by: Bill Grigg | last post by:
All, Can anyone supply an example or reference to an example of using reflection to determine the data types and array lengths contained in a nested stucture in C#? Actually, it is a structure that I use to communicate to some unmanaged code in a DLL written in C. It is not complicated, but will change and I would like to be able to sequentially access it without explicitly referring to each and every element. Here is the structure:
2
3523
by: bill | last post by:
The IMAP_headers function returns an associative array. for example: $head = imap_header($in, ($index+1)); echo " <br />header:subject:" . $head->subject; works fine, but $head->from returns an array
8
5945
by: Sheldon | last post by:
Hi, Can anyone help with this problem with setting up nested structures and initializing them for use. I have created several structs and placed them in a super struct that I will then pass to some functions. I have defined them in the following manner: typedef struct trans Transient; typedef struct sats Satellites;
3
5170
by: Robert Mark Bram | last post by:
Hi all, I have some code to iterate through nested associative arrays. Can anyone please tell me what I am doing wrong? :) var dealers = new Array(); var dealer1 = new Array(); dealer1 = "Jefferson Ford Pty Ltd"; dealer1 = "215-217 Normanby Rd South Melbourne VIC 3205";
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10326
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9143
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.