0
休息Wcf服務接受圖片上傳。 它接受圖像作爲base64string。 我已經創建了一個簡單的aspx頁面來上傳圖片。 但我收到了很多錯誤。 「有一段時間Chanel工廠不可用」 「沒有端點收聽」類錯誤。 這裏是我的web.config文件。我不明白我在做什麼錯誤。 任何幫助將不勝感激。 當前服務和客戶端位於我的本地系統上。Restful wcf服務圖片上傳
客戶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>
我只是想上傳一個圖像作爲base64String WCF服務,以測試它,是否有任何REST客戶端可用,我可以測試上述情況。 – Henry
您也可以使用WCF客戶端,但您必須手動更新生成的配置和合同。 – carlosfigueira