Solved

Enumerator and returning it's values from a web service using vb.net

Posted on 2010-08-12
3
1,177 Views
Last Modified: 2013-11-19
Hello EE!

I have a sub that I'm writing to return data from a service.  I'm having a difficult time figuring out how to return values for a specific set of fields.  When I run a for each loop I get all the values but what if I just want a specific key/value?? The data is setup using Enumerators - I don't have much experience using Enums but have heard it, which doesn't get me far.

Below is my sub, the sample request I'm trying to consume, and the proxy class   ...

The Public Enum CorpGroupTypeType has the <CorpGroupType> and I need to figure out how to return it's value which is stored in <CorpGroupName>
:SUB:



Protected Sub GetEmployeeCorpGroup(ByVal strNatID As String)



        Dim oGetEmployeeCorpGroupService As GetEmployeeCorpGroupService = New GetEmployeeCorpGroupService()

        Dim oUsernameToken As New UsernameToken(USERNAME, SECRET)

        Dim oSecurityHeaderXml As System.Xml.XmlElement = oUsernameToken.GetXml(New System.Xml.XmlDocument())

        Dim oSecurityHeader As New SecurityHeaderType()

        oSecurityHeader.Any = New System.Xml.XmlElement() {oSecurityHeaderXml}

        oGetEmployeeCorpGroupService.Security = oSecurityHeader



        Dim natID As New NationalIdType()

        natID.Value = strNatID

        natID.idOwner = NationalIdOwnerType.US



        Dim oEmpKey As EmployeeKeyType = New EmployeeKeyType()

        oEmpKey.Identifier = New EmployeeKeyTypeIdentifier()

        oEmpKey.Identifier.NationalId = natID

        oEmpKey.CompanyIdentifier = "XXX"



        Dim oEmployeeCorpGroupFilter As New GetEmployeeCorpGroupRequestFilter()

        oEmployeeCorpGroupFilter.Employees = New EmployeeKeyType() {oEmpKey}

        oEmployeeCorpGroupFilter.Companies = New String() {CO_ID}



        Dim oCorpGroupInfoRequest As New GetEmployeeCorpGroupRequest()

        oCorpGroupInfoRequest.EffectiveOn = Today.Date

        oCorpGroupInfoRequest.Filter = oEmployeeCorpGroupFilter



        Dim oEmployeeCorpGroupInfo As EmployeeCorpGroupType() = oGetEmployeeCorpGroupService.GetEmployeeCorpGroup(oCorpGroupInfoRequest)



        *** this loop works ***

        'For Each groupInfo As EmployeeCorpGroupType In oEmployeeCorpGroupInfo

                dim t as string = groupinfo.CorpGroupKey.CorpGroupType.ToString

                dim n as string = groupinfo.CorpGroupKey.CorpGroupName.ToString

        'Next



        *** but what if I want to control which key/values I return and map to my .aspx file? ***





        *** This does not return the desired results ***



        'Dim corpGroupTypeEnum As CorpGroupTypeType

        'For Each corpGroupTypeEnum In [Enum].GetValues(GetType(CorpGroupTypeType))

        '    Dim strCorpTypeItem As String = corpGroupTypeEnum.ToString()

        '    Select Case strCorpTypeItem

        '        Case CorpGroupTypeType.Class

        '        Case CorpGroupTypeType.Department

        '    End Select

        'Next



    End Sub





:SAMPLE REQUEST:



<ChangeEmployeeCorpGroupRequest>



<EmployeeCorpGroups>



<EmployeeCorpGroup>



<EmployeeKey>



<Identifier>



<NationalId idOwner="US">111-11-1111</NationalId>



<EmployeeId>11111</EmployeeId>



</Identifier>



<CompanyIdentifier>test.com</CompanyIdentifier>



</EmployeeKey>



<CorpGroupKey>



<CorpGroupType>Department</CorpGroupType>



<CorpGroupName>Sales</CorpGroupName>



<CompanyIdentifier>test.com</CompanyIdentifier>



</CorpGroupKey>



<EffectiveInfo>



<StartDate>2005-06-01</StartDate>



</EffectiveInfo>



</EmployeeCorpGroup>



</EmployeeCorpGroups>



</ChangeEmployeeCorpGroupRequest>





:PROXY CLASS:







Option Strict Off

Option Explicit On



Imports System

Imports System.ComponentModel

Imports System.Diagnostics

Imports System.Web.Services

Imports System.Web.Services.Protocols

Imports System.Xml.Serialization



'

'This source code was auto-generated by wsdl, Version=2.0.50727.3038.

'



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code"),  _

 System.Web.Services.WebServiceBindingAttribute(Name:="GetEmployeeCorpGroupBinding", [Namespace]:="xxx")>  _

Partial Public Class GetEmployeeCorpGroupService

    Inherits System.Web.Services.Protocols.SoapHttpClientProtocol

    

    Private securityField As SecurityHeaderType

    

    Private GetEmployeeCorpGroupOperationCompleted As System.Threading.SendOrPostCallback

    

    '''<remarks/>

    Public Sub New()

        MyBase.New

        Me.Url = "XXX/wsi"

    End Sub

    

    Public Property Security() As SecurityHeaderType

        Get

            Return Me.securityField

        End Get

        Set

            Me.securityField = value

        End Set

    End Property

    

    '''<remarks/>

    Public Event GetEmployeeCorpGroupCompleted As GetEmployeeCorpGroupCompletedEventHandler

    

    '''<remarks/>

    <System.Web.Services.Protocols.SoapHeaderAttribute("Security"),  _

     System.Web.Services.Protocols.SoapDocumentMethodAttribute("GetEmployeeCorpGroup", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)>  _

    Public Function GetEmployeeCorpGroup(<System.Xml.Serialization.XmlElementAttribute([Namespace]:="")> ByVal GetEmployeeCorpGroupRequest As GetEmployeeCorpGroupRequest) As <System.Xml.Serialization.XmlArrayAttribute("GetEmployeeCorpGroupResponse", [Namespace]:=""), System.Xml.Serialization.XmlArrayItemAttribute("EmployeeCorpGroup", IsNullable:=false)> EmployeeCorpGroupType()

        Dim results() As Object = Me.Invoke("GetEmployeeCorpGroup", New Object() {GetEmployeeCorpGroupRequest})

        Return CType(results(0),EmployeeCorpGroupType())

    End Function

    

    '''<remarks/>

    Public Function BeginGetEmployeeCorpGroup(ByVal GetEmployeeCorpGroupRequest As GetEmployeeCorpGroupRequest, ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult

        Return Me.BeginInvoke("GetEmployeeCorpGroup", New Object() {GetEmployeeCorpGroupRequest}, callback, asyncState)

    End Function

    

    '''<remarks/>

    Public Function EndGetEmployeeCorpGroup(ByVal asyncResult As System.IAsyncResult) As EmployeeCorpGroupType()

        Dim results() As Object = Me.EndInvoke(asyncResult)

        Return CType(results(0),EmployeeCorpGroupType())

    End Function

    

    '''<remarks/>

    Public Overloads Sub GetEmployeeCorpGroupAsync(ByVal GetEmployeeCorpGroupRequest As GetEmployeeCorpGroupRequest)

        Me.GetEmployeeCorpGroupAsync(GetEmployeeCorpGroupRequest, Nothing)

    End Sub

    

    '''<remarks/>

    Public Overloads Sub GetEmployeeCorpGroupAsync(ByVal GetEmployeeCorpGroupRequest As GetEmployeeCorpGroupRequest, ByVal userState As Object)

        If (Me.GetEmployeeCorpGroupOperationCompleted Is Nothing) Then

            Me.GetEmployeeCorpGroupOperationCompleted = AddressOf Me.OnGetEmployeeCorpGroupOperationCompleted

        End If

        Me.InvokeAsync("GetEmployeeCorpGroup", New Object() {GetEmployeeCorpGroupRequest}, Me.GetEmployeeCorpGroupOperationCompleted, userState)

    End Sub

    

    Private Sub OnGetEmployeeCorpGroupOperationCompleted(ByVal arg As Object)

        If (Not (Me.GetEmployeeCorpGroupCompletedEvent) Is Nothing) Then

            Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)

            RaiseEvent GetEmployeeCorpGroupCompleted(Me, New GetEmployeeCorpGroupCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))

        End If

    End Sub

    

    '''<remarks/>

    Public Shadows Sub CancelAsync(ByVal userState As Object)

        MyBase.CancelAsync(userState)

    End Sub

End Class



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute(),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code"),  _

 System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"& _ 

    ""),  _

 System.Xml.Serialization.XmlRootAttribute("Security", [Namespace]:="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"& _ 

    "", IsNullable:=false)>  _

Partial Public Class SecurityHeaderType

    Inherits System.Web.Services.Protocols.SoapHeader

    

    Private anyField() As System.Xml.XmlElement

    

    Private anyAttrField() As System.Xml.XmlAttribute

    

    '''<remarks/>

    <System.Xml.Serialization.XmlAnyElementAttribute()>  _

    Public Property Any() As System.Xml.XmlElement()

        Get

            Return Me.anyField

        End Get

        Set

            Me.anyField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlAnyAttributeAttribute()>  _

    Public Property AnyAttr() As System.Xml.XmlAttribute()

        Get

            Return Me.anyAttrField

        End Get

        Set

            Me.anyAttrField = value

        End Set

    End Property

End Class



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute(),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code")>  _

Partial Public Class WorkEventType

    

    Private profileNameField As String

    

    Private activationDateField As Date

    

    Private followPlanWaitingRulesField As YesNoValueType

    

    Private coverageEffectiveDateField As Date

    

    Private coverageEffectiveDateFieldSpecified As Boolean

    

    Private notificationMessageField As String

    

    '''<remarks/>

    Public Property ProfileName() As String

        Get

            Return Me.profileNameField

        End Get

        Set

            Me.profileNameField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(DataType:="date")>  _

    Public Property ActivationDate() As Date

        Get

            Return Me.activationDateField

        End Get

        Set

            Me.activationDateField = value

        End Set

    End Property

    

    '''<remarks/>

    Public Property FollowPlanWaitingRules() As YesNoValueType

        Get

            Return Me.followPlanWaitingRulesField

        End Get

        Set

            Me.followPlanWaitingRulesField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(DataType:="date")>  _

    Public Property CoverageEffectiveDate() As Date

        Get

            Return Me.coverageEffectiveDateField

        End Get

        Set

            Me.coverageEffectiveDateField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlIgnoreAttribute()>  _

    Public Property CoverageEffectiveDateSpecified() As Boolean

        Get

            Return Me.coverageEffectiveDateFieldSpecified

        End Get

        Set

            Me.coverageEffectiveDateFieldSpecified = value

        End Set

    End Property

    

    '''<remarks/>

    Public Property NotificationMessage() As String

        Get

            Return Me.notificationMessageField

        End Get

        Set

            Me.notificationMessageField = value

        End Set

    End Property

End Class



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute()>  _

Public Enum YesNoValueType

    

    '''<remarks/>

    <System.Xml.Serialization.XmlEnumAttribute("")>  _

    Item

    

    '''<remarks/>

    Yes

    

    '''<remarks/>

    No

End Enum



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute(),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code")>  _

Partial Public Class EffectiveDatesType

    

    Private startDateField As Date

    

    Private endDateField As Date

    

    Private endDateFieldSpecified As Boolean

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="date")>  _

    Public Property StartDate() As Date

        Get

            Return Me.startDateField

        End Get

        Set

            Me.startDateField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="date")>  _

    Public Property EndDate() As Date

        Get

            Return Me.endDateField

        End Get

        Set

            Me.endDateField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlIgnoreAttribute()>  _

    Public Property EndDateSpecified() As Boolean

        Get

            Return Me.endDateFieldSpecified

        End Get

        Set

            Me.endDateFieldSpecified = value

        End Set

    End Property

End Class



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute(),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code")>  _

Partial Public Class CorpGroupKeyType

    

    Private corpGroupTypeField As CorpGroupTypeType

    

    Private corpGroupNameField As String

    

    Private companyIdentifierField As String

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property CorpGroupType() As CorpGroupTypeType

        Get

            Return Me.corpGroupTypeField

        End Get

        Set

            Me.corpGroupTypeField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property CorpGroupName() As String

        Get

            Return Me.corpGroupNameField

        End Get

        Set

            Me.corpGroupNameField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property CompanyIdentifier() As String

        Get

            Return Me.companyIdentifierField

        End Get

        Set

            Me.companyIdentifierField = value

        End Set

    End Property

End Class



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute()>  _

Public Enum CorpGroupTypeType

    

    '''<remarks/>

    [Class]

    

    '''<remarks/>

    Department

    

    '''<remarks/>

    Division

    

    '''<remarks/>

    Location

    

    '''<remarks/>

    Union

End Enum



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute(),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code")>  _

Partial Public Class EmployeeCorpGroupType

    

    Private employeeKeyField As EmployeeKeyType

    

    Private corpGroupKeyField As CorpGroupKeyType

    

    Private effectiveInfoField As EffectiveDatesType

    

    Private workEventField As WorkEventType

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property EmployeeKey() As EmployeeKeyType

        Get

            Return Me.employeeKeyField

        End Get

        Set

            Me.employeeKeyField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property CorpGroupKey() As CorpGroupKeyType

        Get

            Return Me.corpGroupKeyField

        End Get

        Set

            Me.corpGroupKeyField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property EffectiveInfo() As EffectiveDatesType

        Get

            Return Me.effectiveInfoField

        End Get

        Set

            Me.effectiveInfoField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property WorkEvent() As WorkEventType

        Get

            Return Me.workEventField

        End Get

        Set

            Me.workEventField = value

        End Set

    End Property

End Class



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute(),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code")>  _

Partial Public Class EmployeeKeyType

    

    Private identifierField As EmployeeKeyTypeIdentifier

    

    Private companyIdentifierField As String

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property Identifier() As EmployeeKeyTypeIdentifier

        Get

            Return Me.identifierField

        End Get

        Set

            Me.identifierField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property CompanyIdentifier() As String

        Get

            Return Me.companyIdentifierField

        End Get

        Set

            Me.companyIdentifierField = value

        End Set

    End Property

End Class



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute(),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code"),  _

 System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true)>  _

Partial Public Class EmployeeKeyTypeIdentifier

    

    Private nationalIdField As NationalIdType

    

    Private employeeIdField As String

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property NationalId() As NationalIdType

        Get

            Return Me.nationalIdField

        End Get

        Set

            Me.nationalIdField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property EmployeeId() As String

        Get

            Return Me.employeeIdField

        End Get

        Set

            Me.employeeIdField = value

        End Set

    End Property

End Class



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute(),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code")>  _

Partial Public Class NationalIdType

    

    Private idOwnerField As NationalIdOwnerType

    

    Private valueField As String

    

    '''<remarks/>

    <System.Xml.Serialization.XmlAttributeAttribute()>  _

    Public Property idOwner() As NationalIdOwnerType

        Get

            Return Me.idOwnerField

        End Get

        Set

            Me.idOwnerField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlTextAttribute()>  _

    Public Property Value() As String

        Get

            Return Me.valueField

        End Get

        Set

            Me.valueField = value

        End Set

    End Property

End Class



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute()>  _

Public Enum NationalIdOwnerType

    

    '''<remarks/>

    AA

    

    '''<remarks/>

    AD

    

    '''<remarks/>

    AE

    

    '''<remarks/>

    AF

    

    '''<remarks/>

    AG

    

    '''<remarks/>

    AI

    

    '''<remarks/>

    AL

    

    '''<remarks/>

    AM

    

    '''<remarks/>

    AN

    

    '''<remarks/>

    AO

    

    '''<remarks/>

    AQ

    

    '''<remarks/>

    AR

    

    '''<remarks/>

    [AS]

    

    '''<remarks/>

    AT

    

    '''<remarks/>

    AU

    

    '''<remarks/>

    AW

    

    '''<remarks/>

    AZ

    

    '''<remarks/>

    BA

    

    '''<remarks/>

    BB

    

    '''<remarks/>

    BD

    

    '''<remarks/>

    BE

    

    '''<remarks/>

    BF

    

    '''<remarks/>

    BG

    

    '''<remarks/>

    BH

    

    '''<remarks/>

    BI

    

    '''<remarks/>

    BJ

    

    '''<remarks/>

    BM

    

    '''<remarks/>

    BN

    

    '''<remarks/>

    BO

    

    '''<remarks/>

    BR

    

    '''<remarks/>

    BS

    

    '''<remarks/>

    BT

    

    '''<remarks/>

    BV

    

    '''<remarks/>

    BW

    

    '''<remarks/>

    BY

    

    '''<remarks/>

    BZ

    

    '''<remarks/>

    CA

    

    '''<remarks/>

    CC

    

    '''<remarks/>

    CD

    

    '''<remarks/>

    CF

    

    '''<remarks/>

    CG

    

    '''<remarks/>

    CH

    

    '''<remarks/>

    CI

    

    '''<remarks/>

    CK

    

    '''<remarks/>

    CL

    

    '''<remarks/>

    CM

    

    '''<remarks/>

    CN

    

    '''<remarks/>

    CO

    

    '''<remarks/>

    CR

    

    '''<remarks/>

    CU

    

    '''<remarks/>

    CV

    

    '''<remarks/>

    CX

    

    '''<remarks/>

    CY

    

    '''<remarks/>

    CZ

    

    '''<remarks/>

    DE

    

    '''<remarks/>

    DJ

    

    '''<remarks/>

    DK

    

    '''<remarks/>

    DM

    

    '''<remarks/>

    [DO]

    

    '''<remarks/>

    DZ

    

    '''<remarks/>

    EC

    

    '''<remarks/>

    EE

    

    '''<remarks/>

    EG

    

    '''<remarks/>

    EH

    

    '''<remarks/>

    ER

    

    '''<remarks/>

    ES

    

    '''<remarks/>

    ET

    

    '''<remarks/>

    FI

    

    '''<remarks/>

    FJ

    

    '''<remarks/>

    FK

    

    '''<remarks/>

    FM

    

    '''<remarks/>

    FO

    

    '''<remarks/>

    FR

    

    '''<remarks/>

    FX

    

    '''<remarks/>

    GA

    

    '''<remarks/>

    GB

    

    '''<remarks/>

    GD

    

    '''<remarks/>

    GE

    

    '''<remarks/>

    GF

    

    '''<remarks/>

    GH

    

    '''<remarks/>

    GI

    

    '''<remarks/>

    GL

    

    '''<remarks/>

    GM

    

    '''<remarks/>

    GN

    

    '''<remarks/>

    GP

    

    '''<remarks/>

    GQ

    

    '''<remarks/>

    GR

    

    '''<remarks/>

    GS

    

    '''<remarks/>

    GT

    

    '''<remarks/>

    GU

    

    '''<remarks/>

    GW

    

    '''<remarks/>

    GY

    

    '''<remarks/>

    HK

    

    '''<remarks/>

    HM

    

    '''<remarks/>

    HN

    

    '''<remarks/>

    HR

    

    '''<remarks/>

    HT

    

    '''<remarks/>

    HU

    

    '''<remarks/>

    ID

    

    '''<remarks/>

    IE

    

    '''<remarks/>

    IL

    

    '''<remarks/>

    [IN]

    

    '''<remarks/>

    IO

    

    '''<remarks/>

    IQ

    

    '''<remarks/>

    IR

    

    '''<remarks/>

    [IS]

    

    '''<remarks/>

    IT

    

    '''<remarks/>

    JM

    

    '''<remarks/>

    JO

    

    '''<remarks/>

    JP

    

    '''<remarks/>

    KE

    

    '''<remarks/>

    KG

    

    '''<remarks/>

    KH

    

    '''<remarks/>

    KI

    

    '''<remarks/>

    KM

    

    '''<remarks/>

    KN

    

    '''<remarks/>

    KP

    

    '''<remarks/>

    KR

    

    '''<remarks/>

    KW

    

    '''<remarks/>

    KY

    

    '''<remarks/>

    KZ

    

    '''<remarks/>

    LA

    

    '''<remarks/>

    LB

    

    '''<remarks/>

    LC

    

    '''<remarks/>

    LI

    

    '''<remarks/>

    LK

    

    '''<remarks/>

    LR

    

    '''<remarks/>

    LS

    

    '''<remarks/>

    LT

    

    '''<remarks/>

    LU

    

    '''<remarks/>

    LV

    

    '''<remarks/>

    LY

    

    '''<remarks/>

    MA

    

    '''<remarks/>

    MC

    

    '''<remarks/>

    MD

    

    '''<remarks/>

    MG

    

    '''<remarks/>

    MH

    

    '''<remarks/>

    MK

    

    '''<remarks/>

    ML

    

    '''<remarks/>

    MM

    

    '''<remarks/>

    MN

    

    '''<remarks/>

    MO

    

    '''<remarks/>

    MP

    

    '''<remarks/>

    MQ

    

    '''<remarks/>

    MR

    

    '''<remarks/>

    MS

    

    '''<remarks/>

    MT

    

    '''<remarks/>

    MU

    

    '''<remarks/>

    MV

    

    '''<remarks/>

    MW

    

    '''<remarks/>

    MX

    

    '''<remarks/>

    MY

    

    '''<remarks/>

    MZ

    

    '''<remarks/>

    NA

    

    '''<remarks/>

    NC

    

    '''<remarks/>

    NE

    

    '''<remarks/>

    NF

    

    '''<remarks/>

    NG

    

    '''<remarks/>

    NI

    

    '''<remarks/>

    NL

    

    '''<remarks/>

    NO

    

    '''<remarks/>

    NP

    

    '''<remarks/>

    NR

    

    '''<remarks/>

    NU

    

    '''<remarks/>

    NZ

    

    '''<remarks/>

    OM

    

    '''<remarks/>

    PA

    

    '''<remarks/>

    PE

    

    '''<remarks/>

    PF

    

    '''<remarks/>

    PG

    

    '''<remarks/>

    PH

    

    '''<remarks/>

    PK

    

    '''<remarks/>

    PL

    

    '''<remarks/>

    PM

    

    '''<remarks/>

    PN

    

    '''<remarks/>

    PR

    

    '''<remarks/>

    PS

    

    '''<remarks/>

    PT

    

    '''<remarks/>

    PW

    

    '''<remarks/>

    PY

    

    '''<remarks/>

    QA

    

    '''<remarks/>

    RE

    

    '''<remarks/>

    RO

    

    '''<remarks/>

    RU

    

    '''<remarks/>

    RW

    

    '''<remarks/>

    SA

    

    '''<remarks/>

    SB

    

    '''<remarks/>

    SC

    

    '''<remarks/>

    SD

    

    '''<remarks/>

    SE

    

    '''<remarks/>

    SG

    

    '''<remarks/>

    SH

    

    '''<remarks/>

    SI

    

    '''<remarks/>

    SJ

    

    '''<remarks/>

    SK

    

    '''<remarks/>

    SL

    

    '''<remarks/>

    SM

    

    '''<remarks/>

    SN

    

    '''<remarks/>

    SO

    

    '''<remarks/>

    SR

    

    '''<remarks/>

    SS

    

    '''<remarks/>

    ST

    

    '''<remarks/>

    SV

    

    '''<remarks/>

    SY

    

    '''<remarks/>

    SZ

    

    '''<remarks/>

    TC

    

    '''<remarks/>

    TD

    

    '''<remarks/>

    TF

    

    '''<remarks/>

    TG

    

    '''<remarks/>

    TH

    

    '''<remarks/>

    TJ

    

    '''<remarks/>

    TK

    

    '''<remarks/>

    TL

    

    '''<remarks/>

    TM

    

    '''<remarks/>

    TN

    

    '''<remarks/>

    [TO]

    

    '''<remarks/>

    TR

    

    '''<remarks/>

    TT

    

    '''<remarks/>

    TV

    

    '''<remarks/>

    TW

    

    '''<remarks/>

    TZ

    

    '''<remarks/>

    UA

    

    '''<remarks/>

    UG

    

    '''<remarks/>

    UM

    

    '''<remarks/>

    US

    

    '''<remarks/>

    UY

    

    '''<remarks/>

    UZ

    

    '''<remarks/>

    VA

    

    '''<remarks/>

    VC

    

    '''<remarks/>

    VE

    

    '''<remarks/>

    VG

    

    '''<remarks/>

    VI

    

    '''<remarks/>

    VN

    

    '''<remarks/>

    VU

    

    '''<remarks/>

    WF

    

    '''<remarks/>

    WS

    

    '''<remarks/>

    YE

    

    '''<remarks/>

    YT

    

    '''<remarks/>

    YU

    

    '''<remarks/>

    ZA

    

    '''<remarks/>

    ZM

    

    '''<remarks/>

    ZW

End Enum



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute(),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code")>  _

Partial Public Class EmployeeLastNameKeyType

    

    Private lastNameField As String

    

    Private companyIdentifierField As String

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property LastName() As String

        Get

            Return Me.lastNameField

        End Get

        Set

            Me.lastNameField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property CompanyIdentifier() As String

        Get

            Return Me.companyIdentifierField

        End Get

        Set

            Me.companyIdentifierField = value

        End Set

    End Property

End Class



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute(),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code")>  _

Partial Public Class RequestingUserType

    

    Private companyIdentifierField As String

    

    Private usernameField As String

    

    Private roleField As RequestingUserTypeRole

    

    Private roleFieldSpecified As Boolean

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property CompanyIdentifier() As String

        Get

            Return Me.companyIdentifierField

        End Get

        Set

            Me.companyIdentifierField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property Username() As String

        Get

            Return Me.usernameField

        End Get

        Set

            Me.usernameField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _

    Public Property Role() As RequestingUserTypeRole

        Get

            Return Me.roleField

        End Get

        Set

            Me.roleField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlIgnoreAttribute()>  _

    Public Property RoleSpecified() As Boolean

        Get

            Return Me.roleFieldSpecified

        End Get

        Set

            Me.roleFieldSpecified = value

        End Set

    End Property

End Class



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute(),  _

 System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true)>  _

Public Enum RequestingUserTypeRole

    

    '''<remarks/>

    Partner

    

    '''<remarks/>

    Employer

    

    '''<remarks/>

    Manager

    

    '''<remarks/>

    Employee

End Enum



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute(),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code"),  _

 System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true)>  _

Partial Public Class GetEmployeeCorpGroupRequest

    

    Private requestingUserField As RequestingUserType

    

    Private effectiveOnField As Date

    

    Private filterField As GetEmployeeCorpGroupRequestFilter

    

    '''<remarks/>

    Public Property RequestingUser() As RequestingUserType

        Get

            Return Me.requestingUserField

        End Get

        Set

            Me.requestingUserField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlElementAttribute(DataType:="date")>  _

    Public Property EffectiveOn() As Date

        Get

            Return Me.effectiveOnField

        End Get

        Set

            Me.effectiveOnField = value

        End Set

    End Property

    

    '''<remarks/>

    Public Property Filter() As GetEmployeeCorpGroupRequestFilter

        Get

            Return Me.filterField

        End Get

        Set

            Me.filterField = value

        End Set

    End Property

End Class



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.SerializableAttribute(),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code"),  _

 System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true)>  _

Partial Public Class GetEmployeeCorpGroupRequestFilter

    

    Private employeesField() As EmployeeKeyType

    

    Private companiesField() As String

    

    Private lastNamesField() As EmployeeLastNameKeyType

    

    Private typesField() As CorpGroupTypeType

    

    '''<remarks/>

    <System.Xml.Serialization.XmlArrayItemAttribute("EmployeeKey", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=false)>  _

    Public Property Employees() As EmployeeKeyType()

        Get

            Return Me.employeesField

        End Get

        Set

            Me.employeesField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlArrayItemAttribute("CompanyIdentifier", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=false)>  _

    Public Property Companies() As String()

        Get

            Return Me.companiesField

        End Get

        Set

            Me.companiesField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlArrayItemAttribute("LastNameKey", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=false)>  _

    Public Property LastNames() As EmployeeLastNameKeyType()

        Get

            Return Me.lastNamesField

        End Get

        Set

            Me.lastNamesField = value

        End Set

    End Property

    

    '''<remarks/>

    <System.Xml.Serialization.XmlArrayItemAttribute("CorpGroupType", IsNullable:=false)>  _

    Public Property Types() As CorpGroupTypeType()

        Get

            Return Me.typesField

        End Get

        Set

            Me.typesField = value

        End Set

    End Property

End Class



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")>  _

Public Delegate Sub GetEmployeeCorpGroupCompletedEventHandler(ByVal sender As Object, ByVal e As GetEmployeeCorpGroupCompletedEventArgs)



'''<remarks/>

<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"),  _

 System.Diagnostics.DebuggerStepThroughAttribute(),  _

 System.ComponentModel.DesignerCategoryAttribute("code")>  _

Partial Public Class GetEmployeeCorpGroupCompletedEventArgs

    Inherits System.ComponentModel.AsyncCompletedEventArgs

    

    Private results() As Object

    

    Friend Sub New(ByVal results() As Object, ByVal exception As System.Exception, ByVal cancelled As Boolean, ByVal userState As Object)

        MyBase.New(exception, cancelled, userState)

        Me.results = results

    End Sub

    

    '''<remarks/>

    Public ReadOnly Property Result() As EmployeeCorpGroupType()

        Get

            Me.RaiseExceptionIfNecessary

            Return CType(Me.results(0),EmployeeCorpGroupType())

        End Get

    End Property

End Class

Open in new window

0
Comment
Question by:sk1922
  • 2
3 Comments
 
LVL 30

Expert Comment

by:MlandaT
ID: 33427869
1. It is really not clear what exactly your are trying to achieve here. Can you maybe explain (ahem... in English and not VB) what exactly you are expecting to be returned...
2. A sub cannot return data... you have to use a Function
3. You will also need to qualify the function with the <WebMethod()> attribute
0
 

Author Comment

by:sk1922
ID: 33431057
There will be times when I only want specific <CorpGroupType> and its corresponding <CorpGroupName> returned instead of looping through all of them.  There may be times when I would only require 1/2/3 types and names, like so...

<CorpGroupKey>
   <CorpGroupType>Department</CorpGroupType>
   <CorpGroupName>Sales</CorpGroupName>
   <CompanyIdentifier>test.com</CompanyIdentifier>
</CorpGroupKey>
<CorpGroupKey>
   <CorpGroupType>Location</CorpGroupType>
   <CorpGroupName>Corporate</CorpGroupName>
   <CompanyIdentifier>test.com</CompanyIdentifier>
</CorpGroupKey>

I'm trying to figure out how to expose these values.  I understand functions/subs just fine.  I'm just not able to figure out how to properly expose these values.


Any assistance or guidance will be greatly appreciated.

 
0
 
LVL 30

Accepted Solution

by:
MlandaT earned 500 total points
ID: 33440186
Your data here looks like it can easily be put into tabular format (with NULL values where there is no data)... you can then just load all that data into a dataset adn return that dataset. Your client applicaiton (which I'm asusming is also a .NET application based on your proxy) can easily work with the data in XML format. So in essence:

1) Just load the data you want to return into a datasaet and return that dataset
2) Don't worry about the transport mechanism of how the dataset is sent down to your client (though it is sent as an XML string)
3) Let your client application consume the dataset, just right click on the web reference and select 'Update Reference', that will update your proxy to use the correct and updated web service methods
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

New Relic recently released its Synthetics product that allows for the creation of performance monitors that periodically test a site's performance. If you wish to test an interactive workflow New Relic employs Selenium WebDriverJS to run those test…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now