.net - Calling method implemented in WCF service from client with out configuration file -


i have wcf service hosted in dll, have generated proxy code using svcutil.exe, below client code,

basichttpbinding binding = new basichttpbinding();             binding.security.mode = basichttpsecuritymode.none;             endpointaddress epa = new endpointaddress("http://localhost:8001/myapplication/deploy/deployservice/");             deployclient client = new deployclient(binding, epa);             deploystatus = client.deploy(mystringargument, true); 

when executing this, getting error

there no endpoint listening @ [http://localhost:8001/myapplication/deploy/deployservice/] accept message. caused incorrect address or soap action

service configuration file is,

<?xml version="1.0"?> <configuration>   <appsettings>     <!-- configurable client send timeout, in seconds  -->     <add key="dasclientsendtimeoutseconds" value="1500" />   </appsettings>   <system.web>     <compilation debug="false" />   </system.web>   <!-- -->   <system.servicemodel>     <bindings>       <nettcpbinding>         <binding name="nettcpbinding" sendtimeout="00:10:00" transfermode="streamedrequest" maxbufferpoolsize="2147483647" maxbuffersize="2147483647" maxreceivedmessagesize="2147483647">           <readerquotas maxstringcontentlength="2147483647" />           <!-- security mode use when clients connecting service. -->           <security mode="none" />         </binding>       </nettcpbinding>     </bindings>     <client />     <!--                  <diagnostics>             <messagelogging logmalformedmessages="true" logmessagesattransportlevel="false"/>         </diagnostics>         -->     <services>       <service behaviorconfiguration="deploytarget.deploybehavior" name="myapplication.deploy.deployservice">         <endpoint address="http://localhost:8001/myapplication/deploy/deployservice/mex" binding="mexhttpbinding" name="mexendpoint" contract="imetadataexchange" />         <endpoint address="net.tcp://localhost:8002/myapplication/deploy/deployservice/" binding="nettcpbinding" bindingconfiguration="nettcpbinding" name="tcpendpoint" contract="myapplication.common.interfaces.ideploy" />         <host>           <baseaddresses>             <add baseaddress="http://localhost:8001/myapplication/deploy/deployservice/" />           </baseaddresses>         </host>       </service>     </services>     <behaviors>       <servicebehaviors>         <behavior name="deploytarget.deploybehavior">           <!-- avoid disclosing metadata information,                           set value below false , remove metadata endpoint above before deployment -->           <servicemetadata httpgetenabled="true" />           <!-- receive exception details in faults debugging purposes, set value                           below true.  set false before deployment avoid disclosing exception information -->           <servicedebug includeexceptiondetailinfaults="false" />         </behavior>       </servicebehaviors>     </behaviors>   </system.servicemodel>   <startup>     <supportedruntime version="v4.0" sku=".netframework,version=v4.0" />   </startup> </configuration> 

your service set use nettcp, client using basic http. binding protocols must match if wish client , service communicate.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -