【发布时间】:2011-08-05 00:15:27
【问题描述】:
Rest Wcf 服务接受图片上传。 它接受图像作为base64string。 我创建了一个简单的 aspx 页面来上传图像。 但是我遇到了很多错误。 “有时香奈儿工厂不可用” “没有端点监听”之类的错误。 这是我的 web.config 文件。我不明白我在做什么错误。 任何帮助将不胜感激。 目前服务和客户端位于我的本地系统上。
客户端 Web.config 文件
<system.serviceModel>
<bindings>
<customBinding>
<binding name="WebHttpBinding_Service">
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Soap12" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="" binding="customBinding" bindingConfiguration="WebHttpBinding_Service"
contract="ServiceReference1.Service" name="WebHttpBinding_Service" />
</client>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
REST wcf 服务 Web.config
<system.serviceModel>
<services>
<service behaviorConfiguration="ServiceBehavior1" name="Service">
<endpoint address="" binding="webHttpBinding" contract="IService" behaviorConfiguration="REST">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="REST">
<webHttp/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior1">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
【问题讨论】: