سؤال

ولقد أضافت خدمة SOAP الويب إلى التطبيق وحدة التحكم وفي كل مرة أقوم بإجراء محددة استدعاء توقيت للخروج على لي. دعوات أخرى تعمل بشكل جيد. كيف يمكنني زيادة طول المهلة في التطبيق وحدة؟ يبدو أنه في الوقت الحالي حوالي 90 ثانية.

وشكرا.

هل كانت مفيدة؟

المحلول

ويمكنك تعيين المهلة العميل خدمة الإنترنت عن طريق وضع في خاصية مهلة . الافتراضي هو 100000 ميلي ثانية (100 ثانية).

وعلى سبيل المثال:

MyWebServices.Webservice svc = new MyWebServices.Webservice();
// Set timeout to 200 seconds
svc.Timeout = 200000;
svc.DoWork();

نصائح أخرى

وهذا يجب أن تسمح لك لتغيير مهلة ثم تحقق من أنه تم تغيير.

ومهلة كثافة العمليات العامة {الحصول؛ جلس؛ }

[عملية (مهلة = 30)] TransactionAttribute_Timeout الطبقة الجمهور: ServicedComponent {     TimeoutExample الفراغ الجمهور ()     {         // الحصول على TransactionAttribute تطبيقها على الصف.         السمة TransactionAttribute =             (TransactionAttribute) Attribute.GetCustomAttribute (             this.GetType ()             تشير typeof (TransactionAttribute)،             كاذبة)؛

    // Display the current value of the attribute's Timeout property.
    Console.WriteLine("TransactionAttribute.Timeout: {0}",
        attribute.Timeout);

    // Set the Timeout property value of the attribute to sixty
    // seconds.
    attribute.Timeout = 60;

    // Display the new value of the attribute's Timeout property.
    Console.WriteLine("TransactionAttribute.Timeout: {0}",
        attribute.Timeout);
}

و}

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top