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

Home Posts Topics Members FAQ

Custom types

Which is the best and convenient way to send/retrun custom types to/from Web
Service? Serialization?

The web service is not to be public accessible, it's a part of n-tier
application.

TIA

Nov 19 '05 #1
20 1230
Nikolay,

In my opinion it is just using it, most serialization is done for you by
VSNet. When not as with an arraylist you have to decide what you do, however
it will always be serialized by VSNet to XML.

Just my thought,

Cor

"Nikolay Petrov"
Which is the best and convenient way to send/retrun custom types to/from
Web Service? Serialization?

The web service is not to be public accessible, it's a part of n-tier
application.

TIA

Nov 19 '05 #2
Cor Ligthert wrote:
Nikolay,

In my opinion it is just using it, most serialization is done for you
by VSNet. When not as with an arraylist you have to decide what you
do, however it will always be serialized by VSNet to XML.

Just my thought,

Cor

I have tried returning some custom type from a webservice. Some data
did get through, but in a *generated* class that only has *some* resemblance
to the original type. Do you know if there is some way to have the calling
side use the same type (apart from creating that "by hand" and copying
all values)?

Hans Kesting

"Nikolay Petrov"
Which is the best and convenient way to send/retrun custom types
to/from Web Service? Serialization?

The web service is not to be public accessible, it's a part of n-tier
application.

TIA

Nov 19 '05 #3
What I need mostly is to return data with different types as strings,
integers an so, currently I don't need to return classes or something like
them.

Is it appropriate to use hash tables?
"Hans Kesting" <ne***********@ spamgourmet.com > wrote in message
news:Oj******** ******@TK2MSFTN GP12.phx.gbl...
Cor Ligthert wrote:
Nikolay,

In my opinion it is just using it, most serialization is done for you
by VSNet. When not as with an arraylist you have to decide what you
do, however it will always be serialized by VSNet to XML.

Just my thought,

Cor


I have tried returning some custom type from a webservice. Some data
did get through, but in a *generated* class that only has *some*
resemblance
to the original type. Do you know if there is some way to have the calling
side use the same type (apart from creating that "by hand" and copying
all values)?

Hans Kesting

"Nikolay Petrov"
Which is the best and convenient way to send/retrun custom types
to/from Web Service? Serialization?

The web service is not to be public accessible, it's a part of n-tier
application.

TIA


Nov 19 '05 #4
Nikolay Petrov wrote:
What I need mostly is to return data with different types as strings,
integers an so, currently I don't need to return classes or something
like them.

Is it appropriate to use hash tables?


Do you mean you want to have a webservice method that returns an int
(and another that returns a string)? That is easy, just declare the method in
the asmx as returning an int. When you call this you will get an integer back.
For these basic types serialization issues are handled automatically by the
system, you don't need to do anything special.

Hans Kesting
Nov 19 '05 #5
Hans,

Did you made those classes <serializable >?

Cor
Nov 19 '05 #6
Nikolay,

When you need a table, than in my opinion is the most easy one to use the
dataset.
Everything is than done for you.

I hope this helps,

Cor

"Nikolay Petrov"
What I need mostly is to return data with different types as strings,
integers an so, currently I don't need to return classes or something like
them.

Is it appropriate to use hash tables?
"Hans Kesting" <ne***********@ spamgourmet.com > wrote in message
news:Oj******** ******@TK2MSFTN GP12.phx.gbl...
Cor Ligthert wrote:
Nikolay,

In my opinion it is just using it, most serialization is done for you
by VSNet. When not as with an arraylist you have to decide what you
do, however it will always be serialized by VSNet to XML.

Just my thought,

Cor


I have tried returning some custom type from a webservice. Some data
did get through, but in a *generated* class that only has *some*
resemblance
to the original type. Do you know if there is some way to have the
calling
side use the same type (apart from creating that "by hand" and copying
all values)?

Hans Kesting

"Nikolay Petrov"

Which is the best and convenient way to send/retrun custom types
to/from Web Service? Serialization?

The web service is not to be public accessible, it's a part of n-tier
application.

TIA



Nov 19 '05 #7
No I need to return both in one call.

As you would declare structure

Structure Type
Dim Digit as Integer
Dim Text as String
End Structure

I want to return something similar, no need to be structure just I need to
return strings, integers, booleans as a whole.
"Hans Kesting" <ne***********@ spamgourmet.com > wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Nikolay Petrov wrote:
What I need mostly is to return data with different types as strings,
integers an so, currently I don't need to return classes or something
like them.

Is it appropriate to use hash tables?


Do you mean you want to have a webservice method that returns an int
(and another that returns a string)? That is easy, just declare the method
in
the asmx as returning an int. When you call this you will get an integer
back.
For these basic types serialization issues are handled automatically by
the
system, you don't need to do anything special.

Hans Kesting

Nov 19 '05 #8
Nikolay Petrov wrote:
No I need to return both in one call.

As you would declare structure

Structure Type
Dim Digit as Integer
Dim Text as String
End Structure

I want to return something similar, no need to be structure just I
need to return strings, integers, booleans as a whole.


So you want to return a single value, but you can't declare as (for ex.) "string"
because it also can be int, bool, ...
Would it work to just declare it as "object"? The receiving side should
then check the type ("is bool", "is int", .. (in C# syntax) ) to handle it further.

Hans Kesting

"Hans Kesting" <ne***********@ spamgourmet.com > wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Nikolay Petrov wrote:
What I need mostly is to return data with different types as
strings, integers an so, currently I don't need to return classes
or something like them.

Is it appropriate to use hash tables?


Do you mean you want to have a webservice method that returns an int
(and another that returns a string)? That is easy, just declare the
method in
the asmx as returning an int. When you call this you will get an
integer back.
For these basic types serialization issues are handled automatically
by the
system, you don't need to do anything special.

Hans Kesting

Nov 19 '05 #9
Nikolay,

As advice do not use a structure for this just a serializable class.

<Serializable() > Public Class Myfields
Public fielda As Integer
Public fieldb As String
End Class

In this message is a sample I made some months ago

http://groups-beta.google.com/group/...4488e73599d6fa

I hope this helps?

Cor

"Nikolay Petrov" <jo************ **@mail.bg>
..
No I need to return both in one call.

As you would declare structure

Structure Type
Dim Digit as Integer
Dim Text as String
End Structure

I want to return something similar, no need to be structure just I need to
return strings, integers, booleans as a whole.
"Hans Kesting" <ne***********@ spamgourmet.com > wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Nikolay Petrov wrote:
What I need mostly is to return data with different types as strings,
integers an so, currently I don't need to return classes or something
like them.

Is it appropriate to use hash tables?


Do you mean you want to have a webservice method that returns an int
(and another that returns a string)? That is easy, just declare the
method in
the asmx as returning an int. When you call this you will get an integer
back.
For these basic types serialization issues are handled automatically by
the
system, you don't need to do anything special.

Hans Kesting


Nov 19 '05 #10

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

Similar topics

4
1600
by: CrispinH | last post by:
I'm building an application generator and within it a user can create a new property (for the class they are building). I'd like then to offer a list of Types - built-in and custom - for this new property to be shown in a combo box ie similar to Intellisense. How do you enumerate the Types available? Are their mechanisms for filtering the list to show only (say) primitive types or custom types or reference types? TIA
5
6916
by: mtv | last post by:
Hi all, I have the following code: ================================ Webservice side: public class MyWS: WebService { private myLib.DataObject curDataObject;
6
2338
by: kbs | last post by:
Hi, I'm looking for some good examples that illustrate how to code a web service that exposes a custom collection so that the properties of the collection are accessible on the client without having to do a httpwebreqeust call.
1
1469
by: Kris | last post by:
I read a column on sharing types between web services at http://msdn.microsoft.com/library/en-us/dnservice/html/service07162002.asp Sharing types can be acheived, similar to what described here in this article but little defferently, by defining these custom types in a seperate assembly and importing that assembly at the top of the proxy generated and then manullay deleting the redefined custom types in each proxy class. But still this...
12
5343
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded the custom employee class and have built it as a separate library (employee.dll). This employee.dll is being referenced by both the web service and the windows application. I face the following problem when I send this class to the webservice.
7
4748
by: John Grandy | last post by:
My ASP.NET Web Service project has a Web Method that returns an array filled with instances of a custom class. The custom class is defined in a Class Library that is included in the web-service project. The same class lib is included in the ASP.NET Web Application that calls the web-method I can successfully call the web-method with
2
2100
by: gbanister | last post by:
I'd like to repost a message that I found in this group almost one year ago, because it's the exact problem I'm in and there was no solution offered to this post last year. (note: I was not the original author of the below post) I have similar issue sharing types between the web services, and also the client consuming those web services. I have all my custom types defined in a seperate assembly and I am using those types as parameter/...
11
10155
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I have worked with application settings in VS2005 and C# for awhile, but usually with standard types. I have been trying to store a custom container/class/type in an application setting and I have seen erratic results. I am aware of one known defect where user classes do not show up in the list of types on the Property/Settings page in the visual designer and I am wondering if I am encountering some other peculiar issue, or if there are...
2
19496
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
0
2897
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
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...
1
10323
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
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
9160
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
7622
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
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
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...
1
4301
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
2
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.