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

How - Convert Classe/DLL to Web Service?

I wrote an ASPX web application and a C# Classes which compiled as a
seperated DLLs. In my ASPX web app. I import that DLL as Reference.

How do I convert those Classes to Web Services? is it easy? so that other
ASPX web app can reuse my classes over the network. Is this possible? or do
I have to rewrite the classes?

Thanks a lot

Nov 19 '05 #1
3 3600
Its not that easy.. that's not really what a WebService is for.. it's usually
an entirely different animal.
Anyway, are all these sites on the same server? Put the DLL's in the GAC
perhaps, otherwise just add the reference to the other sites.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Zean Smith" wrote:
I wrote an ASPX web application and a C# Classes which compiled as a
seperated DLLs. In my ASPX web app. I import that DLL as Reference.

How do I convert those Classes to Web Services? is it easy? so that other
ASPX web app can reuse my classes over the network. Is this possible? or do
I have to rewrite the classes?

Thanks a lot

Nov 19 '05 #2

"Zean Smith" <no****@nospamaaamail.com> wrote in message
news:Mo*****************************************@r ogers.com...
I wrote an ASPX web application and a C# Classes which compiled as a
seperated DLLs. In my ASPX web app. I import that DLL as Reference.

How do I convert those Classes to Web Services? is it easy? so that other
ASPX web app can reuse my classes over the network. Is this possible? or
do I have to rewrite the classes?


Sure it's very easy. Just add a ASMX web service class to your project and
expose methods which use your DLL.

http://support.microsoft.com/default...b;en-us;308359
http://samples.gotdotnet.com/quickst...icesintro.aspx
You don't expose the classes directly; if that's what you need then you'll
need to share the assembly.

David
Nov 19 '05 #3
> How do I convert those Classes to Web Services? is it easy? so that other
ASPX web app can reuse my classes over the network. Is this possible? or
do I have to rewrite the classes?
You don't convert the classes. You write a web service that has web service
methods that talk to the class and send responses to the client. The
trickiest part is how you expose the classes (if necessary) to the web
client. Any data returned by a web service method must be serializable as
XML. That includes primitives, and classes. Primitives serialize
automatically, as do some CLR classes, such as DataSet, DataTable, and some
Collections. If you create custom classes, only parts of them can be
automatically serialized. Public primitive fields are automatically
serialized. Methods are not. In some cases, you may want or need to create a
custom XML Serializer for your class. However, be aware that unless there is
a corresponding XML desrializer on the other end, it may not be useful to do
so. Creating custom XML serializers and de-serializers is a bit more
advanced, but as of yet I haven't had to in any of my web services projects.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Zean Smith" <no****@nospamaaamail.com> wrote in message
news:Mo*****************************************@r ogers.com...I wrote an ASPX web application and a C# Classes which compiled as a
seperated DLLs. In my ASPX web app. I import that DLL as Reference.

How do I convert those Classes to Web Services? is it easy? so that other
ASPX web app can reuse my classes over the network. Is this possible? or
do I have to rewrite the classes?

Thanks a lot

Nov 19 '05 #4

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

Similar topics

2
by: grigoo | last post by:
bonjour a tous je me presente a vous::: greg dit le grigoo sur le web ,,etudiant en bioinformatique a montreal et jusqu au cou dans notre language prefere....java. et biojava.. et je suis en un...
3
by: jabailo | last post by:
I am running the following remoting server as a Console application, and I want to convert it to a Windows Service. static void Main(string args) {...
3
by: lamilla | last post by:
Salve a tutti, sto creando una applicazione che istanzia un thread al quale viene passato come argomento il puntatore ad una classe che contiene molte funzioni alcune delle quali devono essere...
1
by: Cloud Strife | last post by:
Salve ragazzi, qualcuno mi saprebbe indicare dove posso trovare i prototipi delle funzioni della classe string (magari se c'e' scritto come si usano e meglio^_^) ? please non mi dite di andare a...
0
by: Alexandre Martins | last post by:
Pessoal, quero chamar um application do global.asax numa classe, tem como ??
3
by: convert a Class Library to web service | last post by:
can i convert a Class Library to be share in the internet as a web service i what thet all my classes in the Class Library will be shared
4
by: perryclisbee via AccessMonster.com | last post by:
I have dates of service for several people that range all over each month. ie: patient had dates of service of: 7/3/2006, 7/24/2006 and 7/25/2006. I need to create a new field via a query that...
7
by: Rick | last post by:
I have a web service that I converted from VS 2003 Framework 1.1. to VS 2005 Framework 2.0. I tried to use the same IIS web site to run the web service. I deleted the Framework 1.1 files published...
0
by: sus124 | last post by:
Hello, I have a console application that I built for a filesystemwatcher in C#. I have to now convert it to a windows service. Since Express edition doesn't have an inbuilt template for windows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.