vCenter proxy implementation

81 views Asked by At

I am writing a vCenter proxy using ssl-sockets in order to reduce number of connections to the vCenter.

I have one connection using vi-java to update vCenter inventory (PropertyCollector, PropertyFilter, etc.) and I want to translate the objects return to vi-java to SOAP XML to write to the socket.

Is there a package that does it for all vi-java types?

This is a serialization of the PropertyCollector object for example:

<com.vmware.vim25.mo.PropertyCollector>
  <serverConnection>
  ....
  </serverConnection>
  <mor>
    <val>session[b7ea29d3-92e3-0ac9-e017-2748a3120379]52aab664-bb24-845a-7189-d48085e866aa</val>
    <type>PropertyCollector</type>
  </mor>
</com.vmware.vim25.mo.PropertyCollector>

While this is the expected SOAP response:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<CreatePropertyCollectorResponse xmlns="urn:vim25"><returnval type="PropertyCollector">session[b7ea29d3-92e3-0ac9-e017-2748a3120379]52aab664-bb24-845a-7189-d48085e866aa</returnval></CreatePropertyCollectorResponse>
</soapenv:Body>
</soapenv:Envelope>
1

There are 1 answers

0
DanielM On BEST ANSWER

In vi-java, XmlGen.toXml(...) does the trick