Skip to content

Instantly share code, notes, and snippets.

@margulies
Forked from pol/wos.php
Created April 6, 2013 18:02
Show Gist options
  • Save margulies/5327006 to your computer and use it in GitHub Desktop.
Save margulies/5327006 to your computer and use it in GitHub Desktop.
<?php
$auth_url = "http://search.isiknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate?wsdl";
$auth_client = @new SoapClient($auth_url);
$auth_response = $auth_client->authenticate();
print_r($auth_response);
echo "REQUEST HEADERS:\n" . $auth_client->__getLastRequestHeaders() . "\n";
$search_url = "http://search.isiknowledge.com/esti/wokmws/ws/WokSearchLite?wsdl";
$search_client = @new SoapClient($search_url);
print_r($search_client);
// $search_client->__setCookie("Cookie")
$search_xml = <<<EOF
<xml>
<queryParameters>
<databaseID>WOS</databaseID>
<userQuery>AU=Douglas T*</userQuery>
<editions>
<collection>WOS</collection>
<edition>SSCI</edition>
</editions>
<editions>
<collection>WOS</collection>
<edition>SCI</edition>
</editions>
<queryLanguage>en</queryLanguage>
</queryParameters>
<retrieveParameters>
<count>5</count>
<fields>
<name>Date</name>
<sort>D</sort>
</fields>
<firstRecord>1</firstRecord>
<timeSpan></timeSpan>
<symbolicTimeSpan></symbolicTimeSpan>
</retrieveParameters>
</xml>
EOF;
$search_array = array(
'queryParameters' => array(
'databaseID' => 'WOS',
'userQuery' => 'AU=Douglas T*',
'editions' => array(
array('collection' => 'WOS', 'edition' => 'SSCI'),
array('collection' => 'WOS', 'edition' => 'SCI')
),
'queryLanguage' => 'en'
),
'retrieveParameters' => array(
'count' => '5',
'fields' => array(
array('name' => 'Date', 'sort' => 'D')
),
'firstRecord' => '1'
)
);
$search_obj = simplexml_load_string($search_xml);
// print_r($search_obj);
try{
$search_response = $search_client->search($search_array);
} catch (Exception $e) {
echo $e->getMessage();
}
print_r($search_response);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment