Quantcast
Channel: VMware Communities : All Content - vSphere Management SDK
Viewing all articles
Browse latest Browse all 1860

vi sdkf for c++ of ESXi 5.5

$
0
0

Hi Guys:

  I'm trying to develop a client with C++ to communicate with vmware web service.

  By searching in the forum I've chosen the gsoap way to generate C++ library.

  This is how I generated the share object in Ubuntu:

  1. wsdlh -o vim25.h https://192.168.1.220/sdk/vim.wsdl
  2. soacpp2 -x -C -I/usr/local/share/gsoap/import vim25.h
  3. g++-fPIC-I/usr/local/share/gsoap/import-DWITH_OPENSSL-DWITH_COOKIES-c soapClient.cpp
  4. g++-fPIC-I/usr/local/share/gsoap/import-DWITH_OPENSSL-DWITH_COOKIES-c soapC.cpp
  5. g++-I/usr/local/share/gsoap/import-DWITH_OPENSSL-DWITH_COOKIES-shared -o libvimsoap.so soapC.o soapClient.o

 

Then I copy the share object  into /usr/lib, and compile the test.cpp as below:

  1. g++-I/usr/local/share/gsoap/import-DWITH_OPENSSL-DWITH_COOKIES/root/gsoap_2.8.31/gsoap-28/gsoap/stdsoap2.cpp test.cpp -lssl-lcrypto-l gsoapssl++-lpthread-lvimsoap-o vmat

 

  1. #include<iostream>
  2. #include<cstddef>
  3. #include"soapVimBindingProxy.h"
  4. #include"VimBinding.nsmap"
  5. #include"soapStub.h"
  6. #include"soapH.h"
  7. #include<time.h>
  8. #include<iostream>
  9.  
  10. usingnamespace std;
  11. void sigpipe_handle(int x){ cout <<"sigpipe "<< x << endl;}
  12.  
  13. int main(){
  14. VimBinding vim;
  15. int a =1;
  16. return a;
  17. }

 

This test program just did not except define a "Vimbinding"  variable here.

In the compiling I got the following error message here:

  1. test.cpp:14:5: error:VimBinding was not declared in this scope
  2. VimBinding vim;
  3. ^

 

I'm a newbei in this, could any of you guys kindly help to give some advice here, thanks a lot!


Viewing all articles
Browse latest Browse all 1860

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>