G
Guest
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 = "(e-mail address removed)"
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??
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 = "(e-mail address removed)"
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??