# VirtualBox - build with webservice



## dekloper (Apr 5, 2010)

Hello world!

There is the following problem with the build ports with enable webservice.
The default port is going without the inclusion of web management options.
If the port to collect manually, there is an option *./configure --enable-webservice*(in linux it works).
FreeBSD's configuration script does not allow to correctly compile the port with the option *--enable-webservice*, because of existing gaps (missing GSOAP libraries and other..)


```
>cat configure.log
...
...
***** Checking GSOAP compiler *****
** soapcpp2 not found -- disabling webservice!
>
>whereis soapcpp2
soapcpp2:
```

1. Installing gsoap port


```
Port:   gsoap-2.7.13
Path:   /usr/ports/devel/gsoap
Info:   Generator Tools for Coding SOAP/XML Web Services in C and C++
Maint:  sem@FreeBSD.org
>
>whereis soapcpp2 
soapcpp2: /usr/local/bin/soapcpp2
```

2. Modify the script ./configure


```
# Check for gSOAP.
#
check_gsoap()
{
  test_header "GSOAP compiler"
  if [ -z "$GSOAP" ]; then
    [B]GSOAP="/usr/local"[/B]
  fi
  if which_wrapper "$GSOAP/bin/soapcpp2" > /dev/null; then
    if which_wrapper "$GSOAP/bin/wsdl2h" > /dev/null; then
      if [ -f "$GSOAP/include/stdsoap2.h" ]; then
        # TODO: Check for libgsoap++.a/so

        if [ -z "$GSOAP_IMPORT" ]; then
          GSOAP_IMPORT="$GSOAP/share/gsoap/import"
          if [ ! -d "$GSOAP_IMPORT"  -a  -d "$GSOAP/include/gsoap" ]; then
            GSOAP_IMPORT="$GSOAP/include/gsoap"
          fi
        fi
        if [ -f "$GSOAP_IMPORT/stlvector.h" ]; then
          cnf_append "VBOX_GSOAP_INSTALLED"   "1"
          cnf_append "VBOX_PATH_GSOAP"        "$GSOAP"
          cnf_append "VBOX_PATH_GSOAP_IMPORT" "$GSOAP_IMPORT"
```

3. Added option in Makefile

```
CONFIGURE_ARGS+=--enable-webservice --with-gcc="${CC}" --with-g++="${CXX}"
```

4. O`k, after these modifications have to compile and run the service web management

```
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.1.4_OSE/out/freebsd.x86/release/bin>ll | grep web
-rw-------  1 root  wheel       157 31 ÃÃÃ’ 13:34 2010-03-31-06-34-30.069-vboxwebsrv-52766.log
-rw-------  1 root  wheel       157 31 ÃÃÃ’ 13:37 2010-03-31-06-36-35.058-vboxwebsrv-52802.log
-rwxr-xr-x  1 root  wheel  36694619 18 ÃÃÃ’ 18:26 vboxwebsrv
-rwxr-xr-x  1 root  wheel  31407497 18 ÃÃÃ’ 18:25 webtest
```

5. Starting

```
./vboxwebsrv -H 10.0.0.200 -p 81
Sun VirtualBox Webservice Version 3.1.4_OSE
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.
Socket connection successful: host = 10.0.0.200, port = 81, master socket = 8
```

6. In web browser`s are seeing the following error


```
With this XML-file is not bound by any one style sheet. Below is a tree of elements.

âˆ’
<SOAP-ENV:Envelope>
âˆ’
<SOAP-ENV:Body>
âˆ’
<SOAP-ENV:Fault SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>HTTP GET method not implemented</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
```

On the server console see

```
1: accepted connection from IP=10.0.0.150 socket=10... #### SOAP FAULT: HTTP GET method not implemented [SOAP-ENV:Client]
Request served
```


=====================

Please, help me solve this problem!

P.S. Successful compilation of the service was held on the version of VirtualBox-3.1.4, in earlier compilation service fails...


----------



## Tomse (Nov 11, 2010)

This thread is now old, and this has been fixed. I haven't tested ealier versions of virtualbox 3.2.10.
To use the web service properly you could combine it with phpvirtualbox

cheers
/Tomse


----------

