gsoap and fedora

August 6, 2008

Here is a quick tutorial on how to access the SOAP interface for a fedora repositary.  (For more info about fedora see here.)

We need the gsoap package for Ubuntu 8.04 Hardy. So:

  sudo apt-get install gsoap

Once installed we use some tools called wsdl2h and soapcpp2 to create stubs for us.  So:

 wsdl2h -c -o fedora-a.h http://www.fedora.info/definitions/1/0/api/Fedora-API-A.wsdl

 (You can use -r <proxy> in the wsdl2h command if your behind a web proxy)

 soapcpp2 fedora-a.h

Then open soapClient.c in your favorite editor and replace all occurrences of localhost with the hostname/ip address of your server.

We need a simple application which allows us to make use of these stubs.  This can be found here.  You’ll need to change the username and password to match what you have configured on the server.

The application then needs compiling which is easily done with the following command.

 g++ simple-client.cpp soapC.c soapClient.c /usr/include/gsoap/stdsoap2.c \
 -o simple-soap-client

This applications should then be able to connect to your fedora server and print out the information describing your repository.