2 Replies Latest reply on Jun 30, 2016 7:28 PM by Stone_Wu

    Login Issue - The given header was not found

    Stone_Wu Lurker

      Hi I'm new to .net sdk vCloud, i'm trying to create a webservice to connect to vCloud via API.

      I downloaded code example on GitHub - rdbwebster/vcdapisamples: Vmware VCD .Net C# API examples

       

      Tried a very simple code below :

       

      vCloudClient client = new vCloudClient("{param1}", com.vmware.vcloud.sdk.constants.Version.V5_5);

      client.Login({param2}, {param3});

       

      The data that i put it into above parameters are as per https://dl.dropboxusercontent.com/u/20066282/vCloud%20Q%26A.png

      After i run the code it got me error "The given header was not found".

      I'm not sure if the code are suppose to put in "Accept" in header with value as "application/*+xml;version=1.5" to make sure i can login

      or the parameter that i put in are wrong, please help !!

       

      The detail of my exception message are :

      {com.vmware.vcloud.sdk.utility.VCloudRuntimeException: The given header was not found. ---> System.InvalidOperationException: The given header was not found.

         at System.Net.Http.Headers.HttpHeaders.GetValues(String name)

         at com.vmware.vcloud.sdk.utility.RestUtil.Login(vCloudClient client, String url, HttpRequestHeaders authHeader)

         --- End of inner exception stack trace ---

         at com.vmware.vcloud.sdk.vCloudClient.Login(String userName, String password)

         at Com.Vmware.Vcloud.Sdk.Samples.ListAllvApps.Main(String[] args) in d:\Downloads\Binary\VMware-vCloudDirector-.NetSDK-5.5.0\Samples\ListAllvApps\ListAllvApps.cs:line 90}