[ Pobierz całość w formacie PDF ]
.If you want to follow the common route to Web Services, then the SOAP example in thischapter and the one in Chapter 11 will help you get started.Many developers are using thisroute because other techniques that Microsoft would like you to use are simply too unstablenow to provide a viable method for implementing applications of any complexity over a realInternet connection.Using the Microsoft SOAP Toolkit or one of the third party offeringsmentioned in this chapter will work, even with Visual Studio.NET.BrowserEven though you ll hear a lot of conflicting information regarding WebAlertServices, most developers would agree that the term indicates publicexposure of code through some form of XML messaging over theInternet.Microsoft isn t the only company that s getting into Web Services, so it pays to look in other places to keep your options open.For example, a recent InfoWorld article(http://www.infoworld.com/articles/tc/xml/01/12/03/011203tckylix.xml) discusses what companies are doing for other platforms.Another level of Web Services is the.NET My Services (formerly Hailstorm) that Microsoft iscurrently offering to developers as a means of exposing their code.To some extent, thisform of Web Services is simply a matter of packaging, not of technology.However,packaging is everything, in this case, because you re exposing a service to the public in theform of reusable code.One company, XDegrees, has already started using this peer-to-peersetup.(You can read about their solution athttp://www.infoworld.com/articles/hn/xml/01/11/13/011113hnxdegrees.xml?1114wewebservices.) This solution makes use of Passport for verification.You can read more about.NET My Services at http://www.microsoft.com/myservices/.Some of the promises of Web Services, at least for.NET, won t come true until Microsoftreleases its line of.NET servers that will theoretically support XML natively.However, giventhat this is a new concept, it will probably take time for Microsoft to work out the bugs.Inshort, the Web Services support you get with your shiny new.NET server might be ofdubious utility at best.The final level of Web services, at least for this book, is the use of special Web Servicesprojects from Visual C++.NET.At the time of this writing, none of those projects will produceworkable code.When Microsoft releases Visual Studio.NET, you will have a choice of usingthe ATL Server Web Service or the Managed C++ Web Service project.Both projects willhelp you create what amounts to another form of SOAP application, but hopefully with fewerglitches and compatibility problems.Writing an Application with ASP.NETCreating Web applications still belongs more in the art form department than the sciencedepartment.Developers who can create great Web applications quickly are still somewhatrare in the development community.One of the most common technologies for developingapplications quickly is Active Server Pages (ASP).NoteThe way Microsoft designed the ASP.NET designer makes it difficult to savethe project in a manner that transfers easily to another machine.As a result,the example project (located on the source code CD) might not load in thiscase.You can, however, still access the individual source code files.If youcan t access the project in this section, you ll need to create the projectskeleton and transfer the code from the existing project on the source codeCD.Of course, ASP represents an earlier effort on Microsoft s part.ASP support is actually oldnews.NET.Developers have used ASP for several years now.During that time, developershave created a wish list of new features they consider essential.This is the basis for theimproved form of ASP found in Visual Studio.NET, ASP.NET.You can still use all of your existing ASP files with ASP.NET.Unlike some parts of the.NETupgrade (such as most of your database applications, as discussed in Chapters 8 and 9),ASP.NET provides full backward compatibility.However, it also provides all of those newfeatures that developers want.Two of the most important features are  code behind and ASP controls.One of the biggestproblems with ASP files right now is that they mix code and HTML elements.The mixturemakes ASP files somewhat difficult to read.Code behind rids the developer of this problem by placing the script code for a page in a separate file.This technique also makes it easier toreuse existing code, because the code exists separately from the HTML elements used torender the results on screen.Another problem with ASP is that it relies heavily on plain HTML tags to get the job done.The problems with HTML tags are that they don t work like the controls found in desktopapplications and that they come with a wealth of limitations.ASP controls eliminate theseproblems by providing full control support for ASP development.The client still sees HTMLtags, but the server side entity is a control.In short, ASP controls enable the developer tocreate applications faster and with better functionality, without requiring anything new on thepart of the user.Let s consider a very simple example consisting of a Test pushbutton and a label.When youclick the Test pushbutton, the Web server displays a message within the label.Unlike withthe managed Visual C++ environment, you actually gain access to Designer support forASP.NET.Figure 10-2 shows the simple setup for this example.Figure 10-2: A simple ASP.NET setup using the DesignerNotice that the designer provides two tabs.The HTML tab shows you the code for thedisplay shown in Figure 10-2.Figure 10-3 shows what this code looks like.Notice that mostof it is the standard HTML tags you ve used in the past.New to ASP.NET are thetags, which we ll discuss as the section progresses.Figure 10-3: The HTML tab of the Designer shows the code behind the Designerdisplay.Now that you know a little bit about the Designer, let s talk about the code for this example.Listing 10-3 shows the ASPX (ASP eXtended) page required for this example.(You ll findthis project in the \Chapter 10\SimpleASP folder of the source code CD [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • czarkowski.pev.pl
  •