A WSDL 2.0 description of the EUtils EFetch web service

·

There are surprisingly few examples of WSDL 2.0 files available online, and hardly any that use the "HTTP" bindings rather than SOAP. Here's one that describes the non-SOAP EUtils EFetch web service, adapted from the existing SOAP WSDLs:

It has the schema embedded for describing the request format, and imports an XSD file for describing most of the response format.

It works ok in WSF/PHP up to a point - it doesn't seem to parse the response, and I'm not sure yet whether the problem is in WSF/PHP or in the WSDL/XSD:

<?php
set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/wsf-php/scripts');
$client = new WSClient(array('useSOAP' => FALSE, 'HTTPMethod' => 'GET', 'wsdl' => 'efetch-pubmed.wsdl'));
$proxy = $client->getProxy();
$response =  $proxy->eFetch(array(
   'db' => 'pubmed', 
   'retmode' => 'xml',
   'id' => 12345,
));    
print_r($response);

WSF/PHP shouldn't really need the 'useSOAP' and 'HTTPMethod' parameters - those details are already configured in the WSDL file (the 'type' and 'whttp:methodDefault' attributes of the 'binding' element). The eFetch method shouldn't need the 'db' and 'retmode' parameters either, as they're set as 'fixed' parameters in the schema's description of the request format.

The WSDL file almost validates:

xmllint --noout --schema http://www.w3.org/2007/06/wsdl/wsdl20.xsd efetch-pubmed.wsdl
(you have to fetch a local copy of the validation schema and change "strict" to "lax", as it doesn't cope with having one schema embedded inside another).

The same is true of the XSD file:

xmllint --noout --schema http://www.w3.org/2001/XMLSchema.xsd efetch-pubmed.xsd