Listing 11
// file: client.cpp
#include "soapCollisionServiceProxy.h"
#include "CollisionService.nsmap"
main()
{ // create a proxy
CollisionService proxy;
// create two points and a circle
Point p, q(1.0, 1.0);
Circle c(1.0, 1.0, 2.0);
// create a collection with the objects
Objects collection;
collection.objects.push_back(&p);
collection.objects.push_back(&q);
collection.objects.push_back(&c);
// compute the hits remotely and print the count
int hits;
if (proxy.cws__detect_collisions(collection, hits) == SOAP_OK)
cout << "Hits=" << hits << endl;
else
soap_print_fault(proxy.soap, stderr);
}