내 WCF 서비스 중 하나에 큰 크기의 파일을 매개 변수로 사용하는 작업 계약이 있습니다. 그래서 클라이언트가이 이상을 보내려고하면, 나는 예외가 있고 난 서버 추적에서 보았을 때 이것은 내가 본 것입니다 :WCF - 수신하는 종점이 없습니다.
내 WCF 서비스의 기본 단순화 된 구성을 사용했다메시지 : 수신 메시지 (65536) 가의 최대 메시지 크기 할당량 초과되었습니다. 할당량을 늘리려면 해당 바인딩 요소에 MaxReceivedMessageSize 속성을 사용합니다.
내가 내 서비스를 사용하는 방법은<system.serviceModel> <services> <service name="MyNamespace.MyService"> <endpoint address="MyService.svc" binding="basicHttpBinding" bindingConfiguration="basicHttp" contract="MyNamespace.IMyService" /> </service> </services> <bindings> <basicHttpBinding> <binding name="basicHttp" allowCookies="true" maxReceivedMessageSize="10485760" maxBufferSize="10485760" maxBufferPoolSize="10485760"> <readerQuotas maxDepth="32" maxArrayLength="10485760" maxStringContentLength="10485760"/> </binding> </basicHttpBinding> </bindings> <behaviors> ... </behaviors> <protocolMapping> ... </protocolMapping>
, 나는 기능이 다음과 같이
, 그래서 새로운 서비스 정의를 추가 내 도우미 클래스에서 채널을 반환하고 해당 채널을 사용하여 작업을 호출합니다.
public static T CreateChannel<T>() where T : IBaseService
{
System.ServiceModel.BasicHttpBinding binding= new System.ServiceModel.BasicHttpBinding();
binding.TransferMode = TransferMode.Streamed;
binding.Security = new BasicHttpSecurity() { Mode = BasicHttpSecurityMode.None };
binding.MaxReceivedMessageSize = 10485760;
binding.MaxBufferSize = 10485760;
System.ServiceModel.ChannelFactory<T> cf2 = new ChannelFactory<T>(binding,
new System.ServiceModel.EndpointAddress(MyEndpointAddress)); //I checked this part, the address is correct.
T Channel= cf2.CreateChannel();
return Channel;
}
n은,
var businessObject = WcfHelper.CreateChannel<IMyService>();
var operationResult = await businessObject.MyOperationAsync(...);
은 비록, 내 다른 서비스가 제대로 실행되고, 내가 구성에 정의 된 명시 적
의 예외를 반환 "더 엔드 포인트 청취가 없었다 ..." 내가 사용, VS2012에서 개발하고 IISExpress. 무엇이 문제 일 수 있으며 어떤 제안입니까?
덕분에 차이가 없습니다, 난 그냥했다 매개 변수로 전달하는 파일은 65536 바이트보다 크고 10MB보다 작습니다. –
@ F.Erken은 편집 – Cybermaxs
가 이미 확인되었으므로 행운을 보지 않습니다. –