passing non-primitive values to array class

Discussion in 'ASP .Net' started by =?Utf-8?B?YW1hem9u?=, Nov 5, 2006.

  1. I have web service that acceping following parameters..
    postev.PostEvent(authentication as ws.authentication, name as string,id as
    string, exdate as date, parameter() as ws.nameparametervaluepair (I need help
    in passing this))

    Postev.postEvent(auth(), "Test", "1234567", tdt, parameter())

    For the first parameter authentication I have:

    Private Function auth() As ws.Authentication
    Dim authWF As ws_sghe_WF.Authentication = New ws.Authentication()
    authWF.principal = "test"
    authWF.credential = "testpwd"
    Return auth
    End Function

    It is working fine and I am connecting to web service

    If I do the same thing for passing parameter()

    Private Function parameter() As ws.NameParameterValuePair()
    Dim parameter As ws.NameParameterValuePair()
    parameter = New ws.NameParameterValuePair(2) {}

    parameter(0).name = "string"
    parameter(0).ItemElementName = ""

    parameter(1).name = "string"
    parameter(1).ItemElementName = "my name"

    Return parameter
    End Function

    I get following error:
    Object reference not set to an instance of an object.

    If I remove (2) from declaration:
    Index was outside the bounds of the array

    Any suggessions??
     
    =?Utf-8?B?YW1hem9u?=, Nov 5, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DoesDotNet
    Replies:
    2
    Views:
    540
    Manuel Baumann
    Apr 22, 2005
  2. Replies:
    7
    Views:
    613
    Victor Bazarov
    May 9, 2005
  3. bernd
    Replies:
    1
    Views:
    799
    bernd
    Jun 13, 2008
  4. Daniel Pitts
    Replies:
    7
    Views:
    488
  5. Bsiang Tan

    [Howto] passing non-primitive data ?

    Bsiang Tan, Feb 9, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    126
    Jan Tielens
    Feb 9, 2004
Loading...

Share This Page