473,396 Members | 1,816 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,396 software developers and data experts.

Problem in defining web service method which returns Hashtable

Hi,
I have a web service method which needs to return a hashtable.But it
gives errror as,

The type System.Collections.Hashtable is not supported because it implements
IDictionary.

Is there any way to return hashtable through a web method other than
implementing the IDictionary?
Please do tell me if any one knows.
Nov 16 '05 #1
7 4437
I think I remember they found a way to serialize HT in 2.0. Until then, you
could just implement a simple class with two public fields, a string for the
key and your type as the value. Then just return an array of that class
(after you fill it from the hashtable). I am thinking about WSE web methods
here. Not sure this will work with IIS web methods.

--
William Stacey, MVP
http://mvp.support.microsoft.com

"Kalyani" <Ka*****@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
Hi,
I have a web service method which needs to return a hashtable.But it
gives errror as,

The type System.Collections.Hashtable is not supported because it implements IDictionary.

Is there any way to return hashtable through a web method other than
implementing the IDictionary?
Please do tell me if any one knows.


Nov 16 '05 #2
Hi,

Nope..

supported data types can be found here

http://msdn.microsoft.com/library/de.../datatypes.asp

By the way are u a Sri Lanka..

Regards,
Nirosh.

"Kalyani" <Ka*****@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
Hi,
I have a web service method which needs to return a hashtable.But it
gives errror as,

The type System.Collections.Hashtable is not supported because it implements IDictionary.

Is there any way to return hashtable through a web method other than
implementing the IDictionary?
Please do tell me if any one knows.

Nov 16 '05 #3

"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I think I remember they found a way to serialize HT in 2.0. Until then, you could just implement a simple class with two public fields, a string for the key and your type as the value. Then just return an array of that class
(after you fill it from the hashtable). I am thinking about WSE web methods here. Not sure this will work with IIS web methods.
Will WSE make any differences to the return type of the webmethod William?,
I mean if it works with WSE theoritically it should work with normal
webmethod...


--
William Stacey, MVP
http://mvp.support.microsoft.com

"Kalyani" <Ka*****@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
Hi,
I have a web service method which needs to return a hashtable.But it
gives errror as,

The type System.Collections.Hashtable is not supported because it

implements
IDictionary.

Is there any way to return hashtable through a web method other than
implementing the IDictionary?
Please do tell me if any one knows.

Nov 16 '05 #4
I think I remember they found a way to serialize HT in 2.0. Until then, you
could just implement a simple class with two public fields, a string for the
key and your type as the value. Then just return an array of that class
(after you fill it from the hashtable). I am thinking about WSE web methods
here. Not sure this will work with IIS web methods.

--
William Stacey, MVP
http://mvp.support.microsoft.com

"Kalyani" <Ka*****@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
Hi,
I have a web service method which needs to return a hashtable.But it
gives errror as,

The type System.Collections.Hashtable is not supported because it implements IDictionary.

Is there any way to return hashtable through a web method other than
implementing the IDictionary?
Please do tell me if any one knows.


Nov 16 '05 #5
I would say "should" as I have been using WSE mostly and forgot if custom
types and arrays of types return ok with std web services. Easy to hack up
a quick test to know for sure.

--
William Stacey, MVP
http://mvp.support.microsoft.com

"Champika Nirosh" <te**@test.lk> wrote in message
news:O9**************@tk2msftngp13.phx.gbl...

"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I think I remember they found a way to serialize HT in 2.0. Until then, you
could just implement a simple class with two public fields, a string for

the
key and your type as the value. Then just return an array of that class
(after you fill it from the hashtable). I am thinking about WSE web

methods
here. Not sure this will work with IIS web methods.


Will WSE make any differences to the return type of the webmethod

William?, I mean if it works with WSE theoritically it should work with normal
webmethod...


--
William Stacey, MVP
http://mvp.support.microsoft.com

"Kalyani" <Ka*****@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
Hi,
I have a web service method which needs to return a hashtable.But it gives errror as,

The type System.Collections.Hashtable is not supported because it

implements
IDictionary.

Is there any way to return hashtable through a web method other than
implementing the IDictionary?
Please do tell me if any one knows.



Nov 16 '05 #6

"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I think I remember they found a way to serialize HT in 2.0. Until then, you could just implement a simple class with two public fields, a string for the key and your type as the value. Then just return an array of that class
(after you fill it from the hashtable). I am thinking about WSE web methods here. Not sure this will work with IIS web methods.
Will WSE make any differences to the return type of the webmethod William?,
I mean if it works with WSE theoritically it should work with normal
webmethod...


--
William Stacey, MVP
http://mvp.support.microsoft.com

"Kalyani" <Ka*****@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
Hi,
I have a web service method which needs to return a hashtable.But it
gives errror as,

The type System.Collections.Hashtable is not supported because it

implements
IDictionary.

Is there any way to return hashtable through a web method other than
implementing the IDictionary?
Please do tell me if any one knows.

Nov 16 '05 #7
I would say "should" as I have been using WSE mostly and forgot if custom
types and arrays of types return ok with std web services. Easy to hack up
a quick test to know for sure.

--
William Stacey, MVP
http://mvp.support.microsoft.com

"Champika Nirosh" <te**@test.lk> wrote in message
news:O9**************@tk2msftngp13.phx.gbl...

"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I think I remember they found a way to serialize HT in 2.0. Until then, you
could just implement a simple class with two public fields, a string for

the
key and your type as the value. Then just return an array of that class
(after you fill it from the hashtable). I am thinking about WSE web

methods
here. Not sure this will work with IIS web methods.


Will WSE make any differences to the return type of the webmethod

William?, I mean if it works with WSE theoritically it should work with normal
webmethod...


--
William Stacey, MVP
http://mvp.support.microsoft.com

"Kalyani" <Ka*****@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
Hi,
I have a web service method which needs to return a hashtable.But it gives errror as,

The type System.Collections.Hashtable is not supported because it

implements
IDictionary.

Is there any way to return hashtable through a web method other than
implementing the IDictionary?
Please do tell me if any one knows.



Nov 16 '05 #8

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

Similar topics

3
by: Roy Benjamin | last post by:
I'm developing a WEB service for Sun ONE deployment (AppServer7). I'm developing on Windows XP Pro though will deploy on Solaris, Sun AppServer7 includes a XercesImpl.jar in share/lib. 2 kb...
2
by: Marek | last post by:
I am having a problem with Hashtable used in XML web server. I have a WebMethod where clients get registered and added into hashtable. Later, I call another web method which has client ID as...
1
by: Kalyani | last post by:
Hi, I have a web service method which needs to return a hashtable.But it gives errror as, The type System.Collections.Hashtable is not supported because it implements IDictionary. Is there...
12
by: Rubbrecht Philippe | last post by:
Hi there, According to documentation I read the ArrayList.IndexOf method uses the Object.Equals method to loop through the items in its list and locate the first index of an item that returns...
0
by: Anonieko Ramos | last post by:
Self Installing Service Enter a topic name to show or a new topic name to create; then press Enter .. Start by writing a service. This involves deriving a class from...
3
by: danavni | last post by:
i need to build a service that will accept incoming TCP/IP connections. the service should act like a "HUB" where on one side clients connect to it and stay connected for as long as they like and...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: sumeetkbali | last post by:
Hi, I have a web-service that does the following: It has a number(int) stored in the web config file(under appsettings tag) so everytime you call that web method, it reads the config file,...
9
by: raylopez99 | last post by:
Hello all— I’m trying to get the below to work and cannot get the format right. It’s from this example: http://msdn.microsoft.com/en-us/library/8627sbea(VS.71).aspx What it is: I’m trying...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.