5
私はC#と.NET Framework 4.0でWCFサービスを開発しています。私はこれを行うにはwebHttpBinding
を使用していbasicHttpBinding&webHttpBinding一緒に
:
[OperationContract]
[WebInvoke(Method = "POST",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Bare,
UriTemplate = "filteredOrders/")]
OrderContract[] GetOrders(IdsMessage msg);
[OperationContract]
[WebInvoke(Method = "POST",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Bare,
UriTemplate = "completeFilteredOrders/")]
OrderContract[] LoadCompleteFilteredOrders(IdsMessage msg);
は、しかし、今、私はstreammingを使用して、そのWebサービスに画像を送信する必要があると私はそれを行うにはbasicHttpBinding
を追加する必要があります。
basicHttpBinding
を使用するこのWCF Webサービスに対して、新しい[OperationContract]
をどうすればいいですか?
申し訳ありませんが、私はWCF開発で非常に新しいです。ところで
が、これは私ののWeb.configです:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="EReportService.RestServiceImpl" behaviorConfiguration="ServiceBehaviour">
<endpoint address="" binding="webHttpBinding" contract="EReportService.IRestServiceImpl" behaviorConfiguration="web">
</endpoint>
</service>
</services>
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="2097152" maxBufferSize="2097152" transferMode="Streamed"/>
</webHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviour">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<connectionStrings>
</connectionStrings>
</configuration>
可能な解決策:http://debugmode.net/2011/12/22/how-to-enable-rest-and-soap-both-on-the-same-wcf-service/ – VansFannel