Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
WCF Передача файлов по сети, работа "долгих" методов
|
|||
|---|---|---|---|
|
#18+
у других людей всё получалось использую вот такой конфиг: <?xml version="1.0"?> <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> <httpRuntime executionTimeout="1200" maxRequestLength="102400" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" /> </system.web> <system.diagnostics> <sharedListeners> <add name="WcfListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="d:\log.svclog" /> </sharedListeners> <sources> <!-- switchValue attribute has no impact on MessageLogging --> <source name="System.ServiceModel.MessageLogging"> <listeners> <add name="WcfListener" /> </listeners> </source> <source name="System.ServiceModel" switchValue="Warning, ActivityTracing" propagateActivity="true" > <listeners> <add name="WcfListener" /> </listeners> </source> </sources> </system.diagnostics> <system.serviceModel> <diagnostics> <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxMessagesToLog="30000000" maxSizeOfMessageToLog="2000"/> </diagnostics> <behaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false"/> <dataContractSerializer maxItemsInObjectGraph="2147483647"/> <bufferedReceive maxPendingMessagesPerChannel="2147483647"/> <serviceThrottling maxConcurrentCalls="1000" maxConcurrentInstances="1000" maxConcurrentSessions ="1000"/> </behavior> </serviceBehaviors> </behaviors> <bindings> <basicHttpBinding> <binding name="" maxReceivedMessageSize="300000000" maxBufferSize="300000000"> <readerQuotas maxArrayLength="30000000" maxStringContentLength="300000000"/> </binding> </basicHttpBinding> </bindings> <serviceHostingEnvironment multipleSiteBindingsEnabled="True" aspNetCompatibilityEnabled="true"/> </system.serviceModel> <connectionStrings> <add name="connString" connectionString="Server=BY047\SQLEXPRESS;Database=TRI_Portal_DataBase;Trusted_Connection=True;" providerName="System.Data.SqlClient" /> </connectionStrings> </configuration> но у меня в этих конфигах выдаёт ошибку в 2х местах, не знаю что делать ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.06.2010, 17:48 |
|
||
|
WCF Передача файлов по сети, работа "долгих" методов
|
|||
|---|---|---|---|
|
#18+
wertyBSDу других людей всё получалось использую вот такой конфиг Так и тут у всех всё получилось. Были проблемы на IIS 5 с файлами больших размеров. Сейчас это уже не актуально. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.06.2010, 17:50 |
|
||
|
WCF Передача файлов по сети, работа "долгих" методов
|
|||
|---|---|---|---|
|
#18+
но у меня не работаеn: <bufferedReceive maxPendingMessagesPerChannel="2147483647"/> пишет что он не является потомком behavior <serviceHostingEnvironment multipleSiteBindingsEnabled="True" aspNetCompatibilityEnabled="true"/> атрибут multipleSiteBindingsEnabled не допускается ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.06.2010, 17:55 |
|
||
|
WCF Передача файлов по сети, работа "долгих" методов
|
|||
|---|---|---|---|
|
#18+
скорее всего там, где Вы это содрали реализовано Поведение (Behavior) службы ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.06.2010, 18:00 |
|
||
|
WCF Передача файлов по сети, работа "долгих" методов
|
|||
|---|---|---|---|
|
#18+
всё равно не работает может всё дело в этом грёбаном silverlight сейчас попробую передать файл пару метров с консоли ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.06.2010, 18:30 |
|
||
|
WCF Передача файлов по сети, работа "долгих" методов
|
|||
|---|---|---|---|
|
#18+
попробовал с консоли послать static void Main(string[] args) { Service1Client basereader = new Service1Client(); FileInfo selectedFile = new FileInfo(@"d:\folder.jpg"); byte[] fileContent = new byte[selectedFile.Length]; using (FileStream fs = selectedFile.OpenRead()) { Console.WriteLine(fs.Length); fs.Read(fileContent, 0, Convert.ToInt32(fs.Length)); fs.Close(); } try { basereader.SavePic(fileContent, 13); } catch(Exception e) { Console.WriteLine(e); TextWriter text = new StreamWriter(@"D:\error.txt"); text.Write(e); } Console.Read(); } ошибка: System.ServiceModel.ProtocolException: The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'SavePic'. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 45451. Server stack trace: at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOper ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.06.2010, 18:48 |
|
||
|
WCF Передача файлов по сети, работа "долгих" методов
|
|||
|---|---|---|---|
|
#18+
wertyBSD, ну эта известная настройка. что ты прям горячишься. XmlDictionaryReaderQuotas создаешь этот объект, изменяешь в нем MaxArrayLength и присваиваешь этот объект своей проксе. все уже сделано,просто тебе знаний не хватает. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.06.2010, 10:13 |
|
||
|
WCF Передача файлов по сети, работа "долгих" методов
|
|||
|---|---|---|---|
|
#18+
мы избежали передачи через сервис, в сильверлайт передаём данные через хэндлер создали ashx с кодом: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.IO; using System.Web.Services; namespace TestingTool.Web { /// <summary> /// Summary description for FileUpload /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class FileUpload : IHttpHandler { public void ProcessRequest(HttpContext context) { HttpRequest request = context.Request; HttpResponse response = context.Response; HttpServerUtility server = context.Server; string fileName = context.Request.Params["filename"]; if (!string.IsNullOrEmpty(fileName)) { using (Stream inputStream = request.InputStream) { #region конструирование пути к папке с картинками // ..//DBWcfService//data string folder = System.AppDomain.CurrentDomain.BaseDirectory; folder = folder.Remove(folder.Length - 1, 1); while ((folder.Length > 0) && (folder[folder.Length - 1] != '\\')) folder = folder.Remove(folder.Length - 1, 1); folder += "DBWcfService\\data"; #endregion using (FileStream fs = new FileStream(folder + @"\" + fileName, FileMode.OpenOrCreate)) { byte[] fileContent = new byte[inputStream.Length]; inputStream.Read(fileContent, 0, fileContent.Length); fs.Write(fileContent, 0, fileContent.Length); fs.Flush(); } } response.Clear(); response.End(); } } public bool IsReusable { get { return false; } } } } если бы в silverlight был обычный uploader то не надо было париться вообще с сервисом, а шла бы нормальная закачка ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.06.2010, 10:25 |
|
||
|
|

start [/forum/topic.php?fid=19&msg=36667538&tid=1397651]: |
0ms |
get settings: |
10ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
70ms |
get topic data: |
10ms |
get forum data: |
3ms |
get page messages: |
43ms |
get tp. blocked users: |
1ms |
| others: | 14ms |
| total: | 173ms |

| 0 / 0 |
