views:

225

answers:

3

I'm attempting to use Fogbugz's BugzScout in order to automatically submit unhanded application exceptions to my Fogbugz on demand Account. I've written up a wrapper class for it and everything appears to be just groovy - on my box. Testing the same code in the production environment, behind a Proxy that requires authentication, I have had nothing but issues.

I went to work modifying the BugzScout code in order to get it to authenticate with the Proxy, and after trying many different methods suggested via a Google search, found one that works! But now I'm getting an "Connection actively refused" error from Fogbugz itself, and I don't know what to do.

Here is the code where the BugzScout connects via a .net WebClient to submit a new case, with my modifications to deal with our Proxy. What am I doing that would cause Fogbugz to refuse my request? I've removed all non web-client related code from the procedure for ease of reading.

public string Submit(){         
        WebClient client = new WebClient();
        WebProxy proxy = new WebProxy();
        proxy.UseDefaultCredentials = true;            
        client.Proxy = proxy;            
        Byte[] response = client.DownloadData(fogBugzUrl);
        string responseText = System.Text.Encoding.UTF8.GetString(response);
        return (responseText == "") ? this.defaultMsg : responseText;
    }

The url is correct and the case is filled in properly- this has been verified.

EDIT: Additional info.

  • Using Fogbugz on Demand.
  • Using FogBugz.net code in it's entirety, with only these additions
       WebProxy proxy = new WebProxy();
       proxy.UseDefaultCredentials = true;            
       client.Proxy = proxy;
  • Error occurs when attempting to connect to both https://oursite.fogbugz.com/scoutsubmit.asp and http://oursite.fogbugz.com//scoutsubmit.asp (except one says port 443, and the other port 80, obviously)
  • I don't know anything about web authentication so I can't tell you what kind I'm using- if you tell me where to look I'd be happy to answer that for you.
A: 

Try the fogbugz support line?

A: 

Is your fogbugzUrl using HTTP Basic Authentication? Is it SSL (hosted on On Demand?)

The connection actively refused message would be coming from the web server itself, not really FogBugz.

Can you post the HTTP Status Code?

One thing to note if you are using FogBugz On Demand is you HAVE to use the https:// url (not the http url).

Michael Pryor
+1  A: 

Got the fix from Fogbugz- this is the appropriate network code to get though the proxy authentication and not mis-authenticate with Bugzscout.

WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials;
WebRequest request = WebRequest.Create(fogBugzUrl);
request.ContentType = "application/x-www-form-urlencoded";
request.Method = "POST";
request.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials;     
Stream requestStream = request.GetRequestStream();
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Close();
tom.dietrich