[CATALOG V2] - Erreur d'interface de recherche de métadonnée

Added by FREJAFON Alexandre almost 8 years ago

Bonjour,

Je tente d'accéder à l'interface publique de recherche de métadonnées depuis l'url :
index.php?option=com_easysdi_catalog&view=search&task=listCatalogContent&context=MAIN&lang=fr

Hors j'obtiens une page blanche. Les logs PHP m'informent d'une erreur fatale :
Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Opening and ending tag mismatch: HR line 1 and body in IDS\components\com_easysdi_catalog\core\controller\catalog.site.easysdi.php on line 2701

La ligne 2701 correspond à $cswResults= simplexml_load_string($xmlResponse);

Comment résoudre cette erreur ?

Dans ce même fichier, la ligne précédente est
$xmlResponse = ADMIN_metadata::CURLRequest("POST", $catalogUrlBase,$xmlBody);

Du fait d'une erreur similaire et liée au fichier IDS\components\com_easysdi_catalog\core\controller\metadata.site.easysdi.php ligne 438
J'avais été obligé de
remplacer $cswResults = DOMDocument::loadXML(ADMIN_metadata::CURLRequest("GET", $catalogUrlGetRecordById))
par $cswResults = DOMDocument::load($catalogUrlGetRecordById);

S'agit-il ici de la même erreur ? Pourquoi ai-je ces erreurs liées au CURLRequest ?

je précise que je travaille sur une distribution WAMP.

Cordialement


Replies (16)

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by FREJAFON Alexandre almost 8 years ago

Pour préciser ma demande, la connexion EasySDI <-> Geonetwork est fonctionnelle et la seule métadonnée présente sur le catalogue a été saisie au moyen des outils de création de métadonnée en Front End d'EasySDI

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by Mérour Xavier almost 8 years ago

Bonjour,

Question préliminaire avant de creuser... j'ose vous demander si php_curl extension est bien activé dans votre configuration PHP ? :-)

Xavier

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by FREJAFON Alexandre almost 8 years ago

Oui, l'extension php_curl est bien activée ;-)

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by Magoni Bruno almost 8 years ago

Please, submit your posts in ENGLISH that most people can understand what is talk about ;-)

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by FREJAFON Alexandre almost 8 years ago

I try to access to public interface for metadata search from the url:
index.php?option=com_easysdi_catalog&view=search&task=listCatalogContent&context=MAIN&lang=fr

I'm redirected to a blank page. PHP logs describe a fatal error:
Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Opening and ending tag mismatch: HR line 1 and body in IDS\components\com_easysdi_catalog\core\controller\catalog.site.easysdi.php on line 2701

The line 2701 corresponds to $ cswResults = simplexml_load_string ($ xmlResponse);

How to resolve this error?

In the same file, the previous line is
$xmlResponse = ADMIN_metadata::CURLRequest("POST", $catalogUrlBase,$xmlBody);

Because of a similar error related to file IDS\components\com_easysdi_catalog\core\controller\metadata.site.easysdi.php line 438
I was forced to
replace $ cswResults = DOMDocument:: loadXML (ADMIN_metadata: CURLRequest ("GET", $ catalogUrlGetRecordById))
by $ cswResults = DOMDocument:: load ($ catalogUrlGetRecordById);

Is this the same error? Why do I get these errors related CURLRequest?

I work on a WAMP distribution.

Thanks and sorry for my poor english

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by Baud Rémy almost 8 years ago

Hello Alex,

if simplexml_load_string ($xmlResponse) is failing, its mostly because the loaded content is not well formed. For instance there could be a php error or notice merged with the xml response that makes it unreadable by the parser.

I suggest you to try to configure your php.ini with display_error=off, restart apache and try again.

If it doesn't fix the issue, please post the content of the $xmlResponse here, so that we can see what is making the parser failing.

you can do this like this:

//output response in clear text and exits before parser error
echo $xmlResponse;
exit;
simplexml_load_string ($xmlResponse)

regards,
Rémy

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by FREJAFON Alexandre almost 8 years ago

I configured php.ini to see error messages.

If I consult $xmlResponse I get the error "Access is denied" ?

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by Baud Rémy almost 8 years ago

Means you cannot access geonetwork on http without credentials.

Did u try to make some csw example request against your geonetwork to see if you need credientials?

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by FREJAFON Alexandre almost 8 years ago

I just successfully tested the queries :
- geonetwork/srv/en/csw?request=GetRecordById&service=CSW&version=2.0.2&elementSetName=full&outputschema=csw:IsoRecord&content=CORE&id=603841d5-5576-4645-8bca-f687faed0809
- proxy/ogc/geonetwork_csw?request=GetRecordById&service=CSW&version=2.0.2&elementSetName=full&outputschema=csw:IsoRecord&content=CORE&id=603841d5-5576-4645-8bca-f687faed0809

xml returned in the correct format


<csw:GetRecordByIdResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2">
<gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:srv="http://www.isotc211.org/2005/srv" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gml="http://www.opengis.net/gml" xmlns:geonet="http://www.fao.org/geonetwork">
<gmd:fileIdentifier xmlns:gmx="http://www.isotc211.org/2005/gmx">
<gco:CharacterString>603841d5-5576-4645-8bca-f687faed0809</gco:CharacterString>
</gmd:fileIdentifier>
<gmd:language>
<gco:CharacterString />
</gmd:language>

&lt;gmd:characterSet&gt;
&lt;gmd:MD_CharacterSetCode codeListValue="utf8" codeList="http://www.isotc211.org/2005/resources/codeList.xml#MD_CharacterSetCode" /&gt;
&lt;/gmd:characterSet&gt;
&lt;gmd:language&gt;
&lt;gmd:LanguageCodeISO&gt;fra&lt;/gmd:LanguageCodeISO&gt;
&lt;/gmd:language&gt;
&lt;gmd:locale&gt;
... ...

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by Baud Rémy almost 8 years ago

easysdi does an HTTP post request so testing get requests prolly won't help out.

Did you configure any service account in backend? (Généralités->Compte de service)

Is there any log in geonetwork for these requests?

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by FREJAFON Alexandre almost 8 years ago

I had forgotten these call by POST .... sorry ...

I do not understand the relationship there might be with the service account ? My service accounts are declared. I generated the metadata records from the front end interface with an user EasySDI recorded.

I can't find absolutely no trace in geonetwork logs. I think the issue comes before ...

In the file localhost_access_log (Apache file) I find these calls :
127.0.0.1 - - [20/Sep/2011:17:33:53 +0200] "POST /proxy/ogc/geonetwork_csw HTTP/1.1" 403 1018

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by Baud Rémy almost 8 years ago

What is actually the catalogue url in your easysdi configuration? This is the value "Url du catalogue" in the easysdi configuration backend.

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by FREJAFON Alexandre almost 8 years ago

URL is http://127.0.0.1:8080/proxy/ogc/geonetwork_csw

I think the problem is a proxy configuration.
When I declare a direct url to geonetwork (Generalités-> Url du catalogue), I access the metadata

When I declare a url to the proxy (like 127.0.0.1:8080/proxy/ogc/geonetwork_csw), I can't access.

The proxy's url is a local url but is correctly accessible for components (same url for JAVA components, PHP server ...)

Thank you very much for your help

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by FREJAFON Alexandre almost 8 years ago

Yes !! I found the error !!

in the file security-config.xml of the spring configuration , I wrote

<security:intercept-url pattern="(.*)" access="anonymous" />

I corrected by
<security:intercept-url pattern="(.*)" access="anonymous,proxy_user" />

And it works !! ( I confess to having difficulty understanding this configuration ...)

My last problem is that the search labels appear as "fd3ae7a9-e416-48af-acd8-22e07d67127a_LABEL" ...
I think this is an incorrect translation of language. However, I selected a default language in the Joomla back-end ?

Thanks,

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by FREJAFON Alexandre almost 8 years ago

Sorry,

I mean

<security:intercept-url pattern="(.*)_csw(.*)" access="anonymous" />

corrected by

<security:intercept-url pattern="(.*)_csw(.*)" access="anonymous,proxy_user" />

RE: [CATALOG V2] - Erreur d'interface de recherche de métadonnée - Added by Mérour Xavier almost 8 years ago

OK, thanks for your feedback.
Good to see that the issue was related to a configuration, not to code :-)

Have a nice day,

(1-16/16)