c# - Best way to start Contract First WCF or Web Service? -
i've been given wsdl file , several xsd files build web service for. right i'm trying setup receive requests , respond.
my experience webservices limited old asp version asmx file etc.
there lot of information in xsd files, don't want build out classes hand, nor understand entail anyways (i'd imagine xml serializable class haven't looked it).
where start this? looked wcf foreign me i'd kinda rather use old style, i'm struggling find info on how set or head start automated generation of classes xsd files.
i did try wcf bit, wscf blue gives me errors (cannot import wsdl:porttype
) when try generate webservice code. , svcutil.exe
generate some of xsd file info not of them reason.
so 2 questions:
how can generate stub classes xsd files going
a tutorial/walkthrough generating wcf service wsdl , multiple xsd files does not use wscf blue?
assuming have wsdl start with, can following. did when tasked implementing intermediate dispatch layer on top of existing web service. new service should expose same interface original service perform different functions internally. note talking "classical" wcf services here (soap-based).
step 1: create code service interface wsdl
wsdl.exe /si /out:<targetfolder> <url-to-wsdl>
this generates .cs file contains interfaces , additional data types (for transfer objects). note file not wcf-ready yet wsdl.exe seems assume want create old .asmx service.
step 2: import interface code project
add generated file project. add attributes making interfaces , operations wcf-ready. need add [servicecontract] interfaces , [operationcontract] operations.
step 3: create wcf service
create wcf service (.svc file) , rid of generated interface. instead, make service implement contract(s) generated interfaces. now, can implement new functionality.
step 4: adjust remaining binding, authentication settings etc. match original web service.
Comments
Post a Comment