1

I just set up a web app to use BugzScout for automatic error reporting to my FB On Demand account. I downloaded the ScoutSample project and started trying to invoke FogBugz.BugReport.Submit(). No matter what I submitted, I got the same message back:

ScoutUserName not specified.

which of course is the same thing you get if you don't provide any information at all.

After fighting this until I was about ready to rip my eyeballs out, I finally rewrote FogBugz.BugReport.Submit() to use GET instead of POST, and it worked beautifully the first time. I'll add my code below in case it's helpful, but I'm just curious - does On Demand not support POST? Or is the ScoutSample project out of date?

flag

2 Answers

2

This is what finally worked for me (I translated the C# class to VB).

        Public Function Submit() As String

            ...

            Dim parameters As String = ""
            parameters += "Description=" & HttpUtility.UrlEncode(Me.m_description)
            If Me.m_extraInformation IsNot Nothing AndAlso Me.m_extraInformation.Length > 0 Then
                parameters += "&Extra=" & HttpUtility.UrlEncode(Me.m_extraInformation)
            End If
            If Me.customerEmail IsNot Nothing AndAlso Me.customerEmail.Length > 0 Then
                parameters += "&Email=" & HttpUtility.UrlEncode(Me.customerEmail)
            End If
            parameters += "&ScoutUserName=" & HttpUtility.UrlEncode(Me.userName)
            parameters += "&ScoutProject=" & HttpUtility.UrlEncode(Me.m_project)
            parameters += "&ScoutArea=" & HttpUtility.UrlEncode(Me.m_area)
            parameters += "&ForceNewBug=" & (If(Me.m_forceNewBug, "1", "0"))

            Dim req As WebRequest = WebRequest.Create(m_fogBugzUrl & "?" & parameters)
            req.ContentType = "application/x-www-form-urlencoded"
            req.Method = "GET"

            Dim resp As WebResponse = req.GetResponse()
            If resp Is Nothing Then
                Return Nothing
            End If
            Dim sr As New StreamReader(resp.GetResponseStream())

            Dim responseText As String = sr.ReadToEnd().Trim()
            Return If((responseText = ""), Me.m_defaultMsg, responseText)

        End Function

link|flag
Any new information on this? Is it still GET only? – tofutim Apr 10 2011 at 7:13
1

Did you make sure that you're hitting your On Demand account via HTTPS and not HTTP? If it's HTTP, you'll be redirected, which isn't handled well.

link|flag
note to self: I think this is case FC1822132 – adambox Feb 18 2010 at 22:11

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.