views:

71

answers:

1

Hi Folks,

How do I enable/create a MEX endpoint in the below web config so I can view the service from my browser?

I have tried a few variation from googling but VS always complains about it. (not a valid child element etc...)

<configuration>
 <system.web>
  <compilation debug="true" targetFramework="4.0" />
  </system.web>
   <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
    <services>
     <service name="MyApp.MyService" behaviorConfiguration="WebServiceBehavior">
      <endpoint address="" binding="webHttpBinding" contract="MyApp.IMyService"       behaviorConfiguration="JsonBehavior">
        <identity>
          <dns value="localhost"/>
        </identity>
      </endpoint>
    </service>
   </services>
   <behaviors>
   <endpointBehaviors>
      <behavior name="JsonBehavior">
       <webHttp/>
     </behavior>
   </endpointBehaviors>
 </behaviors>
 </system.serviceModel>
 </configuration>

Cheers, Conor

A: 

In VS, go Tools > WCF Service Configuration Editor. You can open your web.config and tinker with your WCF endpoints and bindings in a nice GUI that (shouldn't) generate XML that VS will complain about.

josh3736
...or open the tool yourself; on my machine it is located at `C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\SvcConfigEditor.exe`
josh3736
Hey josh3736, I just found that tool right this minute :)
Conor
Wish I had of know about this tool before, wasted 2 days mucking about with web.configs for the WCF binding, put that down to experience!
Conor