I have a situation where I’m parsing csv file (100-150 lines at a time – each line as around 8-10 comma separated values) now using the following code:
public void parseFile(string fileName)
{
TextFieldParser parser = new TextFieldParser(fileName);
parser.TextFieldType = FieldType.Delimited;
parser.SetDelimiters(",");
while (!parser.EndOfData)
{
string[] fields = parser.ReadFields();
foreach (string field in fields)
{
// TODO: take all the data and pass to SOAP webservice.
}
}//while
parser.Close();
}
now situation is since its a command line standalone executable it appears to get hang as I’m parsing each line (data) and send it to webservice.
do note upon completion i need to pass the execution back to Main method so it can interpret pass or fail as this exe is ran by batch script, dot net version can use is 3.5.
Q) solution which can interpret all the 100 lines of data has been parsed and passed over to remote SOAP webservice?
Q) is there any libs to help here etc…
Q) SOAP webservice is behind VPN – port 443, using soapSender will that cause problem?
I don’t know if it’s the solution to your problem, but I notice you were creating your proxy instance within the loop. I would suggest you move that out of the loop:
I see no other reason to expect your code to hang.