[GeoNetwork-devel] How to get JSESSIONID from xml.user.login service?

Hi all,

I am developing an Java application (not Servlet) that calls the
*mef.import* service by GeoNetwork to publish metadata.

The Developer Manual specifies that, to invoke those xml services like
*mef.imort*and *metadata.insert* user authentication is required. The manual
says that JSESSIONID cookie will be set and returned back to the client
uopon successful request by a POST/GET call.

"The authentication process sets JSESSIONID cookie with the authentication
token that should be send in the services that need authentication to be
invoqued. Otherwise, a Service not allowed exception will be returned by
these services."

However, I can only receive a response despite successful authentication
that is:
*<?xml version="1.0" encoding="UTF-8"?>
<ok />*

No JSESSIONID is received.

Because of this, I cannot continue to invoke mef.import service on
GeoNetwork as it always returned an error saying *Service not allowed*.
According to Developer Manual, it is caused by authentication failure.

Was I wrong in calling these services or was there anything I missed or
mistaken? Thanks for any tips!

Cheers, Alex

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/How-to-get-JSESSIONID-from-xml-user-login-service-tp6995137p6995137.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

Alex,

There are couple of Java examples provided in documentation site on how you
can use the same authenticated httpClient object for services which require
authentication. Take a look at this here

http://geonetwork-opensource.org/manuals/2.6.4/developer/xml_services/java_x
ml_services.html

Regards
Kumaran

-----Original Message-----
From: alextc [mailto:alex.tao.chen@anonymised.com]
Sent: Tuesday, November 15, 2011 10:26 AM
To: geonetwork-devel@lists.sourceforge.net
Subject: [GeoNetwork-devel] How to get JSESSIONID from xml.user.login
service?

Hi all,

I am developing an Java application (not Servlet) that calls the
*mef.import* service by GeoNetwork to publish metadata.

The Developer Manual specifies that, to invoke those xml services like
*mef.imort*and *metadata.insert* user authentication is required. The manual
says that JSESSIONID cookie will be set and returned back to the client
uopon successful request by a POST/GET call.

"The authentication process sets JSESSIONID cookie with the authentication
token that should be send in the services that need authentication to be
invoqued. Otherwise, a Service not allowed exception will be returned by
these services."

However, I can only receive a response despite successful authentication
that is:
*<?xml version="1.0" encoding="UTF-8"?>
<ok />*

No JSESSIONID is received.

Because of this, I cannot continue to invoke mef.import service on
GeoNetwork as it always returned an error saying *Service not allowed*.
According to Developer Manual, it is caused by authentication failure.

Was I wrong in calling these services or was there anything I missed or
mistaken? Thanks for any tips!

Cheers, Alex

--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/How-to-get-JSESSIONID-from-xml-user-l
ogin-service-tp6995137p6995137.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

----------------------------------------------------------------------------
--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

Thanks Kumaran for your help. That is really what I needed!

Now I am able to import mef file with user authentication. :slight_smile:

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/How-to-get-JSESSIONID-from-xml-user-login-service-tp6995137p7002188.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

Alex,

Would you mind sharing your code for this task. I am getting stuck on this
functionality.

Cheers,
Byron

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/How-to-get-JSESSIONID-from-xml-user-login-service-tp6995137p7088541.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.