c# - Extending WCF Compact / Custom Headers -
i'm developing app deployed across various platform including windows phone. because of this, have access wcf compact / portable classes.
i need able catch every outgoing request , incoming response in order apped headers request, , read headers response.
when extending standard wcf able achieve using custom behaviour, in wcf compact not supported, so, able use following code append headers specific request:
calculatorserviceclient client = new calculatorserviceclient(); using(new operationcontextscope(client.innerchannel)) { // use custom class called userinfo passed in messageheader userinfo userinfo = new userinfo(); userinfo.firstname = "john"; userinfo.lastname = "doe"; userinfo.age = 30; // add soap header outgoing request messageheader amessageheader = messageheader.createheader("userinfo", "http://tempuri.org", userinfo); operationcontext.current.outgoingmessageheaders.add(amessageheader); }
however, i'm not able catch response headers in example. i'm worried isn't thread safe (where multiple requests happening @ same time). and, i'd implement functionality in way transparent developer - don't need special requests. think should able achieve using along lines of iclientmessageformatter, i'm @ loss how implement in wcf compact.
any appreciated.
thanks david
Comments
Post a Comment