0

I have a program that uses web reference in order to connect to the server. The web reference is configured in app.config file in the following way:

   <applicationSettings>
        <blala.Properties.Settings>
          <setting name="blablaClient_AppexScan_Service1" serializeAs="String">
            <value>http://www.apex.com/CxWS/Service1.asmx</value>
          </setting>
        </blabla.Properties.Settings>
  <applicationSettings>

I would like to add to the setting a property of Timeout. I would like to change the default timeout from 100000 msec to something else and I would like to do it in the app.config.

when I tried to add:

<setting name="Timeout" serializeAs="String">

       <value>30</value>

</setting>

it didn't change the default timeout. How can I do it?

2 Answers 2

1

Adjust the proxy of your web service

var timeout = System.Configuration.ConfigurationSettings.AppSettings["Timeout"];

WebReference.ProxyClass myProxy = new WebReference.ProxyClass();
myProxy.Timeout = timeout; 
Sign up to request clarification or add additional context in comments.

4 Comments

how can I do it only in the app.config file?
try with <webServices><soapEnvelopeProcessing readTimeout=""/> </webServices>
It's a web-reference not a web web service. I'm talking about the client, not the server side
ok i inderstand your environment, let me small time in order to find, because i had this problem
0

Try to set the timeout after initialising your web services.

WSName.WSClass refWS = WSMng.Initialize(ServerName, ServerPort, ServerInstance, ServerCompanyName);
refWS.Timeout = 200000;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.