<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using VMware Webservice with C++ and gSOAP</title>
	<atom:link href="http://www.randombugs.com/linux/vmware-webservice-gsoap.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.randombugs.com/linux/vmware-webservice-gsoap.html</link>
	<description>Just another Bastard Operator From Hell. Everything from *nix to programming</description>
	<lastBuildDate>Sat, 14 Jan 2012 18:33:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: admin</title>
		<link>http://www.randombugs.com/linux/vmware-webservice-gsoap.html/comment-page-1#comment-3062</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sat, 14 Jan 2012 18:33:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=529#comment-3062</guid>
		<description>Thanks Yash. Sorry for the late answer.</description>
		<content:encoded><![CDATA[<p>Thanks Yash. Sorry for the late answer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: YASH</title>
		<link>http://www.randombugs.com/linux/vmware-webservice-gsoap.html/comment-page-1#comment-3056</link>
		<dc:creator>YASH</dc:creator>
		<pubDate>Mon, 09 Jan 2012 05:09:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=529#comment-3056</guid>
		<description>Hi,
     I had got the answer for the above issue. Since it was first time i was refereing to VMWare and Soap, i was little confusing, but VWMare has provided really good documents and the MOB Browser, by using these two things i was able to understand the VMWare stuff.

 
1&gt; Getting Started Doc by VMware
2&gt; https:///mob

 
Thanks &amp; Regards,
YASH.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
     I had got the answer for the above issue. Since it was first time i was refereing to VMWare and Soap, i was little confusing, but VWMare has provided really good documents and the MOB Browser, by using these two things i was able to understand the VMWare stuff.</p>
<p>1&gt; Getting Started Doc by VMware<br />
2&gt; <a href="https:///mob" rel="nofollow">https:///mob</a></p>
<p>Thanks &amp; Regards,<br />
YASH.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: YASH</title>
		<link>http://www.randombugs.com/linux/vmware-webservice-gsoap.html/comment-page-1#comment-3050</link>
		<dc:creator>YASH</dc:creator>
		<pubDate>Thu, 05 Jan 2012 00:38:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=529#comment-3050</guid>
		<description>Iam new to VMWare and WebService, but i want to get information from the VMWare server by using C++, the only thing that iam still confused is how to decide the hierarchy before the call is given, for e.g.
you had created the following hierarchy

ns1__SelectionSpec folderTraversalSelectionSpec;
  folderTraversalSelectionSpec.name = new string(&quot;FolderTraversalSpec&quot;);
  ns1__SelectionSpec dataCenterVMTraversalSelectionSpec;
  dataCenterVMTraversalSelectionSpec.name = new string(&quot;DataCenterVMTraversalSpec&quot;);
 
  ns1__TraversalSpec folderTraversalSpec;
  folderTraversalSpec.name = new string(&quot;FolderTraversalSpec&quot;);
  folderTraversalSpec.type = &quot;Folder&quot;;
  folderTraversalSpec.path = &quot;childEntity&quot;;
  folderTraversalSpec.skip = &amp;xsd_true;
 
  ns1__TraversalSpec dataCenterVMTraversalSpec;
  dataCenterVMTraversalSpec.name = new string(&quot;DataCenterVMTraversalSpec&quot;);
  dataCenterVMTraversalSpec.type = &quot;Datacenter&quot;;
  dataCenterVMTraversalSpec.path = &quot;vmFolder&quot;;
  dataCenterVMTraversalSpec.skip = &amp;xsd_true;
 dataCenterVMTraversalSpec.selectSet.push_back(&amp;folderTraversalSelectionSpec);
  folderTraversalSpec.selectSet.push_back(&amp;dataCenterVMTraversalSelectionSpec);
  folderTraversalSpec.selectSet.push_back(&amp;folderTraversalSelectionSpec);
 
  ns1__PropertySpec propertySpec;
  propertySpec.type = &quot;VirtualMachine&quot;;
  propertySpec.pathSet.push_back(&quot;name&quot;);
  propertySpec.pathSet.push_back(&quot;guest.ipAddress&quot;);
  propertySpec.all = &amp;xsd_false;


How you come to know about this hierarchy or the process.

Thanks,
Yash</description>
		<content:encoded><![CDATA[<p>Iam new to VMWare and WebService, but i want to get information from the VMWare server by using C++, the only thing that iam still confused is how to decide the hierarchy before the call is given, for e.g.<br />
you had created the following hierarchy</p>
<p>ns1__SelectionSpec folderTraversalSelectionSpec;<br />
  folderTraversalSelectionSpec.name = new string(&#8220;FolderTraversalSpec&#8221;);<br />
  ns1__SelectionSpec dataCenterVMTraversalSelectionSpec;<br />
  dataCenterVMTraversalSelectionSpec.name = new string(&#8220;DataCenterVMTraversalSpec&#8221;);</p>
<p>  ns1__TraversalSpec folderTraversalSpec;<br />
  folderTraversalSpec.name = new string(&#8220;FolderTraversalSpec&#8221;);<br />
  folderTraversalSpec.type = &#8220;Folder&#8221;;<br />
  folderTraversalSpec.path = &#8220;childEntity&#8221;;<br />
  folderTraversalSpec.skip = &amp;xsd_true;</p>
<p>  ns1__TraversalSpec dataCenterVMTraversalSpec;<br />
  dataCenterVMTraversalSpec.name = new string(&#8220;DataCenterVMTraversalSpec&#8221;);<br />
  dataCenterVMTraversalSpec.type = &#8220;Datacenter&#8221;;<br />
  dataCenterVMTraversalSpec.path = &#8220;vmFolder&#8221;;<br />
  dataCenterVMTraversalSpec.skip = &amp;xsd_true;<br />
 dataCenterVMTraversalSpec.selectSet.push_back(&amp;folderTraversalSelectionSpec);<br />
  folderTraversalSpec.selectSet.push_back(&amp;dataCenterVMTraversalSelectionSpec);<br />
  folderTraversalSpec.selectSet.push_back(&amp;folderTraversalSelectionSpec);</p>
<p>  ns1__PropertySpec propertySpec;<br />
  propertySpec.type = &#8220;VirtualMachine&#8221;;<br />
  propertySpec.pathSet.push_back(&#8220;name&#8221;);<br />
  propertySpec.pathSet.push_back(&#8220;guest.ipAddress&#8221;);<br />
  propertySpec.all = &amp;xsd_false;</p>
<p>How you come to know about this hierarchy or the process.</p>
<p>Thanks,<br />
Yash</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.randombugs.com/linux/vmware-webservice-gsoap.html/comment-page-1#comment-1223</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sun, 26 Dec 2010 11:46:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=529#comment-1223</guid>
		<description>Thanks for contributing !


Regards</description>
		<content:encoded><![CDATA[<p>Thanks for contributing !</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: deckardd</title>
		<link>http://www.randombugs.com/linux/vmware-webservice-gsoap.html/comment-page-1#comment-1170</link>
		<dc:creator>deckardd</dc:creator>
		<pubDate>Sat, 25 Dec 2010 16:11:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=529#comment-1170</guid>
		<description>Here&#039;s a fixed vm listing routine for vsphere 4.1:


int DumpVMs(VimBindingProxy* vim, ns1__ServiceContent* serviceContent)
{
	bool xsd_true = 1;
	bool xsd_false = 0;

	/* Create the container view for virtual machines */
	ns1__CreateContainerViewRequestType containerRequestType;
	containerRequestType._USCOREthis = serviceContent-&gt;viewManager;
	containerRequestType.container = serviceContent-&gt;rootFolder;
	containerRequestType.type.push_back(&quot;VirtualMachine&quot;);
	containerRequestType.recursive = true;

	_ns1__CreateContainerViewResponse containerRequestResponse;

	if (vim-&gt;CreateContainerView(&amp;containerRequestType, &amp;containerRequestResponse) != SOAP_OK)
	{
		exit(1);
	}

	/* Create the object spec to define the beggining of the traversal at our view */
	ns1__ObjectSpec objectSpec;
	objectSpec.obj = containerRequestResponse.returnval;
	objectSpec.skip = &amp;xsd_true;

  ns1__TraversalSpec traversalSpec;
  traversalSpec.name = new string(&quot;traverseEntities&quot;);
  traversalSpec.path = &quot;view&quot;;
  traversalSpec.skip = &amp;xsd_false;
  traversalSpec.type = &quot;ContainerView&quot;;

  	objectSpec.selectSet.push_back(&amp;traversalSpec);

	/* specify what property we want */
  ns1__PropertySpec propertySpec;
  propertySpec.type = &quot;VirtualMachine&quot;;
  propertySpec.pathSet.push_back(&quot;name&quot;);
  propertySpec.all = &amp;xsd_false;

	// add this to the main request filter spec
	ns1__PropertyFilterSpec propertyFilterSpec;
	propertyFilterSpec.reportMissingObjectsInResults = &amp;xsd_false;
	propertyFilterSpec.propSet.push_back(&amp;propertySpec);
	propertyFilterSpec.objectSet.push_back(&amp;objectSpec);

	// and execute
	ns1__RetrievePropertiesExRequestType request;
	ns1__RetrieveOptions options;

	request._USCOREthis = serviceContent-&gt;propertyCollector;
	request.specSet.push_back(&amp;propertyFilterSpec);
	request.options = &amp;options;

	_ns1__RetrievePropertiesExResponse retrievePropertiesRes;

	if (vim-&gt;RetrievePropertiesEx(&amp;request, &amp;retrievePropertiesRes) == SOAP_OK)
	{
	  cout &lt;&lt; &quot;Number of Objects &quot; &lt;objects.size() &lt;&lt; endl;
 
    ns1__ObjectContent* oc = NULL;
  ns1__DynamicProperty* dynamicProperty;
    for (int i=0; i objects.size(); i++)
    {
        oc = retrievePropertiesRes.returnval-&gt;objects[i];
        cout &lt;&lt; &quot; Object Type: &quot; &lt;obj-&gt;type-&gt;c_str();
        cout &lt;&lt; &quot; (&quot; &lt;propSet.size() &lt;&lt; &quot; properties), &quot;;
        for (int j=0; j propSet.size(); j++)
        {
            dynamicProperty = oc-&gt;propSet[j];
 
            if ( dynamicProperty-&gt;name == &quot;name&quot; )
            {
                xsd__string* name = (xsd__string *) dynamicProperty-&gt;val;
                cout &lt;&lt; &quot; Name: &quot; &lt;__item;
            }
 
            if ( dynamicProperty-&gt;name == &quot;guest.ipAddress&quot; )
            {
                xsd__string* name = (xsd__string *) dynamicProperty-&gt;val;
                cout &lt;&lt; &quot; IP Address: &quot; &lt;__item;
            }
 
            if ( dynamicProperty-&gt;name == &quot;guest.guestState&quot; )
            {
                xsd__string* name = (xsd__string *) dynamicProperty-&gt;val;
                cout &lt;&lt; &quot; Guest State: &quot; &lt;__item;
            }
 
        }
        cout &lt;&lt; endl;
    }
	}

	return 0;
}</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a fixed vm listing routine for vsphere 4.1:</p>
<p>int DumpVMs(VimBindingProxy* vim, ns1__ServiceContent* serviceContent)<br />
{<br />
	bool xsd_true = 1;<br />
	bool xsd_false = 0;</p>
<p>	/* Create the container view for virtual machines */<br />
	ns1__CreateContainerViewRequestType containerRequestType;<br />
	containerRequestType._USCOREthis = serviceContent-&gt;viewManager;<br />
	containerRequestType.container = serviceContent-&gt;rootFolder;<br />
	containerRequestType.type.push_back(&#8220;VirtualMachine&#8221;);<br />
	containerRequestType.recursive = true;</p>
<p>	_ns1__CreateContainerViewResponse containerRequestResponse;</p>
<p>	if (vim-&gt;CreateContainerView(&amp;containerRequestType, &amp;containerRequestResponse) != SOAP_OK)<br />
	{<br />
		exit(1);<br />
	}</p>
<p>	/* Create the object spec to define the beggining of the traversal at our view */<br />
	ns1__ObjectSpec objectSpec;<br />
	objectSpec.obj = containerRequestResponse.returnval;<br />
	objectSpec.skip = &amp;xsd_true;</p>
<p>  ns1__TraversalSpec traversalSpec;<br />
  traversalSpec.name = new string(&#8220;traverseEntities&#8221;);<br />
  traversalSpec.path = &#8220;view&#8221;;<br />
  traversalSpec.skip = &amp;xsd_false;<br />
  traversalSpec.type = &#8220;ContainerView&#8221;;</p>
<p>  	objectSpec.selectSet.push_back(&amp;traversalSpec);</p>
<p>	/* specify what property we want */<br />
  ns1__PropertySpec propertySpec;<br />
  propertySpec.type = &#8220;VirtualMachine&#8221;;<br />
  propertySpec.pathSet.push_back(&#8220;name&#8221;);<br />
  propertySpec.all = &amp;xsd_false;</p>
<p>	// add this to the main request filter spec<br />
	ns1__PropertyFilterSpec propertyFilterSpec;<br />
	propertyFilterSpec.reportMissingObjectsInResults = &amp;xsd_false;<br />
	propertyFilterSpec.propSet.push_back(&amp;propertySpec);<br />
	propertyFilterSpec.objectSet.push_back(&amp;objectSpec);</p>
<p>	// and execute<br />
	ns1__RetrievePropertiesExRequestType request;<br />
	ns1__RetrieveOptions options;</p>
<p>	request._USCOREthis = serviceContent-&gt;propertyCollector;<br />
	request.specSet.push_back(&amp;propertyFilterSpec);<br />
	request.options = &amp;options;</p>
<p>	_ns1__RetrievePropertiesExResponse retrievePropertiesRes;</p>
<p>	if (vim-&gt;RetrievePropertiesEx(&amp;request, &amp;retrievePropertiesRes) == SOAP_OK)<br />
	{<br />
	  cout &lt;&lt; &quot;Number of Objects &quot; &lt;objects.size() &lt;&lt; endl;</p>
<p>    ns1__ObjectContent* oc = NULL;<br />
  ns1__DynamicProperty* dynamicProperty;<br />
    for (int i=0; i objects.size(); i++)<br />
    {<br />
        oc = retrievePropertiesRes.returnval-&gt;objects[i];<br />
        cout &lt;&lt; &quot; Object Type: &quot; &lt;obj-&gt;type-&gt;c_str();<br />
        cout &lt;&lt; &quot; (&quot; &lt;propSet.size() &lt;&lt; &quot; properties), &quot;;<br />
        for (int j=0; j propSet.size(); j++)<br />
        {<br />
            dynamicProperty = oc-&gt;propSet[j];</p>
<p>            if ( dynamicProperty-&gt;name == &#8220;name&#8221; )<br />
            {<br />
                xsd__string* name = (xsd__string *) dynamicProperty-&gt;val;<br />
                cout &lt;&lt; &quot; Name: &quot; &lt;__item;<br />
            }</p>
<p>            if ( dynamicProperty-&gt;name == &#8220;guest.ipAddress&#8221; )<br />
            {<br />
                xsd__string* name = (xsd__string *) dynamicProperty-&gt;val;<br />
                cout &lt;&lt; &quot; IP Address: &quot; &lt;__item;<br />
            }</p>
<p>            if ( dynamicProperty-&gt;name == &#8220;guest.guestState&#8221; )<br />
            {<br />
                xsd__string* name = (xsd__string *) dynamicProperty-&gt;val;<br />
                cout &lt;&lt; &quot; Guest State: &quot; &lt;__item;<br />
            }</p>
<p>        }<br />
        cout &lt;&lt; endl;<br />
    }<br />
	}</p>
<p>	return 0;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.randombugs.com/linux/vmware-webservice-gsoap.html/comment-page-1#comment-640</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 27 Oct 2010 08:12:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=529#comment-640</guid>
		<description>Until now we didn&#039;t upgrade to 4.1, but when we will upgrade I will post the changes. Until then try to see what changes are on wsdl side or check the vmware developer forums.

Regards</description>
		<content:encoded><![CDATA[<p>Until now we didn&#8217;t upgrade to 4.1, but when we will upgrade I will post the changes. Until then try to see what changes are on wsdl side or check the vmware developer forums.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pankaj</title>
		<link>http://www.randombugs.com/linux/vmware-webservice-gsoap.html/comment-page-1#comment-639</link>
		<dc:creator>Pankaj</dc:creator>
		<pubDate>Sat, 23 Oct 2010 03:41:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=529#comment-639</guid>
		<description>I have tried this wih vCenter 4.1 and VM list returns me 0/ZERO number of object. Is there something changed recently in the was this API are being used?</description>
		<content:encoded><![CDATA[<p>I have tried this wih vCenter 4.1 and VM list returns me 0/ZERO number of object. Is there something changed recently in the was this API are being used?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.randombugs.com/linux/vmware-webservice-gsoap.html/comment-page-1#comment-633</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sun, 19 Sep 2010 10:55:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=529#comment-633</guid>
		<description>Nope. Is quite a while from when I write this code, but if the API2.5 is backward compatible, then it should work.

Regards</description>
		<content:encoded><![CDATA[<p>Nope. Is quite a while from when I write this code, but if the API2.5 is backward compatible, then it should work.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pankaj</title>
		<link>http://www.randombugs.com/linux/vmware-webservice-gsoap.html/comment-page-1#comment-630</link>
		<dc:creator>Pankaj</dc:creator>
		<pubDate>Tue, 07 Sep 2010 12:18:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=529#comment-630</guid>
		<description>Is this code tested with new API 2.5 version?</description>
		<content:encoded><![CDATA[<p>Is this code tested with new API 2.5 version?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

