Updating line groups in a Hunt List

Version 1
    This document was generated from CDN thread

    Created by: Michael Dunsdon on 30-01-2012 03:43:07 AM
    Hopefully this is fairly simple and I've just missed something easy......
     
    I have the following function to add a line group to a hunt list

        Public Shared Function addHuntListMember(axlApiService As AXLAPIService, huntListUUID As String, lineGroupName As String) As String
            Dim result As String = ""
            Dim nextMemberIndex As Integer = 0
            Dim memberList As List(Of XHuntListMember) = New List(Of XHuntListMember)()
            Dim newMember As XHuntListMember = Nothing
            ' Build list of existing line groups
            For Each hlm As RHuntListMember In getHuntListDetail(axlApiService, huntListUUID).return.huntList.members
                newMember = New XHuntListMember()
                newMember.lineGroupName = hlm.lineGroupName
                newMember.selectionOrder = hlm.selectionOrder
                If hlm.selectionOrder >= nextMemberIndex Then nextMemberIndex = hlm.selectionOrder + 1
                memberList.Add(newMember)
            Next
            'Add the new one
            newMember = New XHuntListMember()
            newMember.lineGroupName = New XFkType()
            newMember.lineGroupName.Value = lineGroupName
            newMember.selectionOrder = nextMemberIndex
            memberList.Add(newMember)

            Dim hlreq As UpdateHuntListReq = New UpdateHuntListReq()
            hlreq.ItemElementName = ItemChoiceType32.uuid
            hlreq.Item = huntListUUID
            hlreq.Items = memberList.ToArray()

            Dim res = axlApiService.updateHuntList(hlreq)

            Return result
        End Function

    but I get a complation error
    "Value
    of type '1-dimensional array of CiscoAXL.XHuntListMember' cannot be
    converted to '1-dimensional array of CiscoAXL.XCommonMembersExtension'
    because 'CiscoAXL.XHuntListMember' is not derived from
    'CiscoAXL.XCommonMembersExtension'."
     
    at the line that says "  hlreq.Items = memberList.ToArray()"
    According to Visual studio UpdateHuntListReqMembers, UpdateHuntListReqAddMembers and UpdateHuntListReqRemoveMembers, XHuntListmembers are all derived from XCommonMembersExtension
     
    Anybody know what I'm missing or have a way to add/ delete line groups from a Hunt list that works ?
     
    Thanks

    Mike