Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8591655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:34:34+00:00 2026-06-11T23:34:34+00:00

I have a WebService defined as this: <WebMethod(Description:=Retrieve a list of account profiles.)> _

  • 0

I have a WebService defined as this:

<WebMethod(Description:="Retrieve a list of account profiles.")> _
<System.Web.Services.Protocols.SoapHeader("MyHeader")> _
Public Function RetrieveAccountProfile(<XmlElement(IsNullable:=True, Type:=GetType(WSRetrieveAccountProfile))> ByVal myAccount As WSRetrieveAccountProfile) As <XmlElement(IsNullable:=True)> WSResponseRetrieveAccountProfile
...

The class I am passing as an input parameter WSRetrieveAccountProfile is defined like this:

<Serializable()> _
<XmlType(Namespace:="http://mynamespace/", TypeName:="WSRetrieveAccountProfile")> _
Public Class WSRetrieveAccountProfile

    <XmlElement(IsNullable:=False)> Public accountNumber As List(Of Integer)

    Public Sub New()
    End Sub

    Public Function Validate() As Boolean
        'Validations here
        Return True
    End Function
End Class

The issue: I consume web-service and I am working on the client side where I am trying to declare an object of type WSRetrieveAccountProfile so I can pass it as an input parameter when calling the web-service, but I get compilation error – it cannot recognize the type.

After checking Reference.vb I notice that an input parameter for the function is a plain array of Integer ByVal myAccount() As Integer. Now, if I add another variable to the WSRetrieveAccountProfile class definition the ByVal myAccount() As Integer suddenly changes to ByVal myAccount As WSRetrieveAccountProfile and problem is solved.

How do I solve this WITHOUT adding an unnecessary variable? I tried with XmlType attribute with no luck.

* UPDATE *
This definition works:

<Serializable()> _
<XmlType(Namespace:="http://mynamespace/", TypeName:="WSRetrieveAccountProfile")> _
Public Class WSRetrieveAccountProfile

    <XmlElement(IsNullable:=False)> Public accountNumber As List(Of Integer)
    <XmlElement(IsNullable:=True)> Public TEST As String
    Public Sub New()
    End Sub

    Public Function Validate() As Boolean
        'Validations here
        Return True
    End Function
End Class

* UPDATE – SOLUTION *

If I change
<XmlElement(IsNullable:=False)> Public accountNumber As List(Of Integer)
to
<XmlArray(IsNullable:=True)> Public accountNumber As List(Of Integer)

then the proxy is generated properly and I no longer have an issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:34:35+00:00Added an answer on June 11, 2026 at 11:34 pm

    Change

    <XmlElement(IsNullable:=False)> Public accountNumber As List(Of Integer)

    to

    <XmlArray(IsNullable:=True)> Public accountNumber As List(Of Integer)

    to fix proxy generation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a standard webservice in ASP .Net 4.0 defined like this: [WebMethod] public
I have a web service, defined(WSDL) and implemented in PHP. This one is relatively
Can't seem to figure this one out. I have a web service defined as
I have a list of calls i can do to a webservice defined in
I have an interesting problem, I have two web services defined in a spring-conf.xml
I have a list of permissions defined like this: private List<PermissionItem> permissionItems; private ReadOnlyCollection<PermissionItem>
I have a webservice defined with Jersey in the server side like this: @POST
I have several constant defined for a webservice, and I would like to make
I have defined small MXML component which calls web service which returns random number
I have an ASP.NET web service (.asmx). My service is defined like the following:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.