Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - How - Convert Classe/DLL to Web Service?

 
Thread Tools Search this Thread
Old 08-31-2005, 02:44 PM   #1
Default 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





Zean Smith
  Reply With Quote
Old 08-31-2005, 02:52 PM   #2
=?Utf-8?B?Q3VydF9DIFtNVlBd?=
 
Posts: n/a
Default RE: How - Convert Classe/DLL to Web Service?
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
>
>
>
>



=?Utf-8?B?Q3VydF9DIFtNVlBd?=
  Reply With Quote
Old 08-31-2005, 03:12 PM   #3
David Browne
 
Posts: n/a
Default Re: How - Convert Classe/DLL to Web Service?

"Zean Smith" <> wrote in message
news:Mo-dnZ2dnZ2jIQ3knZ2dndopiN6dnZ2dRVn-...
>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




David Browne
  Reply With Quote
Old 08-31-2005, 04:35 PM   #4
Kevin Spencer
 
Posts: n/a
Default Re: How - Convert Classe/DLL to Web Service?
> 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" <> wrote in message
news:Mo-dnZ2dnZ2jIQ3knZ2dndopiN6dnZ2dRVn-...
>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
>
>
>





Kevin Spencer
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Rip DVD and Convert Video on Mac OS dave345 Media 12 07-07-2008 09:32 AM
Novice needs help with Adserver.Adtech.de CPU Rookie General Help Related Topics 3 05-10-2008 05:54 PM
Trojan Horse! AHHH! okstatefan@swbell.net A+ Certification 11 02-08-2005 07:12 PM
Re: High Gasoline Prices Create A+ Service Opportunities Frederic A+ Certification 3 01-17-2004 11:38 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46