WCF Configuration File for Browser Interaction?

百般思念 提交于 2019-12-25 04:26:51

问题


I have a simple WCF 4.0 service with some simple methods and a property with a getter that returns List. The service works fine when connected to programatically. The getter is decorated as are the other methods on the Interface that define the service contract.

My next move is to make the service accessible via the IE web browser so server/deployment admins can do a "smoketest" after service installation.

This works currently:

http://localhost/myservice.svc?wsdl 

But I need to take things further and get this to work:

http://localhost/myservice.svc/SmokeTest

and have results show in the browser, SmokeTest is the property with a getter that does stuff and returns the List I want to show in the browser.

So far I can't figure out what my config should look like. All help appreciated.

This is all I have in the web.config for the service. The endpoint is myservice.svc:

  <behaviors>
  <serviceBehaviors>
    <behavior >
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    <services>
        <service name="myservice.worker"  >
            <endpoint address="" binding="basicHttpBinding" contract="myservice.IServicio" />
        </service>
    </services>

回答1:


related question, an explanation of what can and can't be done:

Invoking WCF services through a browser



来源:https://stackoverflow.com/questions/3927333/wcf-configuration-file-for-browser-interaction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!