Saturday, 15 March 2014

wcf - Best practice for SOA message format with common+specific attributes in .NET -



wcf - Best practice for SOA message format with common+specific attributes in .NET -

we need design , describe interface distributed system, parts of implemented in .net (most wcf). besides method-specific attributes each ws phone call need accept/provide mutual attributes (e.g. authentication tokens or paging parameters request, or version , error info response). there tens hundreds of different ws calls. expect utilize wif or similar technology understanding saml tokens , identity federation.

my preferred approach (so far) utilize xml construction mutual header , variable body each call, e.g.

<request> <header> <paging>...</paging> ... </header> <body method="getinvoices"> <!-- specific attributes getinvoices web method --> </body> </request>

questions:

is approach or recommend alternative one? how apply existing .net technologies in order simplify/automate dealing format much possible, namely write interface specific phone call , generate service/schema description body part(similar how wcf generates wsdl service description method contract) parse xml upon receipt, translate phone call of desired method right parameters (what don't want end have 1 big method big switch , 100s of cases...)

update (1.7.2014)

my question formulation has been perhaps vague. real issue struggling able apply ready-made .net technologies service generation (i.e. define service contract , allow vs generate wsdl service descriptions etc.) @ same time create message format flexible plenty allow adding out-of-band info intend process separately.

for illustration have authentication info in header (unsure yet in form - perchance authentication tokens, or saml). intercept request before ends in corresponding web method , reject or set context based on authentication data, web method can rely on context. same goes paging in web methods applicable, or success/failure messages response.

for sake of interoperability/generality started "pure" xml approach, can imagine improve solution extend mutual soap message format this:

<s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:header> <!-- out of band info --> </s:header> <s:body> <getinvoices xmlns="http://tempuri.org/"> <!-- arguments of getinvoices() --> </getinvoices > </s:body> </s:envelope>

the question if makes sense , whether implementable in wcf (how)?

i think requirement , based on scenario description workflow service can match existing requirements specially if not sure of contracts entirely, contracts implemented on fly. facility gives high level of flexibly specially if @ initial stages of project , unsure of operation contracts. in add-on can combine wcf , wf have stateful service can interact client subscribe service.

.net wcf design architecture soa

No comments:

Post a Comment