[vbox-dev] Webservice connection under perl

Ulrich Moeller umoeller at sun.com
Wed Mar 11 11:55:42 GMT 2009


James,

thanks for pointing this out. It appears that SOAP::Lite has changed 
since the documentation was written.

 From your notes I gather that you ran stubmaker on the 
vboxwebService.wsdl file, not the vboxweb.wsdl file. As you're probably 
aware, the latter includes the former.

Now, stubmaker gets confused with namespaces when running it on the 
service file and injects "http://www.virtualbox.org/Service" into each 
method generated in the vboxService.pm when the namespace should be 
"http://www.virtualbox.org/" (without the "Service").

This is why the documentation says you should run stubmaker on 
vboxweb.wsdl, bypassing the service file, and avoiding the namespace 
confusion. At the time I didn't research the problem in detail since 
this workaround solved it for the time being.

It appears however that stubmaker now behaves differently. With 
SOAP::Lite 0.69 on Gentoo here, it no longer generates a vboxService.pm 
file, but a "FakeService.pm" file which doesn't work.

I have found the following workaround: run stubmaker on 
vboxwebService.wsdl and then, in the resulting vboxService.pm file, 
manually replace all occurences of "http://www.virtualbox.org/Service" 
with "http://www.virtualbox.org/". After that, the clienttest.pl runs 
fine -- except for one other problem with an API change, which is why I 
have attached a new version. This will be fixed in the next SDK release.

If there's somebody reading this who is aware of that we're doing 
something wrong with the namespaces in our WSDL files, we're open for 
feedback. But since all languages handle our files fine except for 
SOAP::Lite, I am suspecting that the problem lies not with us. I'm happy 
to fix the perl code and/or documentation so long as it doesn't break 
the other bindings.

Ulrich


James Lucas wrote:
> Has anyone else encountered this? I am still having issues using the SDK.
> 
> - James
> 
> James Lucas wrote:
>> Frank suggested I moved some of my Virtual Box management scripts to using the
>> API instead of using VBoxManage for querying information about individual
>> machines. I've followed all of the documentation (including generating the
>> vboxService.pm file) in the SDK however I have the following issue.
>>
>> When running the perl clienttest.pl file provided by the SDK the vboxwebsrv
>> throws a error "SOAP FAULT: Method 'namesp1:IWebsessionManager_logon' not
>> implemented: method name or namespace not recognized [SOAP-ENV:Client]"
>>
>> Web service authentication is set to null for testing. Using the distribution
>> provided program 'webtest' I know that the vboxwebsrv is working. 
>>
>> Has anyone encountered this? If anyone has the perl clienttest working can you
>> please let me know if the SOAP generated is different from what I have below.
>> (SOAP requests can be dumped using [ use SOAP::Lite +trace => 'debug'; ] in
>> clienttest.
>>
>> The SOAP generated is:
>>
>> [root at artemis1 samples]# ./clienttest.pl 
>> SOAP::Transport::HTTP::Client::send_receive: POST http://localhost:18083/
>> HTTP/1.1
>> Accept: text/xml
>> Accept: multipart/*
>> Accept: application/soap
>> Content-Length: 649
>> Content-Type: text/xml; charset=utf-8
>> SOAPAction: ""
>>
>> <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
>> xmlns:namesp1="http://www.virtualbox.org/Service"
>> soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:interface="urn:vbox" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:vbox="http://www.virtualbox.org/"><soap:Body><namesp1:IWebsessionManager_logon><username
>> xsi:type="xsd:string">test</username><password
>> xsi:type="xsd:string">test</password></namesp1:IWebsessionManager_logon></soap:Body></soap:Envelope>
>> SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
>> Connection: close
>> Server: gSOAP/2.7
>> Content-Length: 629
>> Content-Type: text/xml; charset=utf-8
>> Client-Date: Sat, 20 Dec 2008 23:42:23 GMT
>> Client-Peer: 127.0.0.1:18083
>> Client-Response-Num: 1
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:vbox="http://www.virtualbox.org/"><SOAP-ENV:Body
>> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Method
>> 'namesp1:IWebsessionManager_logon' not implemented: method name or namespace
>> not
>> recognized</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
>> [clienttest] Logon to session manager with user "test" and password "test"
>> failed.
>> Stopped at ./clienttest.pl line 79.
>>
>>
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clienttest.pl
Type: text/x-perl
Size: 4401 bytes
Desc: not available
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20090311/05097ec1/attachment.bin>


More information about the vbox-dev mailing list