{"id":231,"date":"2020-08-11T13:07:16","date_gmt":"2020-08-11T13:07:16","guid":{"rendered":"https:\/\/www.smtp-server.net\/?p=231"},"modified":"2020-08-04T19:57:22","modified_gmt":"2020-08-04T19:57:22","slug":"universaali-smtp-palvelin-miksi-verkkopalvelut","status":"publish","type":"post","link":"https:\/\/www.smtp-server.net\/fi\/universaali-smtp-palvelin-miksi-verkkopalvelut\/","title":{"rendered":"Universal SMTP Server - Miksi verkkopalvelut?"},"content":{"rendered":"<p><b>Yleiskatsaus<\/b><br \/>\nKomponenttipohjaisesta ohjelmoinnista on tullut suositumpaa kuin koskaan. Nyky\u00e4\u00e4n rakennetaan tuskin sovellusta, jossa ei k\u00e4ytett\u00e4isi komponentteja jossakin muodossa, yleens\u00e4 eri valmistajilta. Sovellusten kehittyess\u00e4 yh\u00e4 monimutkaisemmiksi on my\u00f6s kasvanut tarve hy\u00f6dynt\u00e4\u00e4 et\u00e4koneisiin hajautettuja komponentteja.<\/p>\n<p><!--more--><\/p>\n<p>Esimerkki komponenttipohjaisesta sovelluksesta on kokonaisvaltainen s\u00e4hk\u00f6isen kaupank\u00e4ynnin ratkaisu. Web-farmilla sijaitsevan s\u00e4hk\u00f6isen kaupank\u00e4ynnin sovelluksen on l\u00e4hetett\u00e4v\u00e4 tilauksia taustaj\u00e4rjestelm\u00e4n toiminnanohjaussovellukseen (ERP). Monissa tapauksissa ERP-sovellus sijaitsee eri laitteistossa ja saattaa toimia eri k\u00e4ytt\u00f6j\u00e4rjestelm\u00e4ss\u00e4.<\/p>\n<p>Microsoftin Distributed Component Object Model (DCOM) on hajautettu objekti-infrastruktuuri, jonka avulla sovellus voi kutsua toiseen palvelimeen asennettuja Component Object Model (COM) -komponentteja, ja se on siirretty useille muille kuin Windows-alustoille. DCOM ei kuitenkaan ole koskaan saanut laajaa hyv\u00e4ksynt\u00e4\u00e4 n\u00e4ill\u00e4 alustoilla, joten sit\u00e4 k\u00e4ytet\u00e4\u00e4n harvoin helpottamaan Windows- ja muiden kuin Windows-tietokoneiden v\u00e4list\u00e4 viestint\u00e4\u00e4. Toiminnanohjausohjelmistojen toimittajat luovat usein Windows-alustalle komponentteja, jotka kommunikoivat taustaj\u00e4rjestelm\u00e4n kanssa oman protokollan avulla.<\/p>\n<p>Jotkin s\u00e4hk\u00f6isen kaupank\u00e4ynnin sovelluksen k\u00e4ytt\u00e4m\u00e4t palvelut eiv\u00e4t v\u00e4ltt\u00e4m\u00e4tt\u00e4 sijaitse lainkaan datakeskuksessa. Jos s\u00e4hk\u00f6isen kaupank\u00e4ynnin sovellus esimerkiksi hyv\u00e4ksyy luottokorttimaksun asiakkaan ostamista tavaroista, sen on k\u00e4ytett\u00e4v\u00e4 kauppapankin palveluja asiakkaan luottokorttitietojen k\u00e4sittelyyn. K\u00e4yt\u00e4nn\u00f6ss\u00e4 DCOM ja siihen liittyv\u00e4t tekniikat, kuten CORBA ja Java RMI, rajoittuvat kuitenkin sovelluksiin ja komponentteihin, jotka on asennettu yrityksen datakeskukseen. Kaksi t\u00e4rkeint\u00e4 syyt\u00e4 t\u00e4h\u00e4n on se, ett\u00e4 n\u00e4m\u00e4 tekniikat k\u00e4ytt\u00e4v\u00e4t oletusarvoisesti omia protokollia ja ett\u00e4 n\u00e4m\u00e4 protokollat ovat luonnostaan yhteyspainotteisia.<\/p>\n<p>Internetin kautta palvelimen kanssa kommunikoivilla asiakkailla on lukuisia mahdollisia esteit\u00e4 yhteydenpidossa palvelimen kanssa. Tietoturvatietoiset verkonvalvojat ymp\u00e4ri maailmaa ovat ottaneet k\u00e4ytt\u00f6\u00f6n yritysreitittimi\u00e4 ja palomuureja, jotka est\u00e4v\u00e4t k\u00e4yt\u00e4nn\u00f6ss\u00e4 kaikenlaisen Internetin kautta tapahtuvan viestinn\u00e4n. Tarvitaan usein jumalan teko, jotta verkonvalvoja saa avattua portteja enemm\u00e4n kuin v\u00e4ltt\u00e4m\u00e4tt\u00f6m\u00e4t portit.<\/p>\n<p>Jos olet onnekas ja saat verkonvalvojan avaamaan asianmukaiset portit palvelusi tueksi, asiakkaasi eiv\u00e4t todenn\u00e4k\u00f6isesti ole yht\u00e4 onnekkaita. T\u00e4m\u00e4n vuoksi DCOM:n, CORBA:n ja Java RMI:n kaltaiset omat protokollat eiv\u00e4t ole k\u00e4yt\u00e4nn\u00f6llisi\u00e4 Internet-skenaarioissa.<\/p>\n<p>Kuten sanoin, toinen ongelma n\u00e4iss\u00e4 tekniikoissa on se, ett\u00e4 ne ovat luonnostaan yhteyspainotteisia eiv\u00e4tk\u00e4 siksi pysty k\u00e4sittelem\u00e4\u00e4n verkon keskeytyksi\u00e4 sujuvasti. Koska Internet ei ole suorassa hallinnassasi, et voi tehd\u00e4 oletuksia yhteyden laadusta tai luotettavuudesta. Jos verkkoon tulee katkos, asiakkaan seuraava kutsu palvelimelle saattaa ep\u00e4onnistua.<\/p>\n<p>N\u00e4iden tekniikoiden yhteyspainotteinen luonne tekee my\u00f6s haasteelliseksi rakentaa suuren skaalautuvuuden saavuttamiseksi tarvittavia kuormitustasapainotettuja infrastruktuureja. Kun asiakkaan ja palvelimen v\u00e4linen yhteys katkeaa, seuraavaa pyynt\u00f6\u00e4 ei voi yksinkertaisesti ohjata toiselle palvelimelle.<\/p>\n<p>Kehitt\u00e4j\u00e4t ovat yritt\u00e4neet voittaa n\u00e4m\u00e4 rajoitukset hy\u00f6dynt\u00e4m\u00e4ll\u00e4 mallia nimelt\u00e4<i> valtioton <\/i><i>ohjelmointi<\/i>, mutta niiden menestys on ollut rajallista, koska tekniikat ovat melko raskaita ja yhteyden muodostaminen et\u00e4objektiin on kallista.<\/p>\n<p>Koska asiakkaan luottokortin k\u00e4sittely tapahtuu Internetiss\u00e4 sijaitsevalla et\u00e4palvelimella, DCOM ei ole ihanteellinen v\u00e4line s\u00e4hk\u00f6isen kaupank\u00e4ynnin asiakkaan ja luottokortin k\u00e4sittelypalvelimen v\u00e4lisen viestinn\u00e4n helpottamiseksi. Kuten toiminnanohjausratkaisussa, kolmannen osapuolen komponentti asennetaan usein asiakkaan datakeskukseen (t\u00e4ss\u00e4 tapauksessa luottokorttien k\u00e4sittelyratkaisun tarjoajan toimesta). T\u00e4m\u00e4 komponentti toimii vain v\u00e4litt\u00e4j\u00e4n\u00e4, joka helpottaa s\u00e4hk\u00f6isen kaupank\u00e4ynnin ohjelmiston ja kauppapankin v\u00e4list\u00e4 viestint\u00e4\u00e4 oman protokollan avulla.<\/p>\n<p>N\u00e4etk\u00f6 t\u00e4ss\u00e4 kaavaa? Koska nykyisten tekniikoiden rajoitukset tietokonej\u00e4rjestelmien v\u00e4lisen viestinn\u00e4n helpottamisessa ovat olleet rajalliset, ohjelmistojen toimittajat ovat usein turvautuneet oman infrastruktuurinsa rakentamiseen. T\u00e4m\u00e4 tarkoittaa, ett\u00e4 resurssit, joita olisi voitu k\u00e4ytt\u00e4\u00e4 toiminnanohjausj\u00e4rjestelm\u00e4n tai luottokorttien k\u00e4sittelyj\u00e4rjestelm\u00e4n toimintojen parantamiseen, on sen sijaan k\u00e4ytetty omien verkkoprotokollien kirjoittamiseen.<\/p>\n<p>Pyrkiess\u00e4\u00e4n tukemaan paremmin t\u00e4llaisia Internet-skenaarioita Microsoft otti aluksi k\u00e4ytt\u00f6\u00f6n strategian, jossa se t\u00e4ydensi olemassa olevia tekniikoitaan, kuten COM Internet Services (CIS), jonka avulla voit luoda DCOM-yhteyden asiakkaan ja et\u00e4osan v\u00e4lille portin 80 kautta. Eri syist\u00e4 CIS:t\u00e4 ei hyv\u00e4ksytty laajalti.<\/p>\n<p>Tuli selv\u00e4ksi, ett\u00e4 tarvittiin uusi l\u00e4hestymistapa. Niinp\u00e4 Microsoft p\u00e4\u00e4tti ratkaista ongelman alhaalta yl\u00f6sp\u00e4in. Tarkastellaan joitakin vaatimuksia, jotka ratkaisun oli t\u00e4ytett\u00e4v\u00e4 menesty\u00e4kseen.<\/p>\n<ul>\n<li><b>Yhteentoimivuus<\/b> Muilla alustoilla olevien asiakkaiden on voitava k\u00e4ytt\u00e4\u00e4 et\u00e4palvelua.<\/li>\n<li><b>Internet-yst\u00e4v\u00e4llisyys<\/b> Ratkaisun pit\u00e4isi toimia hyvin sellaisten asiakkaiden tukemisessa, jotka k\u00e4ytt\u00e4v\u00e4t et\u00e4palvelua Internetist\u00e4.<\/li>\n<li><b>Vahvasti tyypitetyt rajapinnat<\/b> Et\u00e4palveluun l\u00e4hetett\u00e4vien ja sielt\u00e4 vastaanotettavien tietojen tyypist\u00e4 ei saa olla ep\u00e4selvyytt\u00e4. Lis\u00e4ksi et\u00e4palvelun m\u00e4\u00e4rittelemien tietotyyppien pit\u00e4isi sopia kohtuullisen hyvin useimpien proseduraalisten ohjelmointikielten m\u00e4\u00e4rittelemiin tietotyyppeihin.<\/li>\n<li><b>Kyky hy\u00f6dynt\u00e4\u00e4 nykyisi\u00e4 Internet-standardeja<\/b> Et\u00e4palvelun toteutuksessa olisi hy\u00f6dynnett\u00e4v\u00e4 mahdollisimman paljon nykyisi\u00e4 Internet-standardeja ja v\u00e4ltett\u00e4v\u00e4 keksim\u00e4st\u00e4 uudelleen ratkaisuja jo ratkaistuihin ongelmiin. Laajasti hyv\u00e4ksyttyihin Internet-standardeihin perustuvassa ratkaisussa voidaan hy\u00f6dynt\u00e4\u00e4 olemassa olevia ty\u00f6kaluja ja teknologiaa varten luotuja tuotteita.<\/li>\n<li><b>Tuki mille tahansa kielelle<\/b> Ratkaisun ei pit\u00e4isi olla tiukasti sidottu tiettyyn ohjelmointikieleen. Esimerkiksi Java RMI on tiukasti sidottu Java-kieleen. Visual Basicista tai Perlist\u00e4 olisi vaikea kutsua toiminnallisuutta et\u00e4-Java-objektiin. Asiakkaan pit\u00e4isi pysty\u00e4 toteuttamaan uusi verkkopalvelu tai k\u00e4ytt\u00e4m\u00e4\u00e4n olemassa olevaa verkkopalvelua riippumatta siit\u00e4, mill\u00e4 ohjelmointikielell\u00e4 asiakas on kirjoitettu.<\/li>\n<li><b>Tuki mille tahansa hajautetulle komponentti-infrastruktuurille<\/b> Ratkaisun ei pit\u00e4isi olla tiukasti sidottu tiettyyn komponentti-infrastruktuuriin. Itse asiassa sinun ei pit\u00e4isi joutua hankkimaan, asentamaan tai yll\u00e4pit\u00e4m\u00e4\u00e4n hajautettua objekti-infrastruktuuria vain rakentaaksesi uuden et\u00e4palvelun tai kuluttaaksesi olemassa olevaa palvelua. Taustalla olevien protokollien pit\u00e4isi helpottaa olemassa olevien hajautettujen olioinfrastruktuurien, kuten DCOM:n ja CORBA:n, v\u00e4list\u00e4 perusyhteytt\u00e4.<\/li>\n<\/ul>\n<p>T\u00e4m\u00e4n kirjan otsikon perusteella ei liene yll\u00e4tys, ett\u00e4 Microsoftin luoma ratkaisu tunnetaan nimell\u00e4<i> Verkkopalvelut<\/i>. Verkkopalvelu tarjoaa rajapinnan, jonka avulla tietty toiminto voidaan k\u00e4ynnist\u00e4\u00e4 asiakkaan puolesta. Asiakas voi k\u00e4ytt\u00e4\u00e4 verkkopalvelua Internet-standardien avulla.<\/p>\n<p><b>Verkkopalvelujen rakennuspalikat<\/b><br \/>\nSeuraavassa kuvassa on esitetty kahden sovelluksen v\u00e4lisen et\u00e4yhteyden mahdollistamiseen tarvittavat keskeiset rakennuspalikat.<\/p>\n<p>Keskustellaanpa kunkin rakennuspalikan tarkoituksesta. Koska moni lukija tuntee DCOM:n, mainitsen my\u00f6s kunkin rakennuspalikan DCOM-ekvivalentin.<\/p>\n<ul>\n<li><b>Discovery<\/b> Asiakassovellus, joka tarvitsee p\u00e4\u00e4syn verkkopalvelun tarjoamiin toimintoihin, tarvitsee keinon selvitt\u00e4\u00e4 et\u00e4palvelun sijainti. T\u00e4m\u00e4 tapahtuu prosessin avulla, jota kutsutaan yleisesti nimell\u00e4<i> l\u00f6yt\u00f6<\/i>. L\u00f6yt\u00e4mist\u00e4 voidaan helpottaa keskitetyn hakemiston avulla sek\u00e4 tapauskohtaisemmilla menetelmill\u00e4. DCOM:ss\u00e4 Service Control Manager (SCM) tarjoaa l\u00f6yt\u00f6palveluja.<\/li>\n<li><b>Kuvaus<\/b> Kun tietyn verkkopalvelun p\u00e4\u00e4tepiste on m\u00e4\u00e4ritetty, asiakas tarvitsee riitt\u00e4v\u00e4sti tietoa voidakseen toimia sen kanssa asianmukaisesti. Web-palvelun kuvaus sis\u00e4lt\u00e4\u00e4 j\u00e4sennelty\u00e4 metatietoa rajapinnasta, jota asiakassovelluksen on tarkoitus k\u00e4ytt\u00e4\u00e4, sek\u00e4 kirjallista dokumentaatiota Web-palvelusta, mukaan lukien k\u00e4ytt\u00f6esimerkkej\u00e4. DCOM-komponentti paljastaa rajapinnoistaan strukturoitua metatietoa tyyppikirjaston (typelib) kautta. Komponentin typelibin sis\u00e4lt\u00e4m\u00e4 metatieto on tallennettu omaan bin\u00e4\u00e4rimuotoon, ja sit\u00e4 k\u00e4ytet\u00e4\u00e4n oman sovellusohjelmointirajapinnan (API) kautta.<\/li>\n<li><b>Viestin muoto<\/b> Tietojen vaihtamiseksi asiakkaan ja palvelimen on sovittava yhteisest\u00e4 tavasta koodata ja muotoilla viestit. Vakioitu tapa koodata tietoja varmistaa, ett\u00e4 palvelin tulkitsee asiakkaan koodaamat tiedot oikein. DCOM:ss\u00e4 asiakkaan ja palvelimen v\u00e4liset viestit muotoillaan DCOM Object RPC (ORPC) -protokollassa m\u00e4\u00e4ritellyll\u00e4 tavalla.<\/li>\n<\/ul>\n<p>Ilman vakiomuotoista tapaa muotoilla viestit on l\u00e4hes mahdotonta kehitt\u00e4\u00e4 ty\u00f6kaluja, joilla kehitt\u00e4j\u00e4t voidaan irrottaa taustalla olevista protokollista. Kun kehitt\u00e4j\u00e4n ja taustalla olevien protokollien v\u00e4liin luodaan abstraktiokerros, kehitt\u00e4j\u00e4 voi keskitty\u00e4 enemm\u00e4n k\u00e4sill\u00e4 olevaan liiketoimintaongelmaan ja v\u00e4hemm\u00e4n ratkaisun toteuttamiseen tarvittavaan infrastruktuuriin.<\/p>\n<ul>\n<li><b>Koodaus<\/b> Asiakkaan ja palvelimen v\u00e4lill\u00e4 l\u00e4hetett\u00e4v\u00e4t tiedot on koodattava viestin runkoon. DCOM k\u00e4ytt\u00e4\u00e4 bin\u00e4\u00e4rikoodausj\u00e4rjestelm\u00e4\u00e4 asiakkaan ja palvelimen v\u00e4lill\u00e4 vaihdettujen parametrien sis\u00e4lt\u00e4mien tietojen sarjallistamiseen.<\/li>\n<li><b>Liikenne<\/b> Kun viesti on muotoiltu ja tiedot sarjallistettu viestin runkoon, viesti on siirrett\u00e4v\u00e4 asiakkaan ja palvelimen v\u00e4lill\u00e4 jonkin siirtoprotokollan v\u00e4lityksell\u00e4. DCOM tukee useita omia protokollia, jotka on sidottu useisiin verkkoprotokolliin, kuten TCP:hen, SPX:\u00e4\u00e4n, NetBEUI:hin ja NetBIOS over IPX:\u00e4\u00e4n.<\/li>\n<\/ul>\n<p><b>Verkkopalvelujen suunnittelup\u00e4\u00e4t\u00f6kset<\/b><\/p>\n<p>Keskustellaanpa n\u00e4ist\u00e4 verkkopalvelujen rakennuspalikoista ja niiden taustalla olevista suunnittelup\u00e4\u00e4t\u00f6ksist\u00e4.<\/p>\n<p><b>Siirtoprotokollien valitseminen<\/b><\/p>\n<p>Ensimm\u00e4iseksi m\u00e4\u00e4ritettiin, miten asiakas ja palvelin kommunikoivat kesken\u00e4\u00e4n. Asiakas ja palvelin voivat sijaita samassa l\u00e4hiverkossa, mutta asiakas voi mahdollisesti kommunikoida palvelimen kanssa Internetin kautta. Siksi siirtoprotokollan on sovelluttava yht\u00e4 hyvin l\u00e4hiverkko- ja Internet-ymp\u00e4rist\u00f6ihin.<\/p>\n<p>As I mentioned earlier, technologies such as DCOM, CORBA, and Java RMI are ill suited for supporting communication between the client and the server over the Internet. Protocols such as Hypertext Transfer Protocol (HTTP) and Simple Mail Transfer Protocol (SMTP) are proven Internet protocols. HTTP defines a request\/response messaging pattern for submitting a request and getting an associated response. SMTP defines a routable messaging protocol for asynchronous communication. Let&#8217;s examine why HTTP and SMTP are well suited for the Internet.<\/p>\n<p>HTTP-based Web applications are inherently stateless. They do not rely on a continuous connection between the client and the server. This makes HTTP an ideal protocol for high-availability configurations such as firewalls. If the server that handled the client&#8217;s original request becomes unavailable, subsequent requests can be automatically routed to another server without the client knowing or caring.<\/p>\n<p>Almost all companies have an infrastructure in place that supports SMTP. SMTP is well suited for asynchronous communication. If service is disrupted, the e-mail infrastructure automatically handles retries. Unlike with HTTP, you can pass SMTP messages to a local mail server that will attempt to deliver the mail message on your behalf.<\/p>\n<p>The other significant advantage of both HTTP and SMTP is their pervasiveness. Employees have come to rely on both e-mail and their Web browsers, and network administrators have a high comfort level supporting these services. Technologies such as network address translation (NAT) and proxy servers provide a way to access the Internet via HTTP from within otherwise isolated corporate LANs. Administrators will often expose an SMTP server that resides inside the firewall. Messages posted to this server will then be routed to their final destination via the Internet.<\/p>\n<p>In the case of credit card processing software, an immediate response is needed from the merchant bank to determine whether the order should be submitted to the ERP system. HTTP, with its request\/response message pattern, is well suited to this task.<\/p>\n<p>Most ERP software packages are not capable of handling large volumes of orders that can potentially be driven from the e-commerce application. In addition, it is not imperative that the orders be submitted to the ERP system in real time. Therefore, SMTP can be leveraged to queue orders so that they can be processed serially by the ERP system.<\/p>\n<p>If the ERP system supports distributed transactions, another option is to leverage Microsoft Message Queue Server (MSMQ). As long as the e-commerce application and the ERP system reside within the same LAN, connectivity via non-Internet protocols is less of an issue. The advantage MSMQ has over SMTP is that messages can be placed and removed from the queue within the scope of a transaction. If an attempt to process a message that was pulled off the queue fails, the message will automatically be placed back in the queue when the transaction aborts.<\/p>\n<p><b>Choosing an Encoding Scheme<\/b><\/p>\n<p>HTTP and SMTP provide a means of sending data between the client and the server. However, neither specifies how the data within the body of the message should be encoded. Microsoft needed a standard, platform-neutral way to encode data exchanged between the client and the server.<\/p>\n<p>Because the goal was to leverage Internet-based protocols, Extensible Markup Language (XML) was the natural choice. XML offers many advantages, including cross-platform support, a common type system, and support for industry -standard character sets.<\/p>\n<p>Binary encoding schemes such as those used by DCOM, CORBA, and Java RMI must address compatibility issues between different hardware platforms. For example, different hardware platforms have different internal binary representation of multi-byte numbers. Intel platforms order the bytes of a multi-byte number using the little endian convention; many RISC processors order the bytes of a multi-byte number using the big endian convention.<\/p>\n<p>XML avoids binary encoding issues because it uses a text-based encoding scheme that leverages standard character sets. Also, some transport protocols, such as SMTP, can contain only text-based messages.<\/p>\n<p>Binary methods of encoding, such as those used by DCOM and CORBA, are cumbersome and require a supporting infrastructure to abstract the developer from the details. XML is much lighter weight and easier to handle because it can be created and consumed using standard text-parsing techniques.<\/p>\n<p>In addition, a variety of XML parsers are available to further simplify the creation and consumption of XML documents on practically every modern platform. XML is lightweight and has excellent tool support, so XML encoding allows incredible reach because practically any client on any platform can communicate with your Web service.<\/p>\n<p><b>Choosing a Formatting Convention<\/b><\/p>\n<p>It is often necessary to include additional metadata with the body of the message. For example, you might want to include information about the type of services that a Web service needs to provide in order to fulfill your request, such as enlisting in a transaction or routing information. XML provides no mechanism for differentiating the body of the message from its associated data.<\/p>\n<p>Transport protocols such as HTTP provide an extensible mechanism for header data, but some data associated with the message might not be specific to the transport protocol. For example, the client might send a message that needs to be routed to multiple destinations, potentially over different transport protocols. If the routing information were placed into an HTTP header, it would have to be translated before being sent to the next intermediary over another transport protocol, such as SMTP. Because the routing information is specific to the message and not the transport protocol, it should be a part of the message.<\/p>\n<p>Simple Object Access Protocol (SOAP) provides a protocol-agnostic means of associating header information with the body of the message. Every SOAP message must define an envelope. The envelope has a body that contains the payload of the message and a header that can contain metadata associated with the message.<\/p>\n<p>SOAP imposes no restrictions on how the message body can be formatted. This is a potential concern because without a consistent way of encoding the data, it is difficult to develop a toolset that abstracts you from the underlying protocols. You might have to spend a fair amount of time getting up to speed on the Web service&#8217;s interface instead of solving the business problem at hand.<\/p>\n<p>What was needed was a standard way of formatting a remote procedure call (RPC) message and encoding its list of parameters. This is exactly what Section 7 of the SOAP specification provides. It describes a standard naming convention and encoding style for procedure-oriented messages.<\/p>\n<p>Because SOAP provides a standard format for serializing data into an XML message, platforms such as ASP.NET and Remoting can abstract away the details for you.<\/p>\n<p><b>Choosing Description Mechanisms<\/b><\/p>\n<p>SOAP provides a standard way of formatting messages exchanged between the Web service and the client. However, the client needs additional information in order to properly serialize the request and interpret the response. XML Schema provides a means of creating schemas that can be used to describe the contents of a message.<\/p>\n<p>XML Schema provides a core set of built-in datatypes that can be used to describe the contents of a message. You can also create your own datatypes. For example, the merchant bank can create a complex datatype to describe the content and structure of the body of a message used to submit a credit card payment request.<\/p>\n<p>A schema contains a set of datatype and element definitions. A Web service uses the schema not only to communicate the type of data that is expected to be within a message but also to validate incoming and outgoing messages.<\/p>\n<p>A schema alone does not provide enough information to effectively describe a Web service, however. The schema does not describe the message patterns between the client and the server. For example, a client needs to know whether to expect a response when an order is posted to the ERP system. A client also needs to know over what transport protocol the Web service expects to receive requests. Finally, the client needs to know the address where the Web service can be reached.<\/p>\n<p>This information is provided by a Web Services Description Language (WSDL) document. WSDL is an XML document that fully describes a particular Web service. Tools such as ASP.NET WSDL.exe and Remoting SOAPSUDS.exe can consume WSDL and automatically build proxies for the developer.<\/p>\n<p>As with any component used to build software, a Web service should also be accompanied by written documentation for developers who program against the Web service. The documentation should describe what the Web service does, the interfaces it exposes, and some examples of how to use it. Good documentation is especially important if the Web service is exposed to clients over the Internet.<\/p>\n<p><b>Choosing Discovery Mechanisms<\/b><\/p>\n<p>Once you&#8217;ve developed and documented a Web service, how can potential clients locate it? If the Web service is designed to be consumed by a member of your development team, your approach can be pretty informal, such as sharing the URL of the WSDL document with your peer a couple of cubicles down. But when potential clients are on the Internet, advertising your Web service effectively is an entirely different story.<\/p>\n<p>What&#8217;s needed is a common way to advertise Web services. Universal Description, Discovery, and Integration (UDDI) provides just such a mechanism. UDDI is an industry-standard centralized directory service that can be used to advertise and locate Web services. UDDI allows users to search for Web services using a host of search criteria, including company name, category, and type of Web service.<\/p>\n<p>Web services can also be advertised via DISCO, a proprietary XML document format defined by Microsoft that allows Web sites to advertise the services they expose. DISCO defines a simple protocol for facilitating a hyperlink style for locating resources. The primary consumer of DISCO is Microsoft Visual Studio.NET. A developer can target a particular Web server and navigate through the various Web services exposed by the server.<\/p>\n<p><b>What&#8217;s Missing from Web Services?<\/b><\/p>\n<p>You might have noticed that some key items found within a distributed component infrastructure are not defined by Web services. Two of the more noticeable omissions are a well-defined API for creating and consuming Web services and a set of component services, such as support for distributed transactions. Let&#8217;s discuss each of these missing pieces.<\/p>\n<ul>\n<li><b>Web service -specific API<\/b> Most distributed component infrastructures define an API to perform such tasks as initializing the runtime, creating an instance of a component, and reflecting the metadata used to describe the component. Because most high-level programming languages provide some degree of interoperability with C, the API is usually exposed as a flat set of C method signatures. RMI goes so far as to tightly couple its API with a single high-level language, Java.<\/li>\n<\/ul>\n<p>In an effort to ensure that Web services are programming language-agnostic, Microsoft has left it up to individual software vendors to bind support for Web services to a particular platform. I will discuss two Web service implementations for the.NET platform, ASP.NET and Remoting, later in the book.<\/p>\n<ul>\n<li><b>Component services<\/b> The Web services platform does not provide many of the services commonly found in distributed component infrastructures, such as remote object lifetime management, object pooling, and support for distributed transactions. These services are left up to the distributed component infrastructure to implement.<\/li>\n<\/ul>\n<p>Some services, such as support for distributed transactions, can be introduced later as the technology matures. Others, such as object pooling and possibly object lifetime management, can be considered an implementation detail of the platform. For example, Remoting defines extensions to provide support for object lifetime management, and Microsoft Component Services provides support for object pooling.<\/p>\n<p><b>Summary<\/b><\/p>\n<p>Component-based programming has proven to be a boon to developer productivity, but some services cannot be encapsulated by a component that resides within the client&#8217;s datacenter. Legacy technologies such as DCOM, CORBA, and Java RMI are ill-suited to allowing clients to access services over the Internet, so Microsoft found it necessary to start from the bottom and build an industry-standard way of accessing remote services.<\/p>\n<p><i>Verkkopalvelut<\/i> is an umbrella term that describes a collection of industry- standard protocols and services used to facilitate a base-line level of interoperability between applications. The industry support that Web services has received is unprecedented. Never before have so many leading technology companies stepped up to support a standard that facilitates interoperability between applications, regardless of the platform on which they are run.<\/p>\n<p>One of the contributing factors to the success of Web services is that they&#8217;re built on existing Internet standards such as XML and HTTP. As a result, any system capable of parsing text and communicating via a standard Internet transport protocol can communicate with a Web service. Companies can also leverage the investment they have already made in these technologies.<\/p>","protected":false},"excerpt":{"rendered":"<p>Overview Component-based programming has become more popular than ever. Hardly an application is built today that does not involve leveraging components in some form, usually from different vendors. As applications have grown more sophisticated, the need to leverage components distributed on remote machines has also grown.<\/p>","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-231","post","type-post","status-publish","format-standard","hentry","category-smtp-servers"],"_links":{"self":[{"href":"https:\/\/www.smtp-server.net\/fi\/wp-json\/wp\/v2\/posts\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.smtp-server.net\/fi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.smtp-server.net\/fi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.smtp-server.net\/fi\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.smtp-server.net\/fi\/wp-json\/wp\/v2\/comments?post=231"}],"version-history":[{"count":1,"href":"https:\/\/www.smtp-server.net\/fi\/wp-json\/wp\/v2\/posts\/231\/revisions"}],"predecessor-version":[{"id":232,"href":"https:\/\/www.smtp-server.net\/fi\/wp-json\/wp\/v2\/posts\/231\/revisions\/232"}],"wp:attachment":[{"href":"https:\/\/www.smtp-server.net\/fi\/wp-json\/wp\/v2\/media?parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.smtp-server.net\/fi\/wp-json\/wp\/v2\/categories?post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.smtp-server.net\/fi\/wp-json\/wp\/v2\/tags?post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}