Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

How - Convert Classe/DLL to Web Service?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Zean Smith - 31 Aug 2005 14:44 GMT
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
Curt_C [MVP] - 31 Aug 2005 14:52 GMT
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.

Signature

Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.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.
[quoted text clipped - 4 lines]
>
> Thanks  a lot
David Browne - 31 Aug 2005 15:12 GMT
>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.aspx?scid=kb;en-us;308359
http://samples.gotdotnet.com/quickstart/aspplus/doc/webservicesintro.aspx

You don't expose the classes directly; if that's what you need then you'll
need to share the assembly.

David
Michael Nemtsev - 31 Aug 2005 17:16 GMT
Hello David Browne" davidbaxterbrowne no potted,

But we need take into account that
"the behavior of the called interface is quite different depending on location.
From the client perspective, a remote implementation of the interface is
subject to network latency, network failure, and distributed system failures
that do not exist with local implementations. A significant amount of error
detection and correction logic must be written to anticipate the impacts
of using remote object interfaces.
"

As was mentioned by Curt_C they are different animals

D> Sure it's very easy.  Just add a ASMX web service class to your
D> project and expose methods which use your DLL.
D> http://support.microsoft.com/default.aspx?scid=kb;en-us;308359
D> http://samples.gotdotnet.com/quickstart/aspplus/doc/webservicesintro.
D> aspx

---
WBR,
Michael  Nemtsev       blog: http://spaces.msn.com/members/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid. (c) Friedrich Nietzsche
Kevin Spencer - 31 Aug 2005 16:35 GMT
> 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.

Signature

HTH,

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

>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.
[quoted text clipped - 4 lines]
>
> Thanks  a lot

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.