Erlang/OTP Forums

Author Message

<  Yaws mailing list  ~  yaws_soap_lib and battling vmware soap API

jeffm
Posted: Thu Feb 04, 2010 3:34 am Reply with quote
User Joined: 29 Sep 2008 Posts: 43
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,

http://www.vmware.com/support/developer/vc-sdk/

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

http://yaws.hyber.org/soap_intro.yaws

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").
{wsdl,[],
{model,[{type,'_document',sequence,
[{el,[{alt,'soap:Header','soap:Header',[],1,1,true,
undefined},
.....

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).
[{operation,"WeatherForecast","WeatherForecastSoap",
"GetWeatherByPlaceName","WeatherForecastSoap",
"http://www.webservicex.net/WeatherForecast.asmx",
"http://www.webservicex.net/GetWeatherByPlaceName"},
{operation,"WeatherForecast","WeatherForecastSoap",
"GetWeatherByZipCode","WeatherForecastSoap",
"http://www.webservicex.net/WeatherForecast.asmx",
"http://www.webservicex.net/GetWeatherByZipCode"}]


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"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:interface="urn:vim2"
>
<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" />
</port>
</service>
</definitions>

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?

Jeff.





------------------------------------------------------------------------------
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.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist
View user's profile Send private message
Willem
Posted: Thu Feb 04, 2010 1:26 pm Reply with quote
User Joined: 21 Jul 2006 Posts: 59
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.
View user's profile Send private message
jeffm
Posted: Fri Feb 05, 2010 6:20 am Reply with quote
User Joined: 29 Sep 2008 Posts: 43
Thanks. everything seems to work up to the last step. Nothing to do with the typo there, but having to do with the funny way vmware uses soap. The documentation is next to useless you already know the answer. Regardless I'm slowly working through it. Just need to work out the steps in a soap session to do what I need to do and how parameters map to the yaws_soap_lib calls. Something hasn't quite clicked yet.

Thanks for the help,
Jeff.

On 5/02/10 12:18 AM, Willem de Jong wrote:
Quote:
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.
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum