1 Reply Latest reply on Mar 27, 2018 9:55 AM by AlanSthomas

    Need help with SOAP request for guest operations

    AlanSthomas Lurker

      I'm working on a php script to do some automation. This is using the standard SOAP/WSDL and PHP. Mostly things are going well, but I have ran into an issue with guest operations. Can anyone either post the XML request/response or give an example using the MOB. I've been working with listFilesInGuest, but anything will do. I just need to understand how the guest authorization works. I've been able to use pyvmomi to get this, but I can't seem to figure out how to output the request/response in python. My requirement is for PHP so I can't move to python either.

       

      Any help is greatly appreciated.

        • 1. Re: Need help with SOAP request for guest operations
          AlanSthomas Lurker

          I finally figured this out. I have to say there are some real disconnects in VMware. Onyx was a great help, but as it doesn't support http, I ended up writting a man in the middle attack to dump the XML.

           

          Anyway for anyone looking for help on how to do this, best I can tell the WDSL is broken. At least with php. I couldn't get it the function call to work, even though I have many others working fine. So I moved to raw XML and CURL. To be clear, I'm using CURL just for this. I'm sticking to the WDSL for everythen else.

           

          Here is what you need to send as a POST.

           

           

          The response will have a URL for you to POST the file to. Again I used curl. You do need to set the cookie for auth, which you can pull from the last SOAP response. I also needed to set header SOAPAction. Again you can pull from the last response. Outside of that its just standard stuff.

           

          Hope this helps someone.