VMware {code} Community
kbarnes
Contributor
Contributor

Getting started guide code issue

OK, this Getting Started guide is awesome, as it clearly spells out exactly what needs to be done. Especially important for me since I am also learning C#. However, the console doesn't seem to like my VC server. Or vice versa. This is the code where the wheels fly off of the wagon: try { sic = service.RetrieveServiceContent(svcRef); } catch (Exception ex) { Console.WriteLine("Caught Exception: " + ex.Message); } I get this as a return: Caught Exception: The request failed with HTTP status 400: Bad Request. Connecting... Caught Exception: Object reference not set to an instance of an object. Done!!! Press any key to Exit   I'm not sure where to proceed from here. Any thoughts? My reading of the code indicates that there can't be a cert issue, as the validation check on the cert always returns true. It does appear that communications are working, as it's getting a return code. My next guess was that there's something odd in my VC setup, but I have yet to be able to find anything that jumps out at me. If anyone can suggest further reading material that would help reveal the source of the problem, I'd be most grateful.

0 Kudos
1 Reply
admin
Immortal
Immortal

Hi,

It seems that the URL which you are passing to connect to your server is incorrect. It should be of following format:

https:///sdk

Please try passing the URL in above format and let us know if that helps.

You can refer to SDK readme document ( shipped with vSphere SDK) and some existing samples which are shipped with vSphere SDK, which uses client side utilities, to run the shipped samples.

I hope that this solves the issue at your end.

Thanks,

Angela

0 Kudos