VMware Solutions Discussions

VSC API error

SANJEEVROHILA
8,040 Views

Hi All,

we have installed VSC installed on server a server 192.168.120.102, the VCenter is installed on another server 192.168.120.108 and the vsc version is 2.1 and is successfully integrated in vCenter , now when we are trying to invoke methods like createDatastore through perl using SOAP, it is showing the error however through vCenter its performing well, below is the xml error (error.txt is attached for detailed error), could somebody help on this ??

Thanks in advance.

Regards,

Sanjeev

12 REPLIES 12

costea
8,024 Views

The error message shows: Unable to connect to VC server at https://192.168.120.108/sdk/vimService

You need to specify the connection paths as described in the samples and the IAG.

my $vc = "192.168.120.108";

my $serviceHost = "192.168.120.102";

my $rcuService = SOAP::Lite->service("https://$serviceHost:8143/kamino/public/api?wsdl");

my $serviceUrl = SOAP::Data->type('string')->name('serviceUrl')->value("https://$vc/sdk");

SANJEEVROHILA
8,024 Views

but i am using exactly whatever you specied above ...but there is something which seems a prolem ..

when i go to the web bowser and enter url #https://192.168.120.108/sdk

i get the  the below message

HTTP 404 - File not found
Internet Explorer


however if i type https://192.168.120.108/ in 192.168.120.102's web browser "VMware vSphere 4" console appers


is that an issue ???

costea
8,024 Views

That shouldn't be a problem.  You could try running the API from 192.168.120.108.

SANJEEVROHILA
8,024 Views

we are running the API from another server not from 192.168.120.108.

costea
8,024 Views

Well, based on what you've reported, it appears to be some networking issue.  You can reach it from one server but not another.

SANJEEVROHILA
8,024 Views

the server where i am running api i am able to ping both 102 & 108 but vice versa is not possible.

ADAM_SEKORA
8,024 Views

Hi Sanjeev,

No, the HTTP 404 is not a problem. You can see the following VMware KB for more info: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003218

What do you receive if you navigate to https://192.168.120.108/mob/ from 192.168.120.102 and use the same username you provided vsc?

Also, I have sent you a private message on another matter, please check your inbox.

Regards,

Adam S.

SANJEEVROHILA
8,024 Views

Hi Adam,

Thanks i have checked your message!!

moreover on the above action what you asked above, on doing that it asks for credentials and after supplying the credentials we get another page , please check screenshot below!!

ADAM_SEKORA
8,024 Views

Hi Sanjeev,

Also, you have said that you are trying to invoke the VSC methods via the SOAP api. Have you tried the same functions through the UI instead of using SOAP? Does it provide different results?

Regards,

Adam S.

SANJEEVROHILA
6,955 Views

you mean to say through the GUI of vcenter ? yeah the operation which i need to perform through api are working well while using GUI.

ADAM_SEKORA
6,955 Views

Hi Sanjeev,

If its working through the UI, then its doubtful that its a network issue as any network issue affecting the API would also affect the UI. Your ability to navigate to the MOB shows that the web services(tomcat, etc) are working and that the vmware SDK interface should be working as well.

I believe it just comes down to how you're making your call and the parameters therein.Can you verify and post what you have set in your POST for the ServiceURL parameter?

Regards,

Adam S.

SANJEEVROHILA
6,955 Views

Hi Adam,

Thanks for you response!!

below are some parts of my code,

my $vscService = SOAP::Lite->service("https://192.168.xxx.102:8143/kamino/public/api?wsdl");

my $serviceUrl = SOAP::Data->type('string')->name('serviceUrl')->value("https://192.168.xxx.108/sdk");

in the createDatastore method i have

my $datastoreSpec = getDatastoreSpec("arg0");

    my $requestSpec = getRequestSpec("arg1");

    return $vscService->createDatastore($datastoreSpec, $requestSpec);

moreover in my request xml the field SOAP Action is blank, it shouldn't be blank.please suggest ?

could you please speak on pm ??

thanks in advance ...

Regards,

Sanjeev

this is how it is ? is there any modification required ??

Public