On Fri, Feb 26, 2010 at 2:49 PM, Geoff Appleby <geoff.appl...@gmail.com> wrote:
> No I hadn't.  But it have me an idea. Inside that file that I'd never thought 
> to look inside. In there the web service URL had a port specified of 0. So in 
> notepad I changed it to 2222 and its all behaving as expected now.
>
> Cheers :)

Can you confirm what file that is?

BTW I have worked with the Unit Testing random port like so:

    <TestMethod(), _
     AspNetDevelopmentServer("WebService1", _
  "C:\My Projects\MGM\Snc\Web Interface", "/")> _
    Public Sub HelloWorldTest()
        Dim target As OurMultiUrlService = New OurMultiUrlService
        Dim expected As String = "Hello, world!"
        Dim actual As String

        target.Urls.Clear()
        target.Urls.AddRange(WebSetup(TestContext, "WebService1"))

        actual = target.HelloWorld()

        Assert.AreEqual(expected, actual)

    End Sub

    '''---------------------------------------------------------------------
    ''' Function: WebSetup
    '''
    ''' <summary>
    '''   Determines the actual URL for the web services named.
    ''' </summary>
    '''
    ''' <param name="TestContext">The current test context.</param>
    ''' <param name="WebServiceNames">
    '''   The name of the web service, as specified in the
    '''  <see cref="Web.AspNetDevelopmentServerAttribute.Name" />
    '''  parameter.
    ''' </param>
    '''
    ''' <returns>The array of actual URLs.</returns>
    '''
    ''' <remarks></remarks>
    '''
    ''' <revisionhistory>
    '''   081017 MEH Created.
    ''' </revisionhistory>
    '''---------------------------------------------------------------------
    Public Function WebSetup(ByVal TestContext As TestContext, _
 ByVal ParamArray WebServiceNames() As String) As String()
        For i = LBound(WebServiceNames) To UBound(WebServiceNames)
            Dim url = "http://localhost/";
            Dim webservice = New HttpPostClientProtocol
            webservice.Url = url
            Assert.IsTrue(WebServiceHelper.TryUrlRedirection(webservice,
TestContext,  _
  WebServiceNames(i)))
            Assert.IsTrue(i = LBound(WebServiceNames) _
  OrElse WebServiceNames(i - 1) <> webservice.Url)
            WebServiceNames(i) = webservice.Url
        Next
        Return WebServiceNames
    End Function
-- 
Regards,
Mark Hurd, B.Sc.(Ma.)(Hons.)

Reply via email to