Hi Jeff,

The first test you did failed because of a typo, I think. There is one slash too many.

Even with the correct file name you will need to modify the WSDL a little bit, I am afraid. I didn't look at it in detail, but it looks like the import statement is not processed correctly. 

You should put the content of vim.wsdl inside vimService.wsdl, at the location of the import statement. You have to exclude the top level <definitions> element from vim.wsdl, obviously, and you also have to declare the vim25 namespace. The first bit of the resulting WSDL should look like this:

<definitions targetNamespace="urn:vim25Service"

etc (over 42000 lines...).

I called the resulting file testVim.wsdl.

Then I did:

1>  TestWsdl = yaws_soap_lib:initModel("testVim.wsdl").


2> yaws_soap_lib:write_hrl(TestWsdl, "vim.hrl").

This creates a .hrl file with record declarations. It will be unavoidable to have a look at those, and the WSDL (or the documentation provided by vmware).

If you want to call the "CurrentTime" service, it will look like this:

3> yaws_soap_lib:call(TestWsdl, "CurrentTime", [{'p:CurrentTimeRequestType', [], {'p:ManagedObjectReference{[], "test", "test"}}], []).  

Good luck,

On Thu, Feb 4, 2010 at 4:33 AM, jm <jeffm@ghostgun.com> wrote:
Some foolhardy part of me decided that it would be a good idea to use
Erlang at work today to try and talk to the SOAP API that vmware uses. I
ran into some problems with using yaws and I'm hoping someone here may
be able to help. See,


for information on VMware's Web Sevices SDK 4.0. Having installed
erlang, and yaws I tested it with the example at


to make sure everything was functioning correctly before moving on. Next
I loaded the wsdl files provided as part of the SDK, after editing the
URL in the file to point to the correct location,

 > ServiceWsdl = yaws_soap_lib:initModel("file:///./vimService.wsdl").
** exception error: no match of right hand side value {error,enoent}
     in function  yaws_soap_lib:get_url_file/1
     in call from yaws_soap_lib:parseWsdls/5
     in call from yaws_soap_lib:initModel2/5

not so great. Try the other file,

WSDL = yaws_soap_lib:initModel("file://./SDK/wsdl/vim/vim.wsdl").

That's better. Now, try an operation,

 > yaws_soap_lib:call(WSDL, "CurrentTime", []).
{error,"operation not found"}

 > yaws_soap_lib:wsdl_operations(WSDL).

This not looking good. For comparison, a similar operation on the WSDL
from the example gives,

 > yaws_soap_lib:wsdl_operations(WeatherWsdl).

The file vimService.wsdl contains, with the server IP replaced with X.X.X.X,

<?xml version="1.0" encoding="UTF-8" ?>
   Copyright 2005-2007 VMware, Inc.  All rights reserved.
<definitions targetNamespace="urn:vim2Service"
<import location="vim.wsdl" namespace="urn:vim2" />
<service name="VimService">
<port binding="interface:VimBinding" name="VimPort">
<soap:address location="https://X.X.X.X/sdk/vimService" />

The file SDK/wsdl/vim25/vim.wsdl is much longer so I won't include it
here, but is available from the link to the sdk above (click on
downloads to right of the date under the title).

My questions, which  I hoping someone could help me with, are

1) Has anyone tried this before? Do you have some examples that I could use?
2) Is this WSDL file non-compliant? When I look at the file it has a
somewhat different structure to that in the yaws example.
3) Is there an alternate library which may understand this wsdl?
4) Is there an alternate angle/method of attack I should take to get
this working in erlang?
5) any other thoughts?


The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
Erlyaws-list mailing list