<?php

include 'moby_soap_factory.php';

# Uncomment to disable WSDL caching (on by default in PHP and can be a PITA when developing)
# ini_set("soap.wsdl_cache_enabled", "0");

# Your settings (as above in the service implementation)...
$registry_endpoint = 'http://moby.ucalgary.ca/moby/MOBY-Central.pl';
$registry_uri = 'http://biomoby.org/MOBY/Central';
$service_name = 'convertIdentifier2KeggID';
$authority = 'bioinfo.icapture.ubc.ca';
$wsdl_file = '';

# Don't modify the following two lines (unless you want to insert a custom try/catch around the generator)
$factory = new moby_soap_factory();
$client = $factory->generate('client', $registry_endpoint, $registry_uri, $service_name, $authority, $wsdl_file);

# Create the moby XML string
$moby_request =<<<EOD
<?xml version="1.0" encoding="UTF-8"?>
<moby:MOBY xmlns:moby="http://www.biomoby.org/moby">
  <moby:mobyContent>
    <moby:mobyData moby:queryID="sip_1_">
      <moby:Simple moby:articleName="identifier">
        <moby:Object moby:id="AF348515" moby:namespace="GenBank" />
      </moby:Simple>
    </moby:mobyData>
  </moby:mobyContent>
</moby:MOBY>
EOD;

# Consume the service
$moby_response = $client->__soapCall($service_name, array($moby_request));

# Parse the returned XML
//do whatever with the response
print ($moby_response);
?>

