How to pass a service header when calling a WCF Service on a WinRT app -
i got 2 projects on solution - console application project , winrt project.
i need consume wcf service, can through console application using following lines:
static void main(string[] args) { var client = new servicereference1.comeandgoclient("basichttpbinding_icomeandgo"); var header = new servicereference1.serviceheader{ accountid = "a1", deviceid = "d1" }; var res = client.getemployees(ref header, ""); }
the problem - i'm not finding out how can send same service header (accountid , deviceid) when calling same method through winrt app.
var client = new servicereference1.comeandgoclient(servicereference1.comeandgoclient.endpointconfiguration.basichttpbinding_icomeandgo); public async task loaddata() { var sessions = await client.getemployeesasync(""); }
note: on winrt project don't have getemployeesasync method gets serviceheader parameter have getemployees on console application project. had added same service reference both projects, though.
Comments
Post a Comment