I am trying to access a taxonomy web service provided by SharePoint from PHP but so far am not having much luck.
I managed to get it working with the list webservice but this service is being much more difficult.
One of the differences that this service has is an output parameter and I don’t know how to deal with that.
Here is the core code I am using.
$params = array('sharedServiceIds' => '<termStoreId>66e3f3ae-573a-4dab-b86a-5175f01ca3b5</termStoreId>',
'termSetIds' => '<termSetId>e7df9a5c-a760-4247-96ed-e4c125fad54a</termSetId>',
'lcid' => 1033,
'clientTimeStamps' => '<timeStamp>633992461437070000</timeStamp>',
'clientVersions' => 1,
);
//echo file_get_contents($wsdl, FILE_TEXT, stream_context_create(array('http' => array('timeout' => 1))), 0, 1);
$rawXMLresponse = null;
try{
$rawXMLresponse = $soapClient->GetTermSets($params);//->GetListItemsResult->any;
}
catch(SoapFault $fault){
echo 'Fault code: '.$fault->faultcode;
echo 'Fault string: '.$fault->faultstring;
}
echo "Printing response<br>\n";
print_r($rawXMLresponse);
I am getting the following fault code and message
Fault code: soap:ServerFault string: Server was unable to process request. ---> Data at the root level is invalid. Line 1, position 1.
Now in my SharePoint logs I get this error
TaxonomyClientService: Get term sets failed: System.Xml.XmlException: Data
at the root level is invalid. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at Microsoft.SharePoint.Taxonomy.Internal.CommonUtilities.GetIntsFromXml(String ints)
at Microsoft.SharePoint.Taxonomy.WebServices.TaxonomyClientService.GetTermSets(String sharedServiceIds, String termSetIds, Int32 lcid, String clientTimeStamps, String clientVersions, String& serverTermSetTimeStampXml)
I have this working in a c# desktop application so I know the service is working.
I don’t know what to do to get this to work from php.
Ok so I spent over a full day on this problem to notice I didn’t format the clientVersions parameter correctly
Should be