.net - WCF cannot add service due - cannot obtain meta data -


i have following,

(in vs2012)

postcodes solution asp.net web forms application have 2 services,

service1 , service2

everything working fine until started add real stuff iservice2. meaning started make constructors , receieve , error wcf test client states (when hit run inside service2.svc.cs tab)

"failed add service. service metadata may not accessible. make sure service running , exposing metadata."

here web.config

<configuration> <system.web> <compilation debug="true" targetframework="4.0" />  </system.web>   <system.servicemodel>  <behaviors>   <servicebehaviors>     <behavior name="">       <servicemetadata httpgetenabled="true" />       <servicedebug includeexceptiondetailinfaults="false" />     </behavior>   </servicebehaviors> </behaviors> <servicehostingenvironment multiplesitebindingsenabled="true" /> 

now have tried time , time again allow wcf test client obtain meta data adding endpoints web.config file follows

<services>      <service name="service2" //             behaviorconfiguration="defaultbehavior">     <endpoint address=http://localhost/service2               binding="basichttpbinding"                contract="iservice2" />     <endpoint address="http://localhost/service2/mex"               binding="mexhttpbinding"                contract="imetadataexchange" />   </service> </services> 

to clairfy solution called postcodes, have 2 services, service1 , service2

the above did not work, , still error when running wcf test client...

i not running online or purely run through test client , on local machine.

so question - have done wrong in adding these end points , how can fix it.

any advice great,

post below clarifications if needed

regards

i got reason, cant define constructor in interface, cannot instantiate them. here relevant better understanding

interface defining constructor signature?

resolution:

there class implementing interface , find in same wcf service project.you find code behind file name within .svc file inside wcf project.whatever wanted add within interfaced constructor, add same inside constructor defined in class.

happy coding:)


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -