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 / ASP.NET / Web Services / August 2003

Tip: Looking for answers? Try searching our database.

webservice asp.net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arno - 28 Aug 2003 14:58 GMT
How do I call a webservice from a webapplication in
ASP.NET??

I do not have any experience

Can you recommenc me good books??

thank you
Dino Chiesa [MSFT] - 28 Aug 2003 21:55 GMT
check out a tutorial for a basic ASMX webservice.
It should show you how to build a client.

what you want to do, I suppose, is use an ASPX module as a client of the
ASMX.
In this case, the ASPX is the client, and must reference the webservice
proxy.

You need to compile the generated proxy classes into a DLL and drop them
into the bin dir of the ASP.NET app.

example:
http://www.aspalliance.com/cookbook/ViewChapter.aspx?Chapter=19

-Dino

> How do I call a webservice from a webapplication in
> ASP.NET??
[quoted text clipped - 4 lines]
>
> thank you
Arno - 29 Aug 2003 07:14 GMT
How do I compile the proxy classes into a dll??

and where do I put mu business classes?
>-----Original Message-----
>check out a tutorial for a basic ASMX webservice.
[quoted text clipped - 23 lines]
>
>.
Dino Chiesa [MSFT] - 29 Aug 2003 16:22 GMT
Arno,
To compile you would use the langiuage compiler.  For C#, that is csc.exe
located in
c:\windows\Microsoft.NET\Framework\v1.1.4322\csc

and you would invoke it thusly:
 csc /target:library  /out:MyLibrary.dll  Module1.cs Module2.cs Module3.cs

On the cmd line include all of the C# modules you want to combine into the
DLL.   This might be just one C# file:  the proxy generated from wsdl.exe.
But you might have other helper classes, or you might decide you want to
inherit from the proxy, etc.  Probably if you are just starting, you would
have just the one source module.

The resulting DLL goes into the bin dir, as I said.

For business classes, you have a couple of options.
1. You can build them into a DLL in the same way - the only difference here
is that rather than starting with"generated" code - generated from
wsdl.exe - you will be starting with code you have written. You compile and
drop the DLL into the bin, just like with the proxy.  In fact there is no
technical difference whatsoever.   Then you call the "business methods" from
your aspx server-side script.

2.  you can also use code-behind, and utilize the ASP.NET infrastructure to
compile your "business methods" at runtime, on demand.  To do this, you
would code your aspx page (Maybe it is called "MyPage.aspx")  like this:
 <%@ Page Language="C#" ContentType="application/pdf" Inherits="MyClass"
src="MyClass.aspx.cs" %>

Then, you write a second source module, called "MyClass.aspx.cs" and drop
that into the same web directory with your  MyPage.aspx.  This module ought
to look like so:

public class MyClass : System.Web.UI.Page {
 private void Page_Load(object sender, System.EventArgs e) {
   ....
 }
 ...

}

In that class you can provide methods for any of the page-level events, such
as the skeletal Page_Load() shown above.    For more on the page-level
events see
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebUIPageClassTopic.asp

or google for "code behind"
http://www.google.com/search?hl=en&num=30&q="code+behind"

-------

Of course, you can use a combination of code-behind (#2) and DLLs (#1) in
your ASP.NET apps.

------------
This post is probably not enough to get you really rolling.  Look at some
working samples, especially the ASP.NET quickstarts that are included in the
.NET SDK.
C:\netsdk\QuickStart\aspplus\samples\webforms\intro  is a nice place to
start.

Even better, Get yourself a book!

"ASP.NET Unleashed"  is a fine one, but there are a million other ASP.NET
books out there.

-Dino

> How do I compile the proxy classes into a dll??
>
[quoted text clipped - 30 lines]
> >
> >.

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.