Monday, 15 April 2013

WCF consume by dotnet winfom client and config entry -



WCF consume by dotnet winfom client and config entry -

i new in wcf bit familiar web service (asmx file)

i have couple of question on wcf client config entry

when create web service (asmx) proxy nil add together in config file below entry in case of wcf below entry adds. need know important of below entry.

1) if delete these below entry happen....can't phone call service client side?

2) tell me when phone call web service client side how endpoint address service utilize phone call service if there more 1 endpoint address added in client side ?

3) how explicitly mention web service url cient side when create service call?

<system.servicemodel> <bindings> <wsdualhttpbinding> <binding name="wsdualhttpbinding_icommservice" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:00:05" bypassproxyonlocal="false" transactionflow="false" hostnamecomparisonmode="strongwildcard" maxbufferpoolsize="524288" maxreceivedmessagesize="65536" messageencoding="text" textencoding="utf-8" usedefaultwebproxy="true"> <readerquotas maxdepth="32" maxstringcontentlength="8192" maxarraylength="16384" maxbytesperread="4096" maxnametablecharcount="16384" /> <reliablesession ordered="true" inactivitytimeout="00:10:00" /> <security mode="message"> <message clientcredentialtype="windows" negotiateservicecredential="true" algorithmsuite="default" /> </security> </binding> </wsdualhttpbinding> </bindings> <client> <endpoint address="http://localhost/commservice/" binding="wsdualhttpbinding" bindingconfiguration="wsdualhttpbinding_icommservice" contract="services.icommservice" name="wsdualhttpbinding_icommservice"> <identity> <dns value="localhost" /> </identity> </endpoint> </client> </system.servicemodel>

yes these of import configuration required wcf. either provide through config file or code.

1) need provide where. if take them fro config . should doing in code.

2) wcf has basic rule of abc . address , binding , contract. 1 time again don't have if in config file.

for multiple clients . can mention endpoint name config file. forexample

myclient someclientobject = new myclient("wsdualhttpbinding_icommservice");

3) default, when add together service reference operation, wcf runtime gets client side proxy .

you can in simple way. parameterless.

mysvcclient svcproxy = new mysvcclient ();

you need have entry service contract . can utilize follows constructor ... using endpoint adddress , bidning etc.

basichttpbinding mybinding= new basichttpbinding(securitymode.none); endpointaddress endpointadd= new endpointaddress("http://localhost/commservice/"); mysvcclient svcproxy = new mysvcclient (mybinding, endpointadd);

since defining in code here. don't need in config file.

wcf

No comments:

Post a Comment