Служба WCF размещена в службе Windows. Я получаю успешный ответ от веб-браузера, но не могу назвать его из приложения Winforms. Я всегда получаю ошибку # 405. Есть идеи?
Я включил «CORS» в своей службе WCF, я включил все необходимые компоненты из «Включения и выключения Windows».
Это файл app.config
моего клиента
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="true" />
<endToEndTracing propagateActivity="true" activityTracing="true"
messageFlowTracing="true" />
</diagnostics>
<behaviors>
<endpointBehaviors>
<behavior name="AjaxBehavior">
<webHttp defaultOutgoingResponseFormat="Json"/>
</behavior>
</endpointBehaviors>
</behaviors>
<client>
<endpoint
address="http://localhost:8080/ "
behaviorConfiguration="AjaxBehavior"
binding="webHttpBinding"
contract="IScaleService" />
</client>
</system.serviceModel>
</configuration>
Это мой файл конфигурации службы WCF:
<configuration>
<appSettings>
<add key="port" value="COM3"/>
</appSettings>
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="AjaxBehavior">
<webHttp defaultOutgoingResponseFormat="Json"/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="WindowsScaleTypeBehaviors" >
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:8080/mex"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="webHttpBindingWithJsonP" crossDomainScriptAccessEnabled="true" />
</webHttpBinding>
</bindings>
<services>
<service name="ScaleService.Scale"
behaviorConfiguration="WindowsScaleTypeBehaviors">
<endpoint
address=""
behaviorConfiguration="AjaxBehavior"
binding="webHttpBinding"
bindingConfiguration="webHttpBindingWithJsonP"
contract="ScaleService.IScaleService" />
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>