Click here to Skip to main content
15,904,023 members
Home / Discussions / C#
   

C#

 
AnswerRe: Create MP4 video from images Pin
Gerry Schmitz28-Mar-13 12:08
mveGerry Schmitz28-Mar-13 12:08 
GeneralRe: Create MP4 video from images Pin
cabasm28-Mar-13 12:37
cabasm28-Mar-13 12:37 
GeneralRe: Create MP4 video from images Pin
Gerry Schmitz28-Mar-13 12:47
mveGerry Schmitz28-Mar-13 12:47 
GeneralRe: Create MP4 video from images Pin
cabasm29-Mar-13 4:46
cabasm29-Mar-13 4:46 
QuestionC# WPF Accessing parameter of chosen data grid row Pin
johnyjj228-Mar-13 8:47
johnyjj228-Mar-13 8:47 
AnswerRe: C# WPF Accessing parameter of chosen data grid row Pin
OriginalGriff28-Mar-13 9:20
mveOriginalGriff28-Mar-13 9:20 
QuestionPass Info from Desktop App to Webpage Pin
PDTUM28-Mar-13 7:44
PDTUM28-Mar-13 7:44 
AnswerRe: Pass Info from Desktop App to Webpage Pin
David C# Hobbyist.28-Mar-13 8:42
professionalDavid C# Hobbyist.28-Mar-13 8:42 
Questionprogramming ideas Pin
MegaBaitas28-Mar-13 3:45
MegaBaitas28-Mar-13 3:45 
AnswerRe: programming ideas Pin
Richard MacCutchan28-Mar-13 3:58
mveRichard MacCutchan28-Mar-13 3:58 
AnswerRe: programming ideas Pin
PIEBALDconsult28-Mar-13 4:01
mvePIEBALDconsult28-Mar-13 4:01 
Generalprogramming ideas Pin
MegaBaitas28-Mar-13 5:11
MegaBaitas28-Mar-13 5:11 
GeneralRe: programming ideas Pin
PIEBALDconsult28-Mar-13 10:14
mvePIEBALDconsult28-Mar-13 10:14 
AnswerRe: programming ideas Pin
Alan Balkany1-Apr-13 5:08
Alan Balkany1-Apr-13 5:08 
QuestionBoost parralel messaging performance (TPL / Async) Pin
KillerX12328-Mar-13 2:29
KillerX12328-Mar-13 2:29 
QuestionMy issue is regarding handling multiple backgroud worker and multiple progressbar Pin
Tridip Bhattacharjee28-Mar-13 0:31
professionalTridip Bhattacharjee28-Mar-13 0:31 
AnswerRe: My issue is regarding handling multiple backgroud worker and multiple progressbar Pin
Thomas Duwe28-Mar-13 5:26
Thomas Duwe28-Mar-13 5:26 
GeneralRe: My issue is regarding handling multiple backgroud worker and multiple progressbar Pin
Tridip Bhattacharjee30-Mar-13 5:35
professionalTridip Bhattacharjee30-Mar-13 5:35 
GeneralRe: My issue is regarding handling multiple backgroud worker and multiple progressbar Pin
Thomas Duwe1-Apr-13 5:37
Thomas Duwe1-Apr-13 5:37 
QuestionHttpWebRequest and strange networking errors Pin
cjb11028-Mar-13 0:10
cjb11028-Mar-13 0:10 
I've got the following code that did seem to be working successfully: (It's sending a SOAP envelope to a Java web service and receiving a response) EndPoint is just a string property containing the URL and path to the WebService, Response is a HttpWebResponse property, that other classes use to process the response SOAP.

C#
//create the request
HttpWebRequest req = (HttpWebRequest) WebRequest.CreateDefault(new Uri(EndPoint));
//and request header info
req.ContentType = "text/xml; charset=utf-8";
req.Method = "POST";
req.Accept = "text/xml";
req.KeepAlive = false;
req.Timeout = Timeout;
req.Proxy = WebRequest.GetSystemWebProxy();

req.Headers.Add("SOAPAction", EndPoint);

//write the SOAP Message to the request
using (StreamWriter stm = new StreamWriter(req.GetRequestStream(), Encoding.UTF8))
{
    stm.Write(soapRequest.ToString(SaveOptions.DisableFormatting)); //remove the formatting from the passed XML.
    stm.Flush();
}

Response = null;
try
{
    //get the response
    Response = ((HttpWebResponse) req.GetResponse());
    //read the raw response into ResponseString
    using (StreamReader reader = new StreamReader(Response.GetResponseStream(), Encoding.UTF8))
        ResponseString = reader.ReadToEnd();
}
catch (WebException we)
{
    throw new ApplicationException("A web exception occurred in calling Transact OUG!\r\n" + we.Message, we);
}
catch (Exception e)
{
    throw new ApplicationException("A general exception occurred when calling Transact OUG!\r\n" + e.Message, e);
}
finally
{
    if (Response != null)
        Response.Close();

    req = null;
}


Now I'm not sure what's really changed but I'm getting really odd errors like 'An operation was attempted on something that is not a socket', now I think this might be threading related. As I'm seeing the very first time it returns a timeout, its only the second attempts that I get the odder errors.

As I said this code was working fine when it was called via a single Window WPF app, I've since changed the app to be two hosted UserControls. These don't interact and both have separate ViewModels, but they do both call this method at some point (not simultaneously though).

So my question is have I made some silly mistakes in the above code? Is there anything I should be aware of?
QuestionHow to enlarge the recording voice Pin
Star.jon27-Mar-13 22:46
Star.jon27-Mar-13 22:46 
AnswerRe: How to enlarge the recording voice Pin
Bernhard Hiller27-Mar-13 23:01
Bernhard Hiller27-Mar-13 23:01 
GeneralRe: How to enlarge the recording voice Pin
Star.jon27-Mar-13 23:05
Star.jon27-Mar-13 23:05 
GeneralRe: How to enlarge the recording voice Pin
Dave Kreskowiak28-Mar-13 2:00
mveDave Kreskowiak28-Mar-13 2:00 
Questionerror in crystal reports Pin
User349027-Mar-13 13:36
User349027-Mar-13 13:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.