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

Home Posts Topics Members FAQ

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.Collecti ons.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 4459
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*****@discus sions.microsoft .com> wrote in message
news:92******** *************** ***********@mic rosoft.com...
Hi,
I have a web service method which needs to return a hashtable.But it
gives errror as,

The type System.Collecti ons.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*****@discus sions.microsoft .com> wrote in message
news:92******** *************** ***********@mic rosoft.com...
Hi,
I have a web service method which needs to return a hashtable.But it
gives errror as,

The type System.Collecti ons.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******** ********@TK2MSF TNGP12.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*****@discus sions.microsoft .com> wrote in message
news:92******** *************** ***********@mic rosoft.com...
Hi,
I have a web service method which needs to return a hashtable.But it
gives errror as,

The type System.Collecti ons.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*****@discus sions.microsoft .com> wrote in message
news:92******** *************** ***********@mic rosoft.com...
Hi,
I have a web service method which needs to return a hashtable.But it
gives errror as,

The type System.Collecti ons.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******** ******@tk2msftn gp13.phx.gbl...

"William Stacey [MVP]" <st***********@ mvps.org> wrote in message
news:%2******** ********@TK2MSF TNGP12.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*****@discus sions.microsoft .com> wrote in message
news:92******** *************** ***********@mic rosoft.com...
Hi,
I have a web service method which needs to return a hashtable.But it gives errror as,

The type System.Collecti ons.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******** ********@TK2MSF TNGP12.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*****@discus sions.microsoft .com> wrote in message
news:92******** *************** ***********@mic rosoft.com...
Hi,
I have a web service method which needs to return a hashtable.But it
gives errror as,

The type System.Collecti ons.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******** ******@tk2msftn gp13.phx.gbl...

"William Stacey [MVP]" <st***********@ mvps.org> wrote in message
news:%2******** ********@TK2MSF TNGP12.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*****@discus sions.microsoft .com> wrote in message
news:92******** *************** ***********@mic rosoft.com...
Hi,
I have a web service method which needs to return a hashtable.But it gives errror as,

The type System.Collecti ons.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
3625
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 different than the one I usually use (xerces-2_1_0). If I compile all my code against the Sun xerces implementation, I get a class-def-not-found-error when trying to write any XML output. java.lang.NoClassDefFoundError:...
2
3859
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 parameter. I first thought I was doing something wrong with keys, but now i found out the Hashtable is empty (Count property returns 0) Code: public void RegisterClient(int id)
1
319
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 any way to return hashtable through a web method other than implementing the IDictionary? Please do tell me if any one knows.
12
6756
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 True. Therefore, overriding the Equals method in the class definition of the items I put in the ArrayList should make the IndexOf method use my version of the Equals method?!
0
4852
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 System.ServiceProcess.ServiceBase and overriding a few methods. It's detailed in the documentation. Once you have your service written, you'll need to add an installer
3
2103
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 on the other side the service reads messages for these clients from MSMQ and sends them to already connected clients. the clients can also send information back to the "HUB" which will be parsed and sent to MSMQ. when the clients connect to this...
16
4931
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 Microsoft must be installed on their servers. Now german Umlaute (ä, ü, ö) and quotes are returned incorrectly in SOAP fault responses. This can be easily verified: Implement the following in a web service method (just raises a SOAPException with a...
2
919
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, increments the value by 1 and then returns the number as a string. I had initially developed this on Win XP so when I did http://localhost/nameofwebservice and then test the method using the
9
3120
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 to store multicast delegates in a hash table, and then fire the delegates one of two ways (after registering/ creating the delegates, etc).
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
10330
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
10076
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
9144
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
7616
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?
1
4297
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
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.