Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

object of array of objects problem

Status
Not open for further replies.

NotMyRealName221

Programmer
Oct 28, 2008
8
US
I feel like a total newb asking this question but I'm hitting the wall with this sillyness.

I just used the wsdl.exe to create code for a SOAP service.
Speaking of which... is this really a necessary comment to put in that autogenerated code:
// This code was generated by a tool.
(who's it calling a tool?)

anywho...
I now have a bunch of objects, and arrays of objects. I can't for the life of me figure out how to use them correctly. I'm starting with a login attempt:

Code:
Dim objLogin As New Security_Login
Dim objUser As New Security_User
Dim objPassword As New Security_Password

objUser.username = "login"
objUser.level = 2

objPassword.password = "password"
objPassword.dataLength = 8

objLogin.user = objUser
objLogin.password = objPassword

It gives me this error message:
Compiler Error Message: BC30311: Value of type 'Security_User' cannot be converted to '1-dimensional array of Security_User'.

I've tried setting objUser as an array but I just keep getting errors, including my least favorite "Object reference not set to an instance of an object"

The soap service does allow logging in with multiple credentials so I understand that this needs to be an array, but I can't seem to get the syntax right.

Can anyone help me?


 
objLogin.user = objUser

in the definition of User for the security_login object did you accidentally add a set of parenthesis at the end of the name, like:

dim b() as stuff
or
Dim b as stuff()
which is different than:
Dim b as new stuff()

If [blue]you have problems[/blue], I want [green]source code[/green] AND [green]error messages[/green], none of this [red]"there was an error crap"[/red]
 
Yes, there is... well, that part is in C# so it's brackets, but that is correct. it IS possible to send it multiple credentials. So the [] need to be there, I'm just not sure how to set the first element of that array of objects? I keep getting different errors.

What would be the correct syntax for that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top