Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Timeout with System.Net.WebClient UploadFile method

$
0
0

Dear all,

As part of an applications interface managed in MS SC Orchestrator, we are using the following code in order to automate the import of XML data in an application via POST:

$username = "xxx"
$password = "yyy"
$posturl = "http://myurl/bin/importApplication?type=myType&sling:authRequestLogin=1"
$file = "D:\myFile.xml"

$wc = new-object System.Net.WebClient
$wc.Credentials = new-object System.Net.NetworkCredential($username, $password)
$wc.UploadFile($posturl,$file)

This interface has been running fine for months. But with the volume of data increasing it seems that we have reached a duration threshold, and we now have a timeout error: Exception calling "UploadFile" with "2" argument(s): "The operation has timed out"

I have looked in various places but found no way so far to force a specific timeout duration on the System.Net.WebClient UploadFile.

Any suggestions ?

Sincerely,

Sven.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>