我正在使用ssl-套接字编写一个vCenter代理,以减少与vCenter的连接数量。
我有一个连接使用vi-java更新vCenter库存(PropertyCollector、PropertyFilter等)我希望将返回到vi-java的对象转换为SOAP,以便写入套接字。
是否有适用于所有vi-java类型的包?
这是PropertyCollector对象的序列化,例如:
<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>虽然这是预期的SOAP响应:
<?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>发布于 2015-06-23 10:00:17
在vi-java中,XmlGen.toXml(...)发挥了作用。
https://stackoverflow.com/questions/30978653
复制相似问题