Writing /home/infogasy/domains/wiki.infogasy.net/public_html/data/cache/3/3e14ababcb139dd83af61a234ca8a440.xhtml failed

Efa hitantsika teo moa izany ny arsitektiora maro andalana miaraka amin’ny WebService, amin’ity indray mitoraka ity kosa dia arsitektiora mampiasa WCF (Windows Communication Foundation) no hojerentsika.

Toy izao ny arsitektiora toron’ny Microsoft raha hampiasa WCF, rehefa mampiasa Web Service Software Factory

:wiki:archiwcf.jpg

Alohan’ny hanaovana ny famolavolana rehetra dia mila vahana aloha ilay Solution.

:wiki:unlooksolution.jpg

Avy eo dia mila mamorona laminasa Host Console no hataontsika mba ahafahana manao ny andrana amin’ny PC. Hamboarina ny fifandraisana amin’ny base de données amin’ny alalan’ny Software Factory Data Access , toy izao hitanao eto ambany eto izao:

:wiki:sfda_adddataconn.jpg

dia avy eo tenenina hoe ilay Host Console no mitrotro ireo laminasa rehetra ireo

:wiki:sfwcf_spr.jpg

rehefa vita io dia misy varavarakely misotra eo dia ilay Host Project no safidianana.

Resource Access

WCFServiceAndrana.DataAccess

Ny eto angambany tsy hidirana lalina satria mitovy amin’ilay DAL antsika teo aloha. Azonao hatao koa anefa ny mampiasa Software Factory eto toy izao:

:sf_crud.jpg

Business Logic

WCFServiceAndrana.BusinessEntities

Toy izao ny fanamboarana ny Business Entities avy amin’ny base de données.

:be_database.jpg

Marihana fa araka ny efa hitantsika tamin’ny lahatsoratra arsitektiora I, raha laminasa lehibe dia tsy dia tsara ny manao hoe Classe = Table.

Toy izao ny sombiny azo avy amin’izany rehefa nampifandraisina tamin’ilay base IFG_MPIKAMBANA

:be.jpg

WCFServiceAndrana.BusinessLogic

Inty andalana iray ity moa dia mitovy amin’ilay BLL antsika teo aloha, izany hoe mampiasa ny WCFServiceAndrana.DataAccess fotsiny izy.

Service Interface

WCFServiceAndrana.DataContracts

Toy izao indray no hatao raha hiantso ny Software Factory raha hanamboatra DataContracts, izy io moa izany dia araka ny anarany dia fifanarahana momba ny endriky ny entana alefa.

:dc.jpg

Dia fenona avy eo ireo Properties ilaina. Toy izao ohatra ny vokatra mety ho azo:

:classedc.jpg

WCFServiceAndrana.FaultContracts

FaultContracts moa izany tsy dia hidirantsika fa miresaka momba ny Exception izy io.

WCFServiceAndrana.ServiceContracts

Ato kosa no ahitana ireo Message Contracts (hafatra manafono ireo DataContracts) sy Service Contracts (Interface mampiseho ireo Operation azo hatsoina).

Toy izao ny lalana ahafahana mamorona azy ireo:

:mc_scsf.jpg

Toy izao ny vokatra azo tamin’izany: - Message Contract

:mc_mpikambana.jpg

- Service Contract

:scinterface.jpg

Anatin’ny fanamboarana Service Contract io dia manontany izy amin’ny farany hoe hamboarina koa ve ny Implementation toy izao, dia hataontsika hoe eny izy ,dia hitanao amin’ny sary tsy ambany miaraka amin’ny WCFServiceAndrana.ServiceImplementation ny vokatra azo.

:scgenerate.jpg

WCFServiceAndrana.ServiceImplementation

Anatin’ny implementation moa dia milalao karazana Business Objects roa, noho izany dia mila manamboatra tetezana mampifandray azy ireo:

:servicetranslator.jpg

toy izao ny atin’izany kilasy translator izany:

:classtranslator.jpg

Ny Implementation moa dia azo natao tamin’ny alalany Software Factory Create Service Implementation, na koa rehefa manamboatra ny Service Contract ny antsika moa io faharoa io no natao ka nahazo zavatra toy izao:

:implementationmpikambana01.jpg

WCF Configuration

Mizara roa ny famolavolana ny Configuration, ny iray amin’ny Host moa ny iray amin’ny Client.

Host app.config

Azo hatao ny manao zaitra tanana an’ilay configuration kanefa ny Software Factory dia manolotra antsika ny Edit WCF Configuration , koa dia izy io izany no andeha hampiasaintsika. Toy izao ary ny volavolaina rehefa avy nosokafana ilay varavarakely Edit WCF Configuration teo ambon’ny app.config.

:editwcfconfig.jpg

:endpointmpikambana.jpg

:bindingmpikambana.jpg

:behaviormpikambana.jpg

ConsoleAndrana.Host

Toy izao kosa ny atin’ilay Host Console.

:sourcehostconsole.jpg

Rehefa veloma izy dia lasa ohatra an’izao:

:console.jpg

Client & Proxy

Rehefa velona ilay service dia azo hatao ny manandrana azy amin’ny alalan’ilay adiresy (http://localhost:1111/ServiceMpikambana) napetraka tao amin’ny Behavior

:wsdl.jpg

Dia ilay adiresy eo ambony io ihany koa no hampiasaina rehefa manao Add Service Reference amin’ilay laminasa Client.

Tonga moa dia voavotra ho azy ny app.config an’ilay Client amin’izany, fa somary misy bug kely fa lasa miverina in-droa ilay EndPoint dia mila fafana fotsiny ny iray.

Toy izao ny atin’ilay client mampiasa ilay Proxy azo tamin’ilay Add Service tery ambony.

:sourceclient.jpg

Ary izay no vokatra azo farany:

:vokatrafarany.jpg

Azonao alaina eto ny Source.

Dia izay indray no azo natolotra fa dia any amin’ny Smart Client sy SOA ary WF indray ny tohiny.

 

andaohiresakaarsitektiorafahaiiwcf.txt · Novaina farany:: 2008/09/11 12:43