我尝试使用WCF使用JSON进行简单的REST服务,最初工作正常,当我转到Internet选项时 - >连接 - >局域网设置 - >代理服务器设置 - >并且我在这个场景服务中设置了地址和端口并没有返回JSON输出。但这适用于IE,它不适用于chrome和firefox。
我不知道为什么启用代理时它无法正常工作。如果我们检查本地服务器的旁路代理服务器
,这是有效的的App.config
<configuration>
<system.net>
<defaultProxy useDefaultCredentials="true">
<proxy usesystemdefault="False" proxyaddress="http://192.156.23.123:8080" bypassonlocal="True"/>
</defaultProxy>
</system.net>
<system.serviceModel>
<services>
<service name = "abc">
<host>
<baseAddress>
<add baseAdress="http://localhost:8712"/>
</baseAddress>
</host>
<endpoint adress = "" behaviorConfiguration="rest"binding="webHttpBinding" contract="WCFservicelibrary1.Iservice1">
<identity>
<dns value = "localhost"/>
</identity>
</endpoint>
<enspoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name = "rest">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
</<configuration>