增加IIS服务器上托管的WCF服务的超时(Increase timeout of WCF service hosted on IIS server)
我的服务器上托管了一堆WCF服务。 一个服务负责文件传输,并在用户尝试上传大文件时超时。
我想给用户一个选项,如果他愿意,可以增加这个特定服务的超时值。 目前,我正在使用5分钟超时,但是当文件很大并且网络在任何一方都相对较慢时达到此限制。
有没有办法动态地这样做? 我可以在不影响其他服务的情况下增加一项服务的超时值吗?
我理想的目的是从用户获取值并相应地设置clientTimeout和serverTimeout值。 我已经能够设置客户端超时,但服务器超时是目前的限制。 有什么想法吗?
我已阅读这些文章,但无法找到一种方法来增加我的服务在运行时的超时
1. http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.executiontimeout.aspx
2. WCF服务超时
3. http://blogs.msdn.com/b/wenlong/archive/2008/03/10/why-changing-sendtimeout-does-not-help-for-hosted-wcf-services.aspxI have a bunch of WCF services hosted on my server. One service is responsible for file transfer and times out when the user tries to upload large files.
I want to give the user an option to increase the timeout value for this particular service if he so desires. Currently, I'm using a 5 min timeout but this limit is reached when the files are large and the network is relatively slow on either side.
Is there a way to dynamically do so? Can I increase the timeout value for one service without affecting the others?
What I'd ideally like to achieve is to get the value from the user and set the clientTimeout and serverTimeout value accordingly. I have been able to set the client timeout but the server timeout is a limitation as of now. Any thoughts on this?
I have read these articles but could not figure out a way to increase the timeout for my service at runtime
1. http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.executiontimeout.aspx
2. WCF service timeout
3. http://blogs.msdn.com/b/wenlong/archive/2008/03/10/why-changing-sendtimeout-does-not-help-for-hosted-wcf-services.aspx
原文:https://stackoverflow.com/questions/20070491
最满意答案
当您的应用程序第一次启动时,Sf使用HttpKernel组件来管理从应用程序和包中加载服务容器配置,并处理编译和缓存。
在编译过程从配置,扩展和编译器传递的服务加载后,它被转储,以便下次可以使用缓存。 然后在后续请求期间使用转储版本,因为它更有效。
更多信息请访问: http : //symfony.com/doc/current/components/dependency_injection/workflow.html
如果在控制器中转储$ this-> container,您将看到私有属性参数中的所有参数,包括在parameters.yml文件和config.yml中定义的参数。
假设您想知道参数区域设置的当前值是什么 - 您可以写这个
$this->container->getParameter('locale')
此外,所有这些参数都被转储到sf_root / var / cache / your_env / appDevDebugProjectContainer.xml中
When your app first time starts, Sf uses a HttpKernel component to manage the loading of the service container configuration from the application and bundles and also handles the compilation and caching.
After the compilation process has loaded the services from the configuration, extensions and the compiler passes, it is dumped so that the cache can be used next time. The dumped version is then used during subsequent requests as it is more efficient.
More info at: http://symfony.com/doc/current/components/dependency_injection/workflow.html
If you dump $this->container in your controller, you will see all the parameters inside private property parameters, including parameters defined in the parameters.yml file and in the config.yml
Let's say that you want to know what is current value of the parameter locale - you can write this
$this->container->getParameter('locale')
Also, all those parameters are dumped into sf_root/var/cache/your_env/appDevDebugProjectContainer.xml
相关问答
更多-
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
如您所见, bootstrap.php.cache中引发了此错误。 Symfony使用引导程序文件来提高类加载性能,如此处所述 。 但是,您可能会从开发环境中复制此文件,并且尚未为生产重新生成该文件。 您需要通过运行composer install或直接运行构建脚本来重新生成此文件: php ./vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php As you ...
-
zip和tar.gz档案之间有区别。 如果您正在使用Windows,我建议下载并使用Symfony标准版的zip存档。 There are differences between zip and tar.gz archives. If you are working on windows, I recommend download and use zip archive of Symfony standard edition.
-
我没有在SensionFrameworkExtraBundle中注册必要的AppKernel.php : new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle() 谢谢,@ pazi! I hadn't registered the essential SensionFrameworkExtraBundle in my AppKernel.php: new Sensio\Bundle\FrameworkExtraBundle\Se ...
-
最后,我的解决方案与我之前想到的相反。 Symfony2现在是包装基础应用程序,遗留应用程序(目前)封装为LegacyBundle。 现在我可以将实体管理器甚至Controller-Container传递给遗留应用程序。 Finally my solution was the contrary as i thinked before. Symfony2 is now the wrapping base application, and the legacy application is (at the mo ...
-
如何在Symfony应用程序中获取当前加载的配置?(How to get the currently loaded configuration in a Symfony application?)[2024-02-02]
当您的应用程序第一次启动时,Sf使用HttpKernel组件来管理从应用程序和包中加载服务容器配置,并处理编译和缓存。 在编译过程从配置,扩展和编译器传递的服务加载后,它被转储,以便下次可以使用缓存。 然后在后续请求期间使用转储版本,因为它更有效。 更多信息请访问: http : //symfony.com/doc/current/components/dependency_injection/workflow.html 如果在控制器中转储$ this-> container,您将看到私有属性参数中的所有参 ... -
从Symfony应用程序外部访问和使用Symfony模型层(Accessing and using Symfony model layer from Outside the Symfony applications)[2023-05-19]
Symfony允许使用命令行中的功能。 如果您使用CronJob或其他应用程序,并且想要调用Symfony应用程序,则有两个常规选项: 在Symfony应用程序中生成HTTP端点 生成在Symfony应用程序中执行代码的命令 这两个选项将在下面讨论。 HTTP端点(REST API) 在路由配置中创建路由以将HTTP请求路由到Controller / Action。 # app/config/routing.yml test_api: path: /test/api/v1/{api_key ... -
在任务的configure()函数中,您需要定义任务中涉及的应用程序: $this->addOptions(array( new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name','frontend'), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The en ...
-
使用Symfony2的Yaml,Processor和Configuration组件应该符合您的需求。 http://symfony.com/doc/current/components/yaml/introduction.html http://symfony.com/doc/current/components/config/definition.html 定义您的“CompanyConfiguration”类,就像您在DependencyInjection案例中一样创建一个新的“CompanyLoade ...
-
symfony2和symfony1应用程序使用相同的密码加密(symfony2 and symfony1 application same password encryption)[2021-12-06]
如果你没有提供不同的编码算法,那么Symfony 1.x将使用sha1($salt.$rawPassword) 。 所以你的PasswordEncoder应该是这样的: use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface; class PasswordEncoder implements PasswordEncoderInterface { public function encodePassword($raw, ...